1. 11 Jul, 2011 1 commit
  2. 03 Feb, 2011 1 commit
    • Nathan Fontenot's avatar
      memory hotplug: Update phys_index to [start|end]_section_nr · d3360164
      Nathan Fontenot authored
      Update the 'phys_index' property of a the memory_block struct to be
      called start_section_nr, and add a end_section_nr property.  The
      data tracked here is the same but the updated naming is more in line
      with what is stored here, namely the first and last section number
      that the memory block spans.
      The names presented to userspace remain the same, phys_index for
      start_section_nr and end_phys_index for end_section_nr, to avoid breaking
      anything in userspace.
      This also updates the node sysfs code to be aware of the new capability for
      a memory block to contain multiple memory sections and be aware of the memory
      block structure name changes (start_section_nr).  This requires an additional
      parameter to unregister_mem_sect_under_nodes so that we know which memory
      section of the memory block to unregister.
      Signed-off-by: default avatarNathan Fontenot <nfont@austin.ibm.com>
      Reviewed-by: default avatarRobin Holt <holt@sgi.com>
      Reviewed-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  3. 22 Oct, 2010 2 commits
  4. 17 Mar, 2010 1 commit
    • Heiko Carstens's avatar
      memory hotplug: allow setting of phys_device · bc32df00
      Heiko Carstens authored
      /sys/devices/system/memory/memoryX/phys_device is supposed to contain the
      number of the physical device that the corresponding piece of memory
      belongs to.
      In case a physical device should be replaced or taken offline for whatever
      reason it is necessary to set all corresponding memory pieces offline.
      The current implementation always sets phys_device to '0' and there is no
      way or hook to change that.  Seems like there was a plan to implement that
      but it wasn't finished for whatever reason.
      So add a weak function which architectures can override to actually set
      the phys_device from within add_memory_block().
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Dave Hansen <haveblue@us.ibm.com>
      Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  5. 17 Dec, 2009 1 commit
    • Robert Jennings's avatar
      mm: Add notifier in pageblock isolation for balloon drivers · 925cc71e
      Robert Jennings authored
      Memory balloon drivers can allocate a large amount of memory which is not
      movable but could be freed to accomodate memory hotplug remove.
      Prior to calling the memory hotplug notifier chain the memory in the
      pageblock is isolated.  Currently, if the migrate type is not
      MIGRATE_MOVABLE the isolation will not proceed, causing the memory removal
      for that page range to fail.
      Rather than failing pageblock isolation if the migrateteype is not
      MIGRATE_MOVABLE, this patch checks if all of the pages in the pageblock,
      and not on the LRU, are owned by a registered balloon driver (or other
      entity) using a notifier chain.  If all of the non-movable pages are owned
      by a balloon, they can be freed later through the memory notifier chain
      and the range can still be isolated in set_migratetype_isolate().
      Signed-off-by: default avatarRobert Jennings <rcj@linux.vnet.ibm.com>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Brian King <brking@linux.vnet.ibm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Gerald Schaefer <geralds@linux.vnet.ibm.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
  6. 02 Apr, 2009 1 commit
  7. 06 Mar, 2009 1 commit
    • Mathieu Desnoyers's avatar
      tracing, Text Edit Lock - Architecture Independent Code · 0e39ac44
      Mathieu Desnoyers authored
      This is an architecture independant synchronization around kernel text
      modifications through use of a global mutex.
      A mutex has been chosen so that kprobes, the main user of this, can sleep
      during memory allocation between the memory read of the instructions it
      must replace and the memory write of the breakpoint.
      Other user of this interface: immediate values.
      Paravirt and alternatives are always done when SMP is inactive, so there
      is no need to use locks.
      Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      LKML-Reference: <49B142D8.7020601@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
  8. 06 Jan, 2009 1 commit
    • Gary Hade's avatar
      mm: show node to memory section relationship with symlinks in sysfs · c04fc586
      Gary Hade authored
      Show node to memory section relationship with symlinks in sysfs
      Add /sys/devices/system/node/nodeX/memoryY symlinks for all
      the memory sections located on nodeX.  For example:
      /sys/devices/system/node/node1/memory135 -> ../../memory/memory135
      indicates that memory section 135 resides on node1.
      Also revises documentation to cover this change as well as updating
      Documentation/ABI/testing/sysfs-devices-memory to include descriptions
      of memory hotremove files 'phys_device', 'phys_index', and 'state'
      that were previously not described there.
      In addition to it always being a good policy to provide users with
      the maximum possible amount of physical location information for
      resources that can be hot-added and/or hot-removed, the following
      are some (but likely not all) of the user benefits provided by
      this change.
        - Provides information needed to determine the specific node
          on which a defective DIMM is located.  This will reduce system
          downtime when the node or defective DIMM is swapped out.
        - Prevents unintended onlining of a memory section that was
          previously offlined due to a defective DIMM.  This could happen
          during node hot-add when the user or node hot-add assist script
          onlines _all_ offlined sections due to user or script inability
          to identify the specific memory sections located on the hot-added
          node.  The consequences of reintroducing the defective memory
          could be ugly.
        - Provides information needed to vary the amount and distribution
          of memory on specific nodes for testing or debugging purposes.
        - Will provide information needed to identify the memory
          sections that need to be offlined prior to physical removal
          of a specific node.
      Symlink creation during boot was tested on 2-node x86_64, 2-node
      ppc64, and 2-node ia64 systems.  Symlink creation during physical
      memory hot-add tested on a 2-node x86_64 system.
      Signed-off-by: default avatarGary Hade <garyhade@us.ibm.com>
      Signed-off-by: default avatarBadari Pulavarty <pbadari@us.ibm.com>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  9. 30 Nov, 2008 1 commit
  10. 29 Apr, 2008 2 commits
  11. 19 Apr, 2008 1 commit
  12. 18 Apr, 2008 1 commit
  13. 22 Oct, 2007 2 commits
    • Yasunori Goto's avatar
      memory hotplug: make kmem_cache_node for SLUB on memory online avoid panic · b9049e23
      Yasunori Goto authored
      Fix a panic due to access NULL pointer of kmem_cache_node at discard_slab()
      after memory online.
      When memory online is called, kmem_cache_nodes are created for all SLUBs
      for new node whose memory are available.
      slab_mem_going_online_callback() is called to make kmem_cache_node() in
      callback of memory online event.  If it (or other callbacks) fails, then
      slab_mem_offline_callback() is called for rollback.
      In memory offline, slab_mem_going_offline_callback() is called to shrink
      all slub cache, then slab_mem_offline_callback() is called later.
      [akpm@linux-foundation.org: coding-style fixes]
      [akpm@linux-foundation.org: locking fix]
      [akpm@linux-foundation.org: build fix]
      Signed-off-by: default avatarYasunori Goto <y-goto@jp.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    • Yasunori Goto's avatar
      memory hotplug: rearrange memory hotplug notifier · 7b78d335
      Yasunori Goto authored
      Current memory notifier has some defects yet.  (Fortunately, nothing uses
      it.) This patch is to fix and rearrange for them.
        - Add information of start_pfn, nr_pages, and node id if node status is
          changes from/to memoryless node for callback functions.
          Callbacks can't do anything without those information.
        - Add notification going-online status.
          It is necessary for creating per node structure before the node's
          pages are available.
        - Move GOING_OFFLINE status notification after page isolation.
          It is good place for return memory like cache for callback,
          because returned page is not used again.
        - Make CANCEL events for rollingback when error occurs.
        - Delete MEM_MAPPING_INVALID notification. It will be not used.
        - Fix compile error of (un)register_memory_notifier().
      Signed-off-by: default avatarYasunori Goto <y-goto@jp.fujitsu.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  14. 01 Oct, 2006 1 commit
  15. 27 Mar, 2006 1 commit
    • Alan Stern's avatar
      [PATCH] Notifier chain update: API changes · e041c683
      Alan Stern authored
      The kernel's implementation of notifier chains is unsafe.  There is no
      protection against entries being added to or removed from a chain while the
      chain is in use.  The issues were discussed in this thread:
      We noticed that notifier chains in the kernel fall into two basic usage
      	"Blocking" chains are always called from a process context
      	and the callout routines are allowed to sleep;
      	"Atomic" chains can be called from an atomic context and
      	the callout routines are not allowed to sleep.
      We decided to codify this distinction and make it part of the API.  Therefore
      this set of patches introduces three new, parallel APIs: one for blocking
      notifiers, one for atomic notifiers, and one for "raw" notifiers (which is
      really just the old API under a new name).  New kinds of data structures are
      used for the heads of the chains, and new routines are defined for
      registration, unregistration, and calling a chain.  The three APIs are
      explained in include/linux/notifier.h and their implementation is in
      With atomic and blocking chains, the implementation guarantees that the chain
      links will not be corrupted and that chain callers will not get messed up by
      entries being added or removed.  For raw chains the implementation provides no
      guarantees at all; users of this API must provide their own protections.  (The
      idea was that situations may come up where the assumptions of the atomic and
      blocking APIs are not appropriate, so it should be possible for users to
      handle these things in their own way.)
      There are some limitations, which should not be too hard to live with.  For
      atomic/blocking chains, registration and unregistration must always be done in
      a process context since the chain is protected by a mutex/rwsem.  Also, a
      callout routine for a non-raw chain must not try to register or unregister
      entries on its own chain.  (This did happen in a couple of places and the code
      had to be changed to avoid it.)
      Since atomic chains may be called from within an NMI handler, they cannot use
      spinlocks for synchronization.  Instead we use RCU.  The overhead falls almost
      entirely in the unregister routine, which is okay since unregistration is much
      less frequent that calling a chain.
      Here is the list of chains that we adjusted and their classifications.  None
      of them use the raw API, so for the moment it is only a placeholder.
      arch/i386/kernel/traps.c:		i386die_chain
      arch/ia64/kernel/traps.c:		ia64die_chain
      arch/powerpc/kernel/traps.c:		powerpc_die_chain
      arch/sparc64/kernel/traps.c:		sparc64die_chain
      arch/x86_64/kernel/traps.c:		die_chain
      drivers/char/ipmi/ipmi_si_intf.c:	xaction_notifier_list
      kernel/panic.c:				panic_notifier_list
      kernel/profile.c:			task_free_notifier
      net/bluetooth/hci_core.c:		hci_notifier
      net/ipv4/netfilter/ip_conntrack_core.c:	ip_conntrack_chain
      net/ipv4/netfilter/ip_conntrack_core.c:	ip_conntrack_expect_chain
      net/ipv6/addrconf.c:			inet6addr_chain
      net/netfilter/nf_conntrack_core.c:	nf_conntrack_chain
      net/netfilter/nf_conntrack_core.c:	nf_conntrack_expect_chain
      net/netlink/af_netlink.c:		netlink_chain
      arch/powerpc/platforms/pseries/reconfig.c:	pSeries_reconfig_chain
      arch/s390/kernel/process.c:		idle_chain
      arch/x86_64/kernel/process.c		idle_notifier
      drivers/base/memory.c:			memory_chain
      drivers/cpufreq/cpufreq.c		cpufreq_policy_notifier_list
      drivers/cpufreq/cpufreq.c		cpufreq_transition_notifier_list
      drivers/macintosh/adb.c:		adb_client_list
      drivers/macintosh/via-pmu.c		sleep_notifier_list
      drivers/macintosh/via-pmu68k.c		sleep_notifier_list
      drivers/macintosh/windfarm_core.c	wf_client_list
      drivers/usb/core/notify.c		usb_notifier_list
      drivers/video/fbmem.c			fb_notifier_list
      kernel/cpu.c				cpu_chain
      kernel/module.c				module_notify_list
      kernel/profile.c			munmap_notifier
      kernel/profile.c			task_exit_notifier
      kernel/sys.c				reboot_notifier_list
      net/core/dev.c				netdev_chain
      net/decnet/dn_dev.c:			dnaddr_chain
      net/ipv4/devinet.c:			inetaddr_chain
      It's possible that some of these classifications are wrong.  If they are,
      please let us know or submit a patch to fix them.  Note that any chain that
      gets called very frequently should be atomic, because the rwsem read-locking
      used for blocking chains is very likely to incur cache misses on SMP systems.
      (However, if the chain's callout routines may sleep then the chain cannot be
      The patch set was written by Alan Stern and Chandra Seetharaman, incorporating
      material written by Keith Owens and suggestions from Paul McKenney and Andrew
      [jes@sgi.com: restructure the notifier chain initialization macros]
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarChandra Seetharaman <sekharan@us.ibm.com>
      Signed-off-by: default avatarJes Sorensen <jes@sgi.com>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
  16. 08 Jan, 2006 1 commit
    • Olaf Hering's avatar
      [PATCH] Fix compilation with CONFIG_MEMORY_HOTPLUG=y and gcc41. · b792de39
      Olaf Hering authored
      Fix compilation with CONFIG_MEMORY_HOTPLUG=y and gcc41.
      Also remove unneeded declations, add a public function.
      drivers/base/memory.c:53: error: static declaration of 'register_memory_notifier' follows non-static declaration
      include/linux/memory.h:85: error: previous declaration of 'register_memory_notifier' was here
      drivers/base/memory.c:58: error: static declaration of 'unregister_memory_notifier' follows non-static declaration
      include/linux/memory.h:86: error: previous declaration of 'unregister_memory_notifier' was here
      drivers/base/memory.c:68: error: static declaration of 'register_memory' follows non-static declaration
      include/linux/memory.h:73: error: previous declaration of 'register_memory' was here
      Signed-off-by: default avatarOlaf Hering <olh@suse.de>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
  17. 28 Nov, 2005 1 commit
  18. 07 Nov, 2005 1 commit
  19. 29 Oct, 2005 1 commit