Skip to content

avoid allocation in show_numa_map()

Stephen Wilson linux-mm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 2 repliesIn review
  2. v18 patches 13 repliesSuperseded

Changes in v2 from the cover letter

- Fix compilation error when CONFIG_TMPFS=n.

- Traverse pte's with proper locking and checks.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9mm: export get_vma_policy()include/linux/mempolicy.h mm/mempolicy.c+4 -10 replies
2/9mm: use walk_page_range() instead of custom page table walking codemm/mempolicy.c+68 -70 replies
3/9mm: remove MPOL_MF_STATSmm/mempolicy.c+1 -40 replies
4/9mm: make gather_stats() type-safe and remove forward declarationmm/mempolicy.c+4 -41 reply
5/9mm: remove check_huge_range()mm/mempolicy.c+0 -350 replies
6/9mm: declare mpol_to_str() when CONFIG_TMPFS=ninclude/linux/mempolicy.h+2 -20 replies
7/9mm: proc: move show_numa_map() to fs/proc/task_mmu.cfs/proc/task_mmu.c mm/mempolicy.c+182 -1851 reply
8/9proc: make struct proc_maps_private truly privatefs/proc/internal.h include/linux/proc_fs.h+7 -80 replies
9/9proc: allocate storage for numa_maps statistics oncefs/proc/task_mmu.c+27 -90 replies

Reviews trailers per patch

8 of 9 patches have a Reviewed-by or Acked-by.

PatchKOSAKI Motohiro
1/9R-b
2/9R-b
3/9R-b
4/9R-b
5/9R-b
6/9
7/9R-b
8/9R-b
9/9R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/9] avoid allocation in show_numa_map()

Hi all,

This is version 2 of a patch series[1] aimed at removing repeated allocation/free cycles happening in show_numa_maps() while we hold a reference to an mm. The concern is that performing an allocation while referencing an mm could lead to a stalemate in the oom killer as previously explained by Hugh Dickins[2].

This series addresses all issues raised in the previous round and is organized as follows:

Patches 1-6 convert show_numa_maps() to use the generic walk_page_range() functionality instead of the mempolicy.c specific page table walking logic. Also, get_vma_policy() and mpol_to_str() are exported. This makes the show_numa_maps() implementation independent of mempolicy.c.

Patch 7 moves show_numa_maps() and supporting routines over to fs/proc/task_mmu.c.

Finally, patches 8 and 9 provide minor cleanup and eliminate the troublesome allocation.

These patches are based on mmotm-2011-05-12-15-52 and have been tested on a dual node NUMA machine.

Thanks,

--
steve

[1] http://lkml.org/lkml/2011/4/27/578
[2] http://lkml.org/lkml/2011/4/25/496

Changes since v1:
- Fix compilation error when CONFIG_TMPFS=n.

- Traverse pte's with proper locking and checks.

Stephen Wilson (9):
mm: export get_vma_policy()
mm: use walk_page_range() instead of custom page table walking code
mm: remove MPOL_MF_STATS
mm: make gather_stats() type-safe and remove forward declaration
mm: remove check_huge_range()
mm: declare mpol_to_str() when CONFIG_TMPFS=n
mm: proc: move show_numa_map() to fs/proc/task_mmu.c
proc: make struct proc_maps_private truly private
proc: allocate storage for numa_maps statistics once

 fs/proc/internal.h        |    7 ++
 fs/proc/task_mmu.c        |  204 ++++++++++++++++++++++++++++++++++++++++++++-
 include/linux/mempolicy.h |    7 +-
 include/linux/proc_fs.h   |    8 --
 mm/mempolicy.c            |  164 +-----------------------------------
 5 files changed, 215 insertions(+), 175 deletions(-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>