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=-4.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 93670C433E2 for ; Wed, 15 Jul 2020 16:54:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 56727206F4 for ; Wed, 15 Jul 2020 16:54:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20150623.gappssmtp.com header.i=@cmpxchg-org.20150623.gappssmtp.com header.b="FBdUKu4Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56727206F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DB70C6B0005; Wed, 15 Jul 2020 12:54:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D676D6B0006; Wed, 15 Jul 2020 12:54:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C57496B0007; Wed, 15 Jul 2020 12:54:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0241.hostedemail.com [216.40.44.241]) by kanga.kvack.org (Postfix) with ESMTP id B2CAF6B0005 for ; Wed, 15 Jul 2020 12:54:54 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 746E0181AC9BF for ; Wed, 15 Jul 2020 16:54:54 +0000 (UTC) X-FDA: 77040909708.26.flock13_120947726efb Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 4ADED1804B656 for ; Wed, 15 Jul 2020 16:54:54 +0000 (UTC) X-HE-Tag: flock13_120947726efb X-Filterd-Recvd-Size: 5281 Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Jul 2020 16:54:53 +0000 (UTC) Received: by mail-qk1-f194.google.com with SMTP id c139so2432133qkg.12 for ; Wed, 15 Jul 2020 09:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=IGEOdfM2hRlmbqp8sPRSn3puPERfLRnlbCIsoJ2WegI=; b=FBdUKu4ZqFwKdKPqP5xEzhJHNM74kc6s4VEdepCUCGgTjRFE3AtXMmZ2hS5rVF2e1L m9IeJuX0bWDhMp+OGVyI7sTsCuhDDiBZzIoyq+ekaze/9E09bSWYOp3etnk7kM82RZtN cTY2LB4aAt6pLWE0+leOyfZgo+2hnraY7tw6uk0vrcS8EMA8wVkmja0pflTayZlU9UhV d+xF6vlAjul4fyOd+P4AfKyZlOXd/957OqJfXz7rmeX+WduUZm+w7hQ2+ujWGyzmF/SS JOCrxuS9FKTiYF03lR/vvB6HXE8zoygLtjHUh0dQPEa9QAsSssinSDoF5+U9TVLcvvv0 Lp1Q== 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; bh=IGEOdfM2hRlmbqp8sPRSn3puPERfLRnlbCIsoJ2WegI=; b=t6kn8aKEI6j2V//gB/vpA2vHj8TVI/g+CmXay+YssUWrbvQxAf9u00eeDIy2hJJdmg OswH2AgCDsmk70QdO2eO0mLniddEgByFI4M/09/9lOfFfW3/hMnGa9VqpAdqB3X0OElq DZE5jxq7jdvZ08NkrT/VwDulP2kYm53AfmyrYwuxKtnMHQU6wN/6/g7uZShuRqblR21t mcAxYZC6xRuZ9iguIogc1OWtWlL+B+GAm/UcEXl65bxSvitnP2SIuT/SKb9R7BCVRbHo dFxJ5kOceCnAuXVwd9RwGqwwBJoX7onMjy2SHQ4i67xPWbDssRbT4g4QwVCqdymDYuaQ NfCg== X-Gm-Message-State: AOAM533G9vNrXcqIOHljq0/LTjnTybeW3J1UVEjEW7k0oWB3cZV7Reua j3JXd0drlAOIdnDhLqXYOKwqyA== X-Google-Smtp-Source: ABdhPJw+BsB1V/WidzAtPATnw4VY3l9AFfLmdy3RNQXztS/qL3uXKFijMY4CqdSI3ebgB3bNyHuGUw== X-Received: by 2002:a05:620a:1282:: with SMTP id w2mr14411qki.196.1594832092927; Wed, 15 Jul 2020 09:54:52 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:6e7a]) by smtp.gmail.com with ESMTPSA id m14sm3246229qke.99.2020.07.15.09.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 09:54:51 -0700 (PDT) Date: Wed, 15 Jul 2020 12:54:02 -0400 From: Johannes Weiner To: Shakeel Butt Cc: Yang Shi , Roman Gushchin , Michal Hocko , Andrew Morton , Linux MM , Kernel Team , LKML , Domas Mituzas , Tejun Heo , Chris Down Subject: Re: [PATCH] mm: memcontrol: avoid workload stalls when lowering memory.high Message-ID: <20200715165402.GA232052@cmpxchg.org> References: <20200709194718.189231-1-guro@fb.com> <20200710122917.GB3022@dhcp22.suse.cz> <20200710184205.GB350256@carbon.dhcp.thefacebook.com> <20200714153817.GA215857@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4ADED1804B656 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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, Jul 14, 2020 at 10:06:32AM -0700, Shakeel Butt wrote: > On Tue, Jul 14, 2020 at 8:39 AM Johannes Weiner wrote: > > The way we do this right now is having the reclaimer daemon in a > > dedicated top-level cgroup with memory.min protection. > > > > This works well because we have a comprehensive cgroup setup anyway > > and need to protect this daemon (it's oomd - the proactive reclaimer, > > senpai, is a plugin) for other reasons as well. But it's probably a > > royal pain to use if you don't have all of that infrastructure. > > > > One possible idea to make this simpler would be to have a limit knob > > that has a psi/pressure blowout valve. This way you could specify your > > tolerances for paging and what constitutes "cold" memory, and the > > limit unsets itself when pressure moves into harmful territory. This > > would make it safe to use when the reclaimer becomes unresponsive or > > dies altogether, which makes it safe to use from within the > > cgroup. And being separate from max and high means we can delegate it. > > I like this idea and agree with having a separate interface from max > and high. Though why do we want to think of this interface as a limit > interface. Are there additional benefits or use-cases which can > benefit from this semantic? I'm not saying we have to. But one benefit of having a limit rather than a reclaim command knob is that you can prevent cache-polluting scans through file data from unnecessarily exploding the memory footprint of the cgroup. It may be useful to compile a list of applications and goals for such a knob, i.e. the reasons we want to do proactive reclaim in the first place.