Commit 7ef949d7 authored by Michal Hocko's avatar Michal Hocko Committed by Linus Torvalds

mm: oom_reaper: remove some bloat

mmput_async is currently used only from the oom_reaper which is defined
only for CONFIG_MMU.  We can save work_struct in mm_struct for
!CONFIG_MMU.

[akpm@linux-foundation.org: fix typo, per Minchan]
Link: http://lkml.kernel.org/r/20160520061658.GB19172@dhcp22.suse.czReported-by: default avatarMinchan Kim <minchan@kernel.org>
Signed-off-by: default avatarMichal Hocko <mhocko@suse.com>
Acked-by: default avatarMinchan Kim <minchan@kernel.org>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1ebab2db
...@@ -514,7 +514,9 @@ struct mm_struct { ...@@ -514,7 +514,9 @@ struct mm_struct {
#ifdef CONFIG_HUGETLB_PAGE #ifdef CONFIG_HUGETLB_PAGE
atomic_long_t hugetlb_usage; atomic_long_t hugetlb_usage;
#endif #endif
#ifdef CONFIG_MMU
struct work_struct async_put_work; struct work_struct async_put_work;
#endif
}; };
static inline void mm_init_cpumask(struct mm_struct *mm) static inline void mm_init_cpumask(struct mm_struct *mm)
......
...@@ -2745,10 +2745,12 @@ static inline bool mmget_not_zero(struct mm_struct *mm) ...@@ -2745,10 +2745,12 @@ static inline bool mmget_not_zero(struct mm_struct *mm)
/* mmput gets rid of the mappings and all user-space */ /* mmput gets rid of the mappings and all user-space */
extern void mmput(struct mm_struct *); extern void mmput(struct mm_struct *);
/* same as above but performs the slow path from the async kontext. Can #ifdef CONFIG_MMU
/* same as above but performs the slow path from the async context. Can
* be called from the atomic context as well * be called from the atomic context as well
*/ */
extern void mmput_async(struct mm_struct *); extern void mmput_async(struct mm_struct *);
#endif
/* Grab a reference to a task's mm, if it is not already going away */ /* Grab a reference to a task's mm, if it is not already going away */
extern struct mm_struct *get_task_mm(struct task_struct *task); extern struct mm_struct *get_task_mm(struct task_struct *task);
......
...@@ -736,6 +736,7 @@ void mmput(struct mm_struct *mm) ...@@ -736,6 +736,7 @@ void mmput(struct mm_struct *mm)
} }
EXPORT_SYMBOL_GPL(mmput); EXPORT_SYMBOL_GPL(mmput);
#ifdef CONFIG_MMU
static void mmput_async_fn(struct work_struct *work) static void mmput_async_fn(struct work_struct *work)
{ {
struct mm_struct *mm = container_of(work, struct mm_struct, async_put_work); struct mm_struct *mm = container_of(work, struct mm_struct, async_put_work);
...@@ -749,6 +750,7 @@ void mmput_async(struct mm_struct *mm) ...@@ -749,6 +750,7 @@ void mmput_async(struct mm_struct *mm)
schedule_work(&mm->async_put_work); schedule_work(&mm->async_put_work);
} }
} }
#endif
/** /**
* set_mm_exe_file - change a reference to the mm's executable file * set_mm_exe_file - change a reference to the mm's executable file
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment