Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp592523ybh; Wed, 15 Jul 2020 09:56:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbY4a82ndRbfr3fYz4eiD7mQg1kdaEnpd1IjhKpL12mVCxVxZmgIeqN9bZLQ3IRpSc8HCu X-Received: by 2002:aa7:c606:: with SMTP id h6mr478269edq.363.1594832165523; Wed, 15 Jul 2020 09:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594832165; cv=none; d=google.com; s=arc-20160816; b=ceE83Yqfo/gcg9YEsWalUOQBj0VaY1Em6Q5WuFf8W1X4HgfVYKpjVSa4oXZvvBuoD8 T2eHmlAm/zy/ywyjG3VYuqYk8PRVukEKWxeXe7ugEZTpu3M5vhR4Ts9HOeFlF+EpAjwi vwn4iG0wZtyp2jz2rBVcYNlRlV5RKZdyDSS7KP94GkEiAPA5VFK2p2nJ3JOaWBHM7bts LjSIhCEk2wR3eL7ig9xJEr4fIQjSw5Ob7LE1ZKR9jeRrlI5YxloHRIrvFjIz55EHKgzZ tZ0ylL+eTjobprGbnSfZPukPfOjaEhR7T4oZlsWvufOO7yzjtsyUW72890SVC/yOxgqz +gug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=IGEOdfM2hRlmbqp8sPRSn3puPERfLRnlbCIsoJ2WegI=; b=A2TNd+0X3NMawL5OomdJi0O2cqHXyouTfNrd1ITi2K+xZU0mZk6EZ2LKHqqnmdHpjE yHVVxWITH7nOnUsE2joPIaSXdVc+dZP81zbr0hxcehCRqmrwHoNcj8AqIvfMaSArmXy6 9GV5+gdTqmuuR3OBlUOGsXmfHkBlDNU/B9m2tQjqWyqI7aKt/17AyahG7BT/+bQd+9s3 bZsYCU/I2BNdCNs12krNU1NxmpvZ94PYDE4WSQq4NfQXxEXHrc6qHeqEd8s1MC6G5oNM GUZIrzLHRuS7dh6yfZdalgGbtPW39ker9gA9ynsTaaZ70jCLANIplpz2i0Ux5k8Y11HC 5vdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=FBdUKu4Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do14si127118ejc.39.2020.07.15.09.55.42; Wed, 15 Jul 2020 09:56:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=FBdUKu4Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726086AbgGOQyz (ORCPT + 99 others); Wed, 15 Jul 2020 12:54:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725834AbgGOQyy (ORCPT ); Wed, 15 Jul 2020 12:54:54 -0400 Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03ADBC061755 for ; Wed, 15 Jul 2020 09:54:53 -0700 (PDT) Received: by mail-qk1-x741.google.com with SMTP id 80so2450546qko.7 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=uDP7/Sjn8N7ZCGO2jWIkzAr3vwIBXa2ewtIhOGn8raqfqHuw0GhWSsgorbKH3pepbz IqIelFglR0/i1RRO4qOOOw/LdTD7Cxf1dhpux4sfphOWHFsUy2RtnoT+5R8V+AigEsbG xxk3flBpxOwnO++SFJwbYAwx4pmuetl/5cWHGQlgfBV3pPDISzpwNMifS2mHh969UEA7 5h+QEUXzcV6yobpBZaSm8uX2af8V8aiS3+85O0krBGMZTTI6JwOU7JKnpcWkzk9HR0VH AOm5pyoksPlQ15KiWC34mL2Y5dST29KT/c4rIswHEZsTLK+Gin0hZdg4l5hQx1ETAqXh XcTA== X-Gm-Message-State: AOAM533k9sleD761TXnM42ACQ2vWT2aGtM7D7+8dICwQx6LVSFdZ3dSN r+O03JhsRHObXbduasr4sT2mqA== 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: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.