1. 17 9月, 2012 1 次提交
  2. 20 9月, 2011 1 次提交
    • A
      powerpc: Fix oops when echoing bad values to /sys/devices/system/memory/probe · a1194097
      Anton Blanchard 提交于
      If we echo an address the hypervisor doesn't like to
      /sys/devices/system/memory/probe we oops the box:
      
      # echo 0x10000000000 > /sys/devices/system/memory/probe
      
      kernel BUG at arch/powerpc/mm/hash_utils_64.c:541!
      
      The backtrace is:
      
      create_section_mapping
      arch_add_memory
      add_memory
      memory_probe_store
      sysdev_class_store
      sysfs_write_file
      vfs_write
      SyS_write
      
      In create_section_mapping we BUG if htab_bolt_mapping returned
      an error. A better approach is to return an error which will
      propagate back to userspace.
      
      Rerunning the test with this patch applied:
      
      # echo 0x10000000000 > /sys/devices/system/memory/probe
      -bash: echo: write error: Invalid argument
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Cc: stable@kernel.org
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a1194097
  3. 13 4月, 2010 1 次提交
  4. 07 4月, 2010 1 次提交
    • A
      powerpc/mm: Bump SECTION_SIZE_BITS from 16MB to 256MB · 7545ba6f
      Anton Blanchard 提交于
      The current setting for SECTION_SIZE_BITS is quite small compared to
      everyone else:
      
      arch/powerpc/include/asm/sparsemem.h:#define SECTION_SIZE_BITS  24
      
      arch/sparc/include/asm/sparsemem.h:#define SECTION_SIZE_BITS    30
      arch/ia64/include/asm/sparsemem.h:#define SECTION_SIZE_BITS     (30)
      arch/s390/include/asm/sparsemem.h:#define SECTION_SIZE_BITS     28
      arch/x86/include/asm/sparsemem.h:# define SECTION_SIZE_BITS     27
      
      And it has proven to be an issue during boot on very large machines.
      If hotplug memory is enabled, drivers/base/memory.c does this:
      
             for (i = 0; i < NR_MEM_SECTIONS; i++) {
                      if (!present_section_nr(i))
                              continue;
                      err = add_memory_block(0, __nr_to_section(i), MEM_ONLINE,
                                              0, BOOT);
                      if (!ret)
                              ret = err;
              }
      
      Which creates a sysfs directory for every 16MB of memory. As a result
      I'm seeing up to 30 minutes spent here during boot:
      
      c000000000248ee0 .__sysfs_add_one+0x28/0x128
      c0000000002492a8 .sysfs_add_one+0x38/0x188
      c000000000249c88 .create_dir+0x70/0x138
      c000000000249d98 .sysfs_create_dir+0x48/0x78
      c00000000032bad8 .kobject_add_internal+0x140/0x308
      c00000000032beb4 .kobject_init_and_add+0x4c/0x68
      c00000000046c2c0 .sysdev_register+0xa0/0x220
      c00000000047b1dc .add_memory_block+0x124/0x1e8
      c0000000008d1f28 .memory_dev_init+0xf4/0x168
      c0000000008d1b64 .driver_init+0x50/0x64
      c000000000890378 .do_basic_setup+0x40/0xd4
      
      I assume there are some O(n^2) issues in sysfs as we add all the memory
      nodes. Bumping SECTION_SIZE_BITS to 256 MB drops the time to about 10
      seconds and results in a much smaller /sys.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7545ba6f
  5. 04 8月, 2008 1 次提交
  6. 03 7月, 2008 1 次提交
  7. 01 4月, 2008 1 次提交
  8. 26 2月, 2008 1 次提交
  9. 25 1月, 2008 1 次提交
  10. 04 12月, 2006 1 次提交
  11. 09 1月, 2006 2 次提交
  12. 11 11月, 2005 1 次提交
  13. 08 11月, 2005 1 次提交
  14. 02 11月, 2005 1 次提交
  15. 24 6月, 2005 1 次提交