From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1484C432C0 for ; Tue, 26 Nov 2019 07:31:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 81B9D2068E for ; Tue, 26 Nov 2019 07:31:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 81B9D2068E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E7ADD6B02BD; Tue, 26 Nov 2019 02:31:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E2B7C6B02BE; Tue, 26 Nov 2019 02:31:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D41246B02BF; Tue, 26 Nov 2019 02:31:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0048.hostedemail.com [216.40.44.48]) by kanga.kvack.org (Postfix) with ESMTP id BBA1A6B02BD for ; Tue, 26 Nov 2019 02:31:33 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 5E1938249980 for ; Tue, 26 Nov 2019 07:31:33 +0000 (UTC) X-FDA: 76197608466.12.idea08_47bc15baf305f X-HE-Tag: idea08_47bc15baf305f X-Filterd-Recvd-Size: 4310 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Tue, 26 Nov 2019 07:31:32 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id n1so21139474wra.10 for ; Mon, 25 Nov 2019 23:31:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6QHyeXrO1vjK8VS1bCJUcVCnVEYfh5hHIuAYaz6mH7g=; b=ONnwYEhwJ/RN+bchqK+CpnP2o9IlqsCEqLlqs0OHG4Llh7R66s6SEzmpbiwZruf7ja pe+wevejvD/FEOirAqv5/5YJ9GTXDM8wAPEKyK+55GyWvJIYacSbUTuxaldM9YI22K8z qraDC02fMdG0djeGx6h6zccaUESU26BB2f8vld77TjL0ohX0JFIGP6fnZotW0rPWmI2R yl920mBB5C4lHzVyRys7cY7Ut60/6n4jisxDMMjHaJsfJF6I+jMjN31xnqATP+WJyRTl KUM7EbWQHHl1fb0cNZs668PecpLA5O7WqcbsZ7gagWww9d14inI3rCa4eo9PvtdyHoGG 3eGQ== X-Gm-Message-State: APjAAAUrz1pzHhK4ZDpcPyCpc8Jl9ERHEB4dEPxWmROFUXukoXorjtPa 1LOIbukoFkYmAgMBma38ARk= X-Google-Smtp-Source: APXvYqxPspj/Cu2VrXcoU5JvFYmGKPAy8oEBuIGjgJ+rbmAJgVu98NFMJHwiv7z6kXqEIWQ33AsujQ== X-Received: by 2002:a5d:538d:: with SMTP id d13mr37633727wrv.304.1574753491651; Mon, 25 Nov 2019 23:31:31 -0800 (PST) Received: from localhost (ip-37-188-171-132.eurotel.cz. [37.188.171.132]) by smtp.gmail.com with ESMTPSA id b2sm13998636wrr.76.2019.11.25.23.31.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2019 23:31:30 -0800 (PST) Date: Tue, 26 Nov 2019 08:31:29 +0100 From: Michal Hocko To: Yafang Shao Cc: Johannes Weiner , Vladimir Davydov , Andrew Morton , Linux MM Subject: Re: [PATCH] mm, memcg: clear page protection when memcg oom group happens Message-ID: <20191126073129.GA20912@dhcp22.suse.cz> References: <20191125115409.GJ31714@dhcp22.suse.cz> <20191125123123.GL31714@dhcp22.suse.cz> <20191125124553.GM31714@dhcp22.suse.cz> <20191125142150.GP31714@dhcp22.suse.cz> <20191125144213.GB602168@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 26-11-19 11:52:19, Yafang Shao wrote: > On Mon, Nov 25, 2019 at 10:42 PM Johannes Weiner wrote: > > > > On Mon, Nov 25, 2019 at 03:21:50PM +0100, Michal Hocko wrote: > > > On Mon 25-11-19 22:11:15, Yafang Shao wrote: > > > > When there're no processes, we don't need to protect the pages. You > > > > can consider it as 'fault tolerance' . > > > > > > I have already tried to explain why this is a bold statement that > > > doesn't really hold universally and that the kernel doesn't really have > > > enough information to make an educated guess. > > > > I agree, this is not obviously true. And the kernel shouldn't try to > > guess whether the explicit userspace configuration is still desirable > > to userspace or not. Should we also delete the cgroup when it becomes > > empty for example? > > > > It's better to implement these kinds of policy decisions from > > userspace. > > > > There is a cgroup.events file that can be polled, and its "populated" > > field shows conveniently whether there are tasks in a subtree or > > not. You can use that to clear protection settings. > > Why isn't force_empty supported in cgroup2 ? There wasn't any sound usecase AFAIR. > In this case we can free the protected file pages immdiately with force_empty. You can do the same thing by setting the hard limit to 0. -- Michal Hocko SUSE Labs