From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f198.google.com (mail-pf0-f198.google.com [209.85.192.198]) by kanga.kvack.org (Postfix) with ESMTP id 70A436B0003 for ; Tue, 24 Apr 2018 19:15:02 -0400 (EDT) Received: by mail-pf0-f198.google.com with SMTP id i128so14206316pfg.2 for ; Tue, 24 Apr 2018 16:15:02 -0700 (PDT) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id e3-v6si14613247pld.229.2018.04.24.16.15.01 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 24 Apr 2018 16:15:01 -0700 (PDT) Date: Tue, 24 Apr 2018 17:14:55 -0600 From: Michal Hocko Subject: Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap Message-ID: <20180424231455.GZ17484@dhcp22.suse.cz> References: <201804221248.CHE35432.FtOMOLSHOFJFVQ@I-love.SAKURA.ne.jp> <20180424130432.GB17484@dhcp22.suse.cz> <20180424201352.GV17484@dhcp22.suse.cz> <20180424203148.GW17484@dhcp22.suse.cz> <20180424230815.GX17484@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180424230815.GX17484@dhcp22.suse.cz> Sender: owner-linux-mm@kvack.org List-ID: To: David Rientjes Cc: Andrew Morton , Tetsuo Handa , Andrea Arcangeli , guro@fb.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org On Tue 24-04-18 17:08:15, Michal Hocko wrote: > On Tue 24-04-18 14:07:52, David Rientjes wrote: > > On Tue, 24 Apr 2018, Michal Hocko wrote: > > > > > > > > My patch has passed intensive testing on both x86 and powerpc, so I'll ask > > > > > > that it's pushed for 4.17-rc3. Many thanks to Tetsuo for the suggestion > > > > > > on calling __oom_reap_task_mm() from exit_mmap(). > > > > > > > > > > Yeah, but your patch does have a problem with blockable mmu notifiers > > > > > IIUC. > > > > > > > > What on earth are you talking about? exit_mmap() does > > > > mmu_notifier_release(). There are no blockable mmu notifiers. > > > > > > MMF_OOM_SKIP - remember? The thing that guarantees a forward progress. > > > So we cannot really depend on setting MMF_OOM_SKIP if a > > > mmu_notifier_release blocks for an excessive/unbounded amount of time. > > > > > > > If the thread is blocked in exit_mmap() because of mmu_notifier_release() > > then the oom reaper will eventually grab mm->mmap_sem (nothing holding it > > in exit_mmap()), return true, and oom_reap_task() will set MMF_OOM_SKIP. > > This is unchanged with the patch and is a completely separate issue. > > I must be missing something or we are talking past each other. Ohh. Ok, so _I_ was missing that mm_has_notifiers is false after mmu_notifier_release. So we cannot block at that time. Then we are good. Sorry about the confusion! -- Michal Hocko SUSE Labs