Received: by 10.192.165.148 with SMTP id m20csp17992imm; Tue, 24 Apr 2018 16:16:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx48RWY3222x1fu1c1HqAvT+G5+0RGpsVbZys08xcpFaQSX8048mT18fzUVVLYgkQCORCiX8m X-Received: by 2002:a17:902:7510:: with SMTP id i16-v6mr18681993pll.291.1524611798208; Tue, 24 Apr 2018 16:16:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524611798; cv=none; d=google.com; s=arc-20160816; b=j51akHLeGkF2nx+Poeei9T8wjzAXlAq1jLJ97WwzBkDW3Z9Kmj3LTZWS7NC7+A++Xj OFHwDsCdKCVbg4BPMSTufjqcvRtBC5M1iBsvQU5rxwdbvyHf0UDik2p9flaP1R6/dPJ6 fCHiSzmM/nKYz3jeeVyDgVO5NXkhrR9/Fi/Y5VsRwGHUMlpmbyy5DozD9vdZdNgeZ5ya M0/903NhHd9dXXD6GIeBiHiAwhS7aoQzQzQrEBPMdHW/14Nt4fmZyMijyDlsEX+Tgvwt V6xYRMiwbESirRSmueYafynxJatKIbw11um2nVfvnMPgx5MB66xbJTKJ3HJciYl5rZ+7 Eihg== 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=Esvp5xMOjXlE5NBsg5MWtNYvTsIe26wmV1pY/tplxJQ=; b=l3sczOOQ4lF/Gq7HzQKRrUliIYQivvJidN/g4xOPDMyelJ3fiW70LRcJqI0ysgvZzh BSVah6eNf0HZV5Da3ANv64m/jzTRGLPAI9pOcwyVt1779Bw1pRqs10b746VR/BdaPtGt Je9eWejSyYagLtIOyQiBz32iHnLIbgRoURG9q2HqlIGd+CAbx++iiyhhH6Xe9sQhiLpM fEbaRQp108GZB9jbzmMjp4XMutg7SpoVH/ydqoPP+7axaPgiwLz9fLig1kXamhXwtZ6I bPHwlbU6htDCEAMx1iaCRUurR05sqeewRp/TNV9jiV6b2S1HXkwn2eGyZyN1XzjFO3lF JVWQ== 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 5-v6si14399578plx.148.2018.04.24.16.16.17; Tue, 24 Apr 2018 16:16:38 -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 S1751265AbeDXXPD (ORCPT + 99 others); Tue, 24 Apr 2018 19:15:03 -0400 Received: from mx2.suse.de ([195.135.220.15]:36142 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750791AbeDXXO7 (ORCPT ); Tue, 24 Apr 2018 19:14:59 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1E72CABDB; Tue, 24 Apr 2018 23:14:58 +0000 (UTC) Date: Tue, 24 Apr 2018 17:14:55 -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: <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> 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 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