Received: by 10.192.165.156 with SMTP id m28csp789056imm; Tue, 17 Apr 2018 20:59:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/J2cy4/FVPTWk65zM0DCvuPhFqG0xfpsm57wk6irRwt2Y4KeDSDQ6FdETU5LBrXdk//HjT X-Received: by 10.101.102.3 with SMTP id w3mr424758pgv.151.1524023969533; Tue, 17 Apr 2018 20:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524023969; cv=none; d=google.com; s=arc-20160816; b=yPsXjXGTaBQSmnZ5GjVZOvvlnz2Sngm28vzkvwshQXo8LZ23c37mBbPXhmTkpVgO3V X1dLCxplK5dXCpbFAIn0TdcasOluJ+AwPpwLFuQzQZ4A4M+fPM8mzBLSCZw36GHvkyMz lWo79PTw/RwvAAVt2nhRaGGnHCOy+wCRwVc9tMCEP4j57VCfOVp8Twd83nVhazD3xoNJ Pe7dpx9pOCCB1kKYMunSbs/Mm7pputLSYzPyY0QH4s4FiNdYU9IGv3besW5VUX1enCQP JnLmrplsNhlB5bpsYNkHuvO09K8Rph8oAFcsTT8ZOK87rPf7zGhDsG6o1BNfvzZPGyRv 9S0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:date:mime-version:cc:to:from:subject:message-id :arc-authentication-results; bh=lRFhPachteo843LV6mqqnysDhbttpTp1YUpMXggc+7c=; b=PKP2AqEkRD6jjJ/0HrAw2F0QHlsyn6azdW8hYsLvf7jgDOqYKB0Ka15qWJM15MDX9I qMFGbKTGP5vmZksVemxrMMzbe2HKf698BSAjbSHrjfg879Pg5cZMtBF0HT8xoNF8NSRq kDY30ZTWyGdCCdbEDySJRwpwzoYtNUsy3n6bXXDyRAS20qP5wYF9b7shHL1v1w1qcIZu jMj8GdJN8qeW/YuSm9rBQVsel77QTyvsaqVr2AyZLebclJlPuCs2NcqB7jcKGVydJoZV Gx7vrwH1ab1UB8wewCAxZgyZjlTQP67HpMnQAk+Toj05bKWQbHi9hBURNEROhJ2Oqwmn 4TeQ== 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 x7si344141pfk.311.2018.04.17.20.58.46; Tue, 17 Apr 2018 20:59:29 -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 S1753713AbeDRDzk (ORCPT + 99 others); Tue, 17 Apr 2018 23:55:40 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:11634 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752800AbeDRDzj (ORCPT ); Tue, 17 Apr 2018 23:55:39 -0400 Received: from fsav102.sakura.ne.jp (fsav102.sakura.ne.jp [27.133.134.229]) by www262.sakura.ne.jp (8.14.5/8.14.5) with ESMTP id w3I3tMOl001192; Wed, 18 Apr 2018 12:55:22 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav102.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav102.sakura.ne.jp); Wed, 18 Apr 2018 12:55:22 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav102.sakura.ne.jp) Received: from www262.sakura.ne.jp (localhost [127.0.0.1]) by www262.sakura.ne.jp (8.14.5/8.14.5) with ESMTP id w3I3tMiA001188; Wed, 18 Apr 2018 12:55:22 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: (from i-love@localhost) by www262.sakura.ne.jp (8.14.5/8.14.5/Submit) id w3I3tM6T001187; Wed, 18 Apr 2018 12:55:22 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Message-Id: <201804180355.w3I3tM6T001187@www262.sakura.ne.jp> X-Authentication-Warning: www262.sakura.ne.jp: i-love set sender to penguin-kernel@i-love.sakura.ne.jp using -f Subject: Re: [patch v2] mm, oom: fix concurrent munlock and oom reaper unmap From: Tetsuo Handa To: David Rientjes Cc: Andrew Morton , Michal Hocko , Andrea Arcangeli , Roman Gushchin , linux-kernel@vger.kernel.org, linux-mm@kvack.org MIME-Version: 1.0 Date: Wed, 18 Apr 2018 12:55:22 +0900 References: In-Reply-To: Content-Type: text/plain; charset="ISO-2022-JP" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org David Rientjes wrote: > Fix this by reusing MMF_UNSTABLE to specify that an mm should not be > reaped. This prevents the concurrent munlock_vma_pages_range() and > unmap_page_range(). The oom reaper will simply not operate on an mm that > has the bit set and leave the unmapping to exit_mmap(). This change assumes that munlock_vma_pages_all()/unmap_vmas()/free_pgtables() are never blocked for memory allocation. Is that guaranteed? For example, i_mmap_lock_write() from unmap_single_vma() from unmap_vmas() is never blocked for memory allocation? Commit 97b1255cb27c551d ("mm,oom_reaper: check for MMF_OOM_SKIP before complaining") was waiting for i_mmap_lock_write() from unlink_file_vma() from free_pgtables(). Is it really guaranteed that somebody else who is holding that lock is never waiting for memory allocation?