Received: by 10.192.165.148 with SMTP id m20csp1964815imm; Sat, 21 Apr 2018 20:49:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+JTUmfvAC0Jq4i4BigXqcBoihm3L8imiXSGSdNAkbRWKJPGu4IkIiv5Ch/ec6R/FRw8Shn X-Received: by 10.98.9.72 with SMTP id e69mr14886640pfd.197.1524368990180; Sat, 21 Apr 2018 20:49:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524368990; cv=none; d=google.com; s=arc-20160816; b=vyVN9eNTfbcgQFkTzWrSfC6EPYB2VbSCx85ptWWIVOPkjTbZZ5Z+5KUoriFAJNujf6 fKNPDbh7OqoEGNQttvdcw8NsqphWrgNrmQowo4RkyUPlneM820WZvEoroDkHpt09Ra5/ 8zXYvc0wytH+NEIEiDdtf9iVisLJDxeBDn4khDwWkyncf6llNACanfYFwY5pRqGjtldc ZsIEPsxqR7MWc9nTLTKBORMzjGqpTIEhzMhyZ8dkWnVlw1wncx62a8QXSVKrpaHTvtpT Yohu7aL++u/ejk/Dr4CntxKa+N1oaq7+jLb0np8vr9Lf6lg5Soa47VwB5J3Ch0jOqZrm hDWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:date:message-id:in-reply-to :references:from:subject:cc:to:arc-authentication-results; bh=70Aibp8wJQ6RZU6uXpQl0VrUV78Gm3mWND1iVm+gUyI=; b=wAE3+lblWZ8WWfkHogS4tegT1SzTD0oIVZpCjFf8zY9/GHTqMiuP8aPeBBtNz4ojqu K3ehhqPxEQJTV9MTyJau6oziI/B3johkMPCd2bK1YS9GCk4XiZ5OGv3xjDmMoVWuuqSR /Z7kXJPn+cf3qclUyZCOVz3ZFUJce8MVZjSCVpk0PHZkcMQYO3ZbYn8V/BXKF0p6dg0U 8PTTpyR5s/bDC/UtSQ1Egrgg73MGs1okdWEZEF9EOlRKr0AReqMD0FNlZ192WFpM6pL2 R4ExGYllkhhWcVxlU60N4GUeTaAoUeNdRKY/Zd2VP5L0+sbWjMwRxPI/p2dBp7aC6Rcf eSgQ== 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 c87si8598013pfd.89.2018.04.21.20.49.36; Sat, 21 Apr 2018 20:49:50 -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 S1753404AbeDVDsd (ORCPT + 99 others); Sat, 21 Apr 2018 23:48:33 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:24682 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753025AbeDVDsc (ORCPT ); Sat, 21 Apr 2018 23:48:32 -0400 Received: from fsav405.sakura.ne.jp (fsav405.sakura.ne.jp [133.242.250.104]) by www262.sakura.ne.jp (8.14.5/8.14.5) with ESMTP id w3M3mGMB085720; Sun, 22 Apr 2018 12:48:16 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav405.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav405.sakura.ne.jp); Sun, 22 Apr 2018 12:48:16 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav405.sakura.ne.jp) Received: from AQUA (softbank126099184120.bbtec.net [126.99.184.120]) (authenticated bits=0) by www262.sakura.ne.jp (8.14.5/8.14.5) with ESMTP id w3M3mGZ6085717; Sun, 22 Apr 2018 12:48:16 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) To: rientjes@google.com, mhocko@kernel.org Cc: akpm@linux-foundation.org, aarcange@redhat.com, guro@fb.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch v2] mm, oom: fix concurrent munlock and oom reaperunmap From: Tetsuo Handa References: <20180419063556.GK17484@dhcp22.suse.cz> <20180420082349.GW17484@dhcp22.suse.cz> <20180420124044.GA17484@dhcp22.suse.cz> In-Reply-To: Message-Id: <201804221248.CHE35432.FtOMOLSHOFJFVQ@I-love.SAKURA.ne.jp> X-Mailer: Winbiff [Version 2.51 PL2] X-Accept-Language: ja,en,zh Date: Sun, 22 Apr 2018 12:48:13 +0900 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org David Rientjes wrote: > How have you tested this? > > I'm wondering why you do not see oom killing of many processes if the > victim is a very large process that takes a long time to free memory in > exit_mmap() as I do because the oom reaper gives up trying to acquire > mm->mmap_sem and just sets MMF_OOM_SKIP itself. > We can call __oom_reap_task_mm() from exit_mmap() (or __mmput()) before exit_mmap() holds mmap_sem for write. Then, at least memory which could have been reclaimed if exit_mmap() did not hold mmap_sem for write will be guaranteed to be reclaimed before MMF_OOM_SKIP is set.