Skip to content
Snippets Groups Projects
  1. Mar 31, 2011
  2. Mar 29, 2011
  3. Jan 10, 2011
  4. Dec 14, 2010
  5. Oct 16, 2010
  6. Aug 15, 2010
  7. Mar 30, 2010
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Guess-its-ok-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  8. Feb 16, 2010
  9. Jan 28, 2010
  10. Nov 05, 2009
  11. Sep 24, 2009
  12. Aug 28, 2009
  13. Aug 27, 2009
  14. Jun 24, 2009
  15. May 30, 2009
  16. May 16, 2009
  17. Apr 04, 2009
  18. Apr 03, 2009
  19. Jan 03, 2009
  20. Nov 08, 2008
  21. Oct 23, 2008
    • Lin Ming's avatar
      ACPI: replace ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ...) with printk · 55ac9a01
      Lin Ming authored
      
      ACPI_DB_ERROR and ACPI_DB_WARN were removed from ACPICA core.
      So replace ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ...) with printk(KERN_ERR PREFIX ...)
      and ACPI_DEBUG_PRINT((ACPI_DB_WARN, ...) with printk(KERN_WARNING PREFIX ...)
      
      We do not use ACPI_ERROR/ACPI_WARNING since they're not exported, see
      -------------------------------------------------------------
      commit 6468463a
      Author: Len Brown <len.brown@intel.com>
      Date:   Mon Jun 26 23:41:38 2006 -0400
      
          ACPI: un-export ACPI_ERROR() -- use printk(KERN_ERR...)
      
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      -------------------------------------------------------------
      
      Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      55ac9a01
  22. Oct 11, 2008
  23. Jul 26, 2008
  24. Jul 18, 2008
    • Mike Travis's avatar
      cpumask: Replace cpumask_of_cpu with cpumask_of_cpu_ptr · 65c01184
      Mike Travis authored
      
        * This patch replaces the dangerous lvalue version of cpumask_of_cpu
          with new cpumask_of_cpu_ptr macros.  These are patterned after the
          node_to_cpumask_ptr macros.
      
          In general terms, if there is a cpumask_of_cpu_map[] then a pointer to
          the cpumask_of_cpu_map[cpu] entry is used.  The cpumask_of_cpu_map
          is provided when there is a large NR_CPUS count, reducing
          greatly the amount of code generated and stack space used for
          cpumask_of_cpu().  The pointer to the cpumask_t value is needed for
          calling set_cpus_allowed_ptr() to reduce the amount of stack space
          needed to pass the cpumask_t value.
      
          If there isn't a cpumask_of_cpu_map[], then a temporary variable is
          declared and filled in with value from cpumask_of_cpu(cpu) as well as
          a pointer variable pointing to this temporary variable.  Afterwards,
          the pointer is used to reference the cpumask value.  The compiler
          will optimize out the extra dereference through the pointer as well
          as the stack space used for the pointer, resulting in identical code.
      
          A good example of the orthogonal usages is in net/sunrpc/svc.c:
      
      	case SVC_POOL_PERCPU:
      	{
      		unsigned int cpu = m->pool_to[pidx];
      		cpumask_of_cpu_ptr(cpumask, cpu);
      
      		*oldmask = current->cpus_allowed;
      		set_cpus_allowed_ptr(current, cpumask);
      		return 1;
      	}
      	case SVC_POOL_PERNODE:
      	{
      		unsigned int node = m->pool_to[pidx];
      		node_to_cpumask_ptr(nodecpumask, node);
      
      		*oldmask = current->cpus_allowed;
      		set_cpus_allowed_ptr(current, nodecpumask);
      		return 1;
      	}
      
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      65c01184
  25. Jul 16, 2008
    • Randy Dunlap's avatar
      acpi: fix printk format warning · 12b2b34e
      Randy Dunlap authored
      
      Fix printk format warning:
      
      linux-next-20080617/drivers/acpi/processor_throttling.c:1258: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
      
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      12b2b34e
    • Yi Yang's avatar
      ACPI: fix processor throttling set error · 3d532d5e
      Yi Yang authored
      http://bugzilla.kernel.org/show_bug.cgi?id=9704
      
      
      
      When echo some invalid values to /proc/acpi/processor/*/throttling,
      there isn't any error info returned, on the contray, it sets
      throttling value to some T* successfully, obviously, this is incorrect,
      a correct way should be to let it fail and return error info.
      
      This patch fixed the aforementioned issue, it also enables
      /proc/acpi/processor/*/throttling to accept such values as 't0' and 'T0',
      it also strictly limits /proc/acpi/processor/*/throttling only to accept
       "*", "t*" and "T*", "*" is the throttling state value the processor can
      support, current, it is 0 - 7.
      
      Before applying this patch, the test result is below:
      
      [root@localhost acpi]# cat /proc/acpi/processor/CPU0/throttling
      state count:             8
      active state:            T1
      state available: T0 to T7
      states:
          T0:                  100%
         *T1:                  87%
          T2:                  75%
          T3:                  62%
          T4:                  50%
          T5:                  37%
          T6:                  25%
          T7:                  12%
      [root@localhost acpi]# echo "1xxxxxx" > /proc/acpi/processor/CPU0/throttling
      [root@localhost acpi]# cat /proc/acpi/processor/CPU0/throttling
      state count:             8
      active state:            T1
      state available: T0 to T7
      states:
          T0:                  100%
         *T1:                  87%
          T2:                  75%
          T3:                  62%
          T4:                  50%
          T5:                  37%
          T6:                  25%
          T7:                  12%
      [root@localhost acpi]# echo "0" > /proc/acpi/processor/CPU0/throttling
      [root@localhost acpi]# cat /proc/acpi/processor/CPU0/throttling
      state count:             8
      active state:            T0
      state available: T0 to T7
      states:
         *T0:                  100%
          T1:                  87%
          T2:                  75%
          T3:                  62%
          T4:                  50%
          T5:                  37%
          T6:                  25%
          T7:                  12%
      [root@localhost acpi]# cd /
      [root@localhost /]# cat /proc/acpi/processor/CPU0/throttling
      state count:             8
      active state:            T0
      state available: T0 to T7
      states:
         *T0:                  100%
          T1:                  87%
          T2:                  75%
          T3:                  62%
          T4:                  50%
          T5:                  37%
          T6:                  25%
          T7:                  12%
      [root@localhost /]# echo "T0" > /proc/acpi/processor/CPU0/throttling
      [root@localhost /]# cat /proc/acpi/processor/CPU0/throttling
      state count:             8
      active state:            T0
      state available: T0 to T7
      states:
         *T0:                  100%
          T1:                  87%
          T2:                  75%
          T3:                  62%
          T4:                  50%
          T5:                  37%
          T6:                  25%
          T7:                  12%
      [root@localhost /]# echo "T7" > /proc/acpi/processor/CPU0/throttling
      [root@localhost /]# cat /proc/acpi/processor/CPU0/throttling
      state count:             8
      active state:            T0
      state available: T0 to T7
      states:
         *T0:                  100%
          T1:                  87%
          T2:                  75%
          T3:                  62%
          T4:                  50%
          T5:                  37%
          T6:                  25%
          T7:                  12%
      [root@localhost /]# echo "T100" > /proc/acpi/processor/CPU0/throttling
      [root@localhost /]# cat /proc/acpi/processor/CPU0/throttling
      state count:             8
      active state:            T0
      state available: T0 to T7
      states:
         *T0:                  100%
          T1:                  87%
          T2:                  75%
          T3:                  62%
          T4:                  50%
          T5:                  37%
          T6:                  25%
          T7:                  12%
      [root@localhost /]# echo "xxx" > /proc/acpi/processor/CPU0/throttling
      [root@localhost /]# cat /proc/acpi/processor/CPU0/throttling
      state count:             8
      active state:            T0
      state available: T0 to T7
      states:
         *T0:                  100%
          T1:                  87%
          T2:                  75%
          T3:                  62%
          T4:                  50%
          T5:                  37%
          T6:                  25%
          T7:                  12%
      [root@localhost /]# echo "2xxxx" > /proc/acpi/processor/CPU0/throttling
      [root@localhost /]# cat /proc/acpi/processor/CPU0/throttling
      state count:             8
      active state:            T2
      state available: T0 to T7
      states:
          T0:                  100%
          T1:                  87%
         *T2:                  75%
          T3:                  62%
          T4:                  50%
          T5:                  37%
          T6:                  25%
          T7:                  12%
      [root@localhost /]# echo "" > /proc/acpi/processor/CPU0/throttling
      [root@localhost /]# cat /proc/acpi/processor/CPU0/throttling
      state count:             8
      active state:            T0
      state available: T0 to T7
      states:
         *T0:                  100%
          T1:                  87%
          T2:                  75%
          T3:                  62%
          T4:                  50%
          T5:                  37%
          T6:                  25%
          T7:                  12%
      [root@localhost /]# echo "7777" > /proc/acpi/processor/CPU0/throttling
      -bash: echo: write error: Invalid argument
      [root@localhost /]# echo "7xxx" > /proc/acpi/processor/CPU0/throttling
      [root@localhost /]# cat /proc/acpi/processor/CPU0/throttling
      state count:             8
      active state:            T7
      state available: T0 to T7
      states:
          T0:                  100%
          T1:                  87%
          T2:                  75%
          T3:                  62%
          T4:                  50%
          T5:                  37%
          T6:                  25%
         *T7:                  12%
      [root@localhost /]#
      
      After applying this patch, the test result is below:
      
      [root@localhost linux-2.6.24-rc6]# echo > /proc/acpi/processor/CPU0/throttling
      -bash: echo: write error: Invalid argument
      [root@localhost linux-2.6.24-rc6]# echo "" > /proc/acpi/processor/CPU0/throttling
      -bash: echo: write error: Invalid argument
      [root@localhost linux-2.6.24-rc6]# echo "0" > /proc/acpi/processor/CPU0/throttling
      [root@localhost linux-2.6.24-rc6]# echo "t0" > /proc/acpi/processor/CPU0/throttling
      [root@localhost linux-2.6.24-rc6]# echo "T0" > /proc/acpi/processor/CPU0/throttling
      [root@localhost linux-2.6.24-rc6]# cat /proc/acpi/processor/CPU0/throttling
      state count:             8
      active state:            T0
      state available: T0 to T7
      states:
         *T0:                  100%
          T1:                  87%
          T2:                  75%
          T3:                  62%
          T4:                  50%
          T5:                  37%
          T6:                  25%
          T7:                  12%
      [root@localhost linux-2.6.24-rc6]# echo "T7" > /proc/acpi/processor/CPU0/throttling
      [root@localhost linux-2.6.24-rc6]# cat /proc/acpi/processor/CPU0/throttling
      state count:             8
      active state:            T7
      state available: T0 to T7
      states:
          T0:                  100%
          T1:                  87%
          T2:                  75%
          T3:                  62%
          T4:                  50%
          T5:                  37%
          T6:                  25%
         *T7:                  12%
      [root@localhost linux-2.6.24-rc6]# echo "T8" > /proc/acpi/processor/CPU0/throttling
      -bash: echo: write error: Invalid argument
      [root@localhost linux-2.6.24-rc6]# vi drivers/acpi/processor_throttling.c
      [root@localhost linux-2.6.24-rc6]# echo "T8" > /proc/acpi/processor/CPU0/throttling
      -bash: echo: write error: Invalid argument
      [root@localhost linux-2.6.24-rc6]# echo "t7" > /proc/acpi/processor/CPU0/throttling
      [root@localhost linux-2.6.24-rc6]# echo "t70" > /proc/acpi/processor/CPU0/throttling
      -bash: echo: write error: Invalid argument
      [root@localhost linux-2.6.24-rc6]# echo "70" > /proc/acpi/processor/CPU0/throttling
      -bash: echo: write error: Invalid argument
      [root@localhost linux-2.6.24-rc6]# echo "7000" > /proc/acpi/processor/CPU0/throttling
      -bash: echo: write error: Invalid argument
      [root@localhost linux-2.6.24-rc6]# echo "70" > /proc/acpi/processor/CPU0/throttling
      -bash: echo: write error: Invalid argument
      [root@localhost linux-2.6.24-rc6]# echo "xxx" > /proc/acpi/processor/CPU0/throttling
      -bash: echo: write error: Invalid argument
      [root@localhost linux-2.6.24-rc6]# echo > /proc/acpi/processor/CPU0/throttling
      -bash: echo: write error: Invalid argument
      [root@localhost linux-2.6.24-rc6]# echo -n > /proc/acpi/processor/CPU0/throttling
      [root@localhost linux-2.6.24-rc6]# echo -n "" > /proc/acpi/processor/CPU0/throttling
      [root@localhost linux-2.6.24-rc6]# echo $?
      0
      [root@localhost linux-2.6.24-rc6]# echo -n "" > /proc/acpi/processor/CPU0/throttling
      [root@localhost linux-2.6.24-rc6]# cat /proc/acpi/processor/CPU0/throttling
      state count:             8
      active state:            T7
      state available: T0 to T7
      states:
          T0:                  100%
          T1:                  87%
          T2:                  75%
          T3:                  62%
          T4:                  50%
          T5:                  37%
          T6:                  25%
         *T7:                  12%
      [root@localhost linux-2.6.24-rc6]# echo -n "" > /proc/acpi/processor/CPU0/throttling
      [root@localhost linux-2.6.24-rc6]# cat /proc/acpi/processor/CPU0/throttling
      state count:             8
      active state:            T7
      state available: T0 to T7
      states:
          T0:                  100%
          T1:                  87%
          T2:                  75%
          T3:                  62%
          T4:                  50%
          T5:                  37%
          T6:                  25%
         *T7:                  12%
      [root@localhost linux-2.6.24-rc6]# echo t0 > /proc/acpi/processor/CPU0/throttling
      [root@localhost linux-2.6.24-rc6]# echo T0 > /proc/acpi/processor/CPU0/throttling
      [root@localhost linux-2.6.24-rc6]# echo Tt0 > /proc/acpi/processor/CPU0/throttling
      -bash: echo: write error: Invalid argument
      [root@localhost linux-2.6.24-rc6]# echo T > /proc/acpi/processor/CPU0/throttling
      -bash: echo: write error: Invalid argument
      [root@localhost linux-2.6.24-rc6]#
      
      Signed-off-by: default avatarYi Yang <yi.y.yang@intel.com>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      3d532d5e
    • Mike Travis's avatar
      ACPI: change processors from array to per_cpu variable · 706546d0
      Mike Travis authored
      
      Change processors from an array sized by NR_CPUS to a per_cpu variable.
      
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
      Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
      706546d0
  26. May 23, 2008
  27. Apr 29, 2008
  28. Apr 19, 2008
    • Mike Travis's avatar
      generic: use new set_cpus_allowed_ptr function · f70316da
      Mike Travis authored
      
        * Use new set_cpus_allowed_ptr() function added by previous patch,
          which instead of passing the "newly allowed cpus" cpumask_t arg
          by value,  pass it by pointer:
      
          -int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
          +int set_cpus_allowed_ptr(struct task_struct *p, const cpumask_t *new_mask)
      
        * Modify CPU_MASK_ALL
      
      Depends on:
      	[sched-devel]: sched: add new set_cpus_allowed_ptr function
      
      Signed-off-by: default avatarMike Travis <travis@sgi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      f70316da
  29. Feb 02, 2008
  30. Jan 15, 2008
  31. Dec 02, 2007
Loading