Received: by 10.192.165.148 with SMTP id m20csp12597imm; Tue, 24 Apr 2018 16:09:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/ve1TtxAYClpbi1+P2K26rEQI7NL4hmwbtcjyyttdtI9lRTup49c8859DVQE3ustFk1B0r X-Received: by 10.98.77.2 with SMTP id a2mr25604189pfb.213.1524611397715; Tue, 24 Apr 2018 16:09:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524611397; cv=none; d=google.com; s=arc-20160816; b=qnGDMfRgEUsTyfmfeer8dRZVICPDrggaAF6SmqSvB8a5YPH765XCLBHB8MYF7M1f2+ Gqu6ZlDD9jbnmwiEo9Z/XKQD7x5BtWkSvztF6kiyhuYZPSpnOSUU3jkL52oOIapASGpo SgGyeZLbScFoS2nuzYVdvMnPN62BJ3Nx0RU/YwcY+m11y1fMBqW/n+t6enGsjLJS07qZ pO0QyDTzGrJUhJnH0YzvdwpO4VLK0Xdc4LDHJHUf/elFEhpwI/sZBm+er9CE5bH2osTc TK4UKwWMLYeITstTL69gpttAfF6hlgakyUWzRV+CEMIPFoXkOC9FjdRD24cm7k7VmQq9 Ouhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=bXoh850MUHkwYmWrlWH1EELkAy+Ys+BAkEM87fM1Br8=; b=KRKmQwJ44W3HBsx2GUNkRMVG+j2Ry32p2KpCLzUf+V+9M1KfGjMGPpg0RKuEwCMvWc E6DSt7TNCKDokndUg+9XTJxAgOMn69qSnK7df/G4efLHQii2u4qsD7zNFo6Ez0chTHe+ yIlrP5RC90rHOIodC0ACc5/8qLbw1Wtvavfap0elZkx/9OUyO/G/v4qhXLKObmhLMFj7 H8JsTeG8JBPJLyrWUiIi9EDrv2m0tNXUCXAo75kkoLnMtSjGaaJqaRxQpah0sN69LspB hfHOI0Ym/7pnyW5s9hJQOXw3bqCeQz2Bv3sCTa1BmM90hd2Ja/6rQpmAe44U3Ou7Hign l40A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m13si10901182pgp.528.2018.04.24.16.09.42; Tue, 24 Apr 2018 16:09:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751365AbeDXXIV (ORCPT + 99 others); Tue, 24 Apr 2018 19:08:21 -0400 Received: from mx2.suse.de ([195.135.220.15]:35775 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751061AbeDXXIU (ORCPT ); Tue, 24 Apr 2018 19:08:20 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B88C6AD65; Tue, 24 Apr 2018 23:08:18 +0000 (UTC) Date: Tue, 24 Apr 2018 17:08:15 -0600 From: Michal Hocko To: David Rientjes Cc: Andrew Morton , Tetsuo Handa , Andrea Arcangeli , guro@fb.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap Message-ID: <20180424230815.GX17484@dhcp22.suse.cz> References: <20180420124044.GA17484@dhcp22.suse.cz> <201804221248.CHE35432.FtOMOLSHOFJFVQ@I-love.SAKURA.ne.jp> <20180424130432.GB17484@dhcp22.suse.cz> <20180424201352.GV17484@dhcp22.suse.cz> <20180424203148.GW17484@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. So let me be explicit. What does prevent the following oom_reaper exit_mmap mutex_lock(oom_lock) mutex_lock(oom_lock) __oom_reap_task_mm mmu_notifier_invalidate_range_start # blockable mmu_notifier # which takes ages to # finish or depends on # an allocation (in)directly -- Michal Hocko SUSE Labs