Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752677AbbLRLsn (ORCPT ); Fri, 18 Dec 2015 06:48:43 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:34443 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752563AbbLRLsg (ORCPT ); Fri, 18 Dec 2015 06:48:36 -0500 Date: Fri, 18 Dec 2015 12:48:33 +0100 From: Michal Hocko To: Andrew Morton Cc: Mel Gorman , Tetsuo Handa , David Rientjes , Linus Torvalds , Oleg Nesterov , Hugh Dickins , Andrea Argangeli , Rik van Riel , linux-mm@kvack.org, LKML Subject: Re: [PATCH 1/2] mm, oom: introduce oom reaper Message-ID: <20151218114832.GD28443@dhcp22.suse.cz> References: <1450204575-13052-1-git-send-email-mhocko@kernel.org> <20151217161521.57fb536085aca377cb93fe1e@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151217161521.57fb536085aca377cb93fe1e@linux-foundation.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2428 Lines: 78 On Thu 17-12-15 16:15:21, Andrew Morton wrote: > On Tue, 15 Dec 2015 19:36:15 +0100 Michal Hocko wrote: > > > This patch reduces the probability of such a lockup by introducing a > > specialized kernel thread (oom_reaper) > > CONFIG_MMU=n: > > slub.c:(.text+0x4184): undefined reference to `tlb_gather_mmu' > slub.c:(.text+0x41bc): undefined reference to `unmap_page_range' > slub.c:(.text+0x41d8): undefined reference to `tlb_finish_mmu' > > I did the below so I can get an mmotm out the door, but hopefully > there's a cleaner way. Sorry about that and thanks for your fixup! I am not very familiar with !MMU world and haven't heard about issues with the OOM deadlocks yet. So I guess making this MMU only makes some sense. I would just get rid of ifdefs in oom_kill_process and provide an empty wake_oom_reaper for !CONFIG_MMU. The following on top of yours: --- diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 4b0a5d8b92e1..56ff1ff18c0e 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -537,6 +537,10 @@ static int __init oom_init(void) return 0; } module_init(oom_init) +#else +static void wake_oom_reaper(struct mm_struct *mm) +{ +} #endif /** @@ -648,9 +652,7 @@ void oom_kill_process(struct oom_control *oc, struct task_struct *p, unsigned int victim_points = 0; static DEFINE_RATELIMIT_STATE(oom_rs, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST); -#ifdef CONFIG_MMU bool can_oom_reap = true; -#endif /* * If the task is already exiting, don't alarm the sysadmin or kill @@ -743,7 +745,6 @@ void oom_kill_process(struct oom_control *oc, struct task_struct *p, continue; if (is_global_init(p)) continue; -#ifdef CONFIG_MMU if (unlikely(p->flags & PF_KTHREAD) || p->signal->oom_score_adj == OOM_SCORE_ADJ_MIN) { /* @@ -754,15 +755,12 @@ void oom_kill_process(struct oom_control *oc, struct task_struct *p, can_oom_reap = false; continue; } -#endif do_send_sig_info(SIGKILL, SEND_SIG_FORCED, p, true); } rcu_read_unlock(); -#ifdef CONFIG_MMU if (can_oom_reap) wake_oom_reaper(mm); -#endif mmdrop(mm); put_task_struct(victim); -- Michal Hocko SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/