Skip to content
Snippets Groups Projects
Select Git revision
  • b93e0f329e24f3615aa551fd9b99a75fb7c9195f
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

page_alloc.c

Blame
    • Michal Hocko's avatar
      b93e0f32
      mm, memory_hotplug: get rid of zonelists_mutex · b93e0f32
      Michal Hocko authored
      zonelists_mutex was introduced by commit 4eaf3f64 ("mem-hotplug: fix
      potential race while building zonelist for new populated zone") to
      protect zonelist building from races.  This is no longer needed though
      because both memory online and offline are fully serialized.  New users
      have grown since then.
      
      Notably setup_per_zone_wmarks wants to prevent from races between memory
      hotplug, khugepaged setup and manual min_free_kbytes update via sysctl
      (see cfd3da1e ("mm: Serialize access to min_free_kbytes").  Let's
      add a private lock for that purpose.  This will not prevent from seeing
      halfway through memory hotplug operation but that shouldn't be a big
      deal becuse memory hotplug will update watermarks explicitly so we will
      eventually get a full picture.  The lock just makes sure we won't race
      when updating watermarks leading to weird results.
      
      Also __build_all_zonelists manipulates global data so add a private lock
      for it as well.  This doesn't seem to be necessary today but it is more
      robust to have a lock there.
      
      While we are at it make sure we document that memory online/offline
      depends on a full serialization either via mem_hotplug_begin() or
      device_lock.
      
      Link: http://lkml.kernel.org/r/20170721143915.14161-9-mhocko@kernel.org
      
      
      Signed-off-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Joonsoo Kim <js1304@gmail.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Shaohua Li <shaohua.li@intel.com>
      Cc: Toshi Kani <toshi.kani@hpe.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Haicheng Li <haicheng.li@linux.intel.com>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b93e0f32
      History
      mm, memory_hotplug: get rid of zonelists_mutex
      Michal Hocko authored
      zonelists_mutex was introduced by commit 4eaf3f64 ("mem-hotplug: fix
      potential race while building zonelist for new populated zone") to
      protect zonelist building from races.  This is no longer needed though
      because both memory online and offline are fully serialized.  New users
      have grown since then.
      
      Notably setup_per_zone_wmarks wants to prevent from races between memory
      hotplug, khugepaged setup and manual min_free_kbytes update via sysctl
      (see cfd3da1e ("mm: Serialize access to min_free_kbytes").  Let's
      add a private lock for that purpose.  This will not prevent from seeing
      halfway through memory hotplug operation but that shouldn't be a big
      deal becuse memory hotplug will update watermarks explicitly so we will
      eventually get a full picture.  The lock just makes sure we won't race
      when updating watermarks leading to weird results.
      
      Also __build_all_zonelists manipulates global data so add a private lock
      for it as well.  This doesn't seem to be necessary today but it is more
      robust to have a lock there.
      
      While we are at it make sure we document that memory online/offline
      depends on a full serialization either via mem_hotplug_begin() or
      device_lock.
      
      Link: http://lkml.kernel.org/r/20170721143915.14161-9-mhocko@kernel.org
      
      
      Signed-off-by: default avatarMichal Hocko <mhocko@suse.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Joonsoo Kim <js1304@gmail.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Shaohua Li <shaohua.li@intel.com>
      Cc: Toshi Kani <toshi.kani@hpe.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Haicheng Li <haicheng.li@linux.intel.com>
      Cc: Wu Fengguang <fengguang.wu@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    page_alloc.c 210.18 KiB
    /*
     *  linux/mm/page_alloc.c
     *
     *  Manages the free list, the system allocates free pages here.
     *  Note that kmalloc() lives in slab.c
     *
     *  Copyright (C) 1991, 1992, 1993, 1994  Linus Torvalds
     *  Swap reorganised 29.12.95, Stephen Tweedie
     *  Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
     *  Reshaped it to be a zoned allocator, Ingo Molnar, Red Hat, 1999
     *  Discontiguous memory support, Kanoj Sarcar, SGI, Nov 1999
     *  Zone balancing, Kanoj Sarcar, SGI, Jan 2000
     *  Per cpu hot/cold page lists, bulk allocation, Martin J. Bligh, Sept 2002
     *          (lots of bits borrowed from Ingo Molnar & Andrew Morton)
     */
    
    #include <linux/stddef.h>
    #include <linux/mm.h>
    #include <linux/swap.h>
    #include <linux/interrupt.h>
    #include <linux/pagemap.h>
    #include <linux/jiffies.h>
    #include <linux/bootmem.h>
    #include <linux/memblock.h>
    #include <linux/compiler.h>
    #include <linux/kernel.h>
    #include <linux/kmemcheck.h>
    #include <linux/kasan.h>
    #include <linux/module.h>
    #include <linux/suspend.h>
    #include <linux/pagevec.h>
    #include <linux/blkdev.h>
    #include <linux/slab.h>
    #include <linux/ratelimit.h>
    #include <linux/oom.h>
    #include <linux/notifier.h>
    #include <linux/topology.h>
    #include <linux/sysctl.h>
    #include <linux/cpu.h>
    #include <linux/cpuset.h>
    #include <linux/memory_hotplug.h>
    #include <linux/nodemask.h>
    #include <linux/vmalloc.h>
    #include <linux/vmstat.h>
    #include <linux/mempolicy.h>
    #include <linux/memremap.h>
    #include <linux/stop_machine.h>
    #include <linux/sort.h>
    #include <linux/pfn.h>
    #include <linux/backing-dev.h>
    #include <linux/fault-inject.h>
    #include <linux/page-isolation.h>
    #include <linux/page_ext.h>
    #include <linux/debugobjects.h>
    #include <linux/kmemleak.h>
    #include <linux/compaction.h>
    #include <trace/events/kmem.h>
    #include <trace/events/oom.h>
    #include <linux/prefetch.h>
    #include <linux/mm_inline.h>
    #include <linux/migrate.h>
    #include <linux/hugetlb.h>
    #include <linux/sched/rt.h>
    #include <linux/sched/mm.h>
    #include <linux/page_owner.h>
    #include <linux/kthread.h>
    #include <linux/memcontrol.h>
    #include <linux/ftrace.h>
    #include <linux/lockdep.h>
    #include <linux/nmi.h>