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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2BA7C433F5 for ; Thu, 14 Apr 2022 17:26:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 326E66B0071; Thu, 14 Apr 2022 13:26:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D6ED6B0073; Thu, 14 Apr 2022 13:26:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19FED6B0074; Thu, 14 Apr 2022 13:26:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 0BCAE6B0071 for ; Thu, 14 Apr 2022 13:26:07 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id CC87C20887 for ; Thu, 14 Apr 2022 17:26:06 +0000 (UTC) X-FDA: 79356162732.01.CE3D7F1 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf27.hostedemail.com (Postfix) with ESMTP id 45CC740011 for ; Thu, 14 Apr 2022 17:26:06 +0000 (UTC) Received: by mail-pf1-f179.google.com with SMTP id j17so5439715pfi.9 for ; Thu, 14 Apr 2022 10:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Sz07fc6I7lIWKPKMNOVSVRZPVjZ/2q5aP50+7giwSck=; b=dF21I7xa+PEEtOju0dwSpmZ52AgeF8q9DD0slppiVuAkzhepRjGULhGl9GSpaBaN9k HGkp6aPpOc9KxYswilZx68HsiWuwoTmPMmPrje77QTltrR3lFASV4DzIG9UcRcdjscvl ffQJoIJtZdVAFsLtEgdP6aUWUI6OZWXIZjpoHl3BRmAwNH9B7bKriI3kN7Xrrghy+8ok w96Q/Nfe2bAgEu0mE0P095/9Fkk+kENEDAlaKx9Spnw61TPbAyCwio9dXAHsqa2FB/20 SpIpeNvGk1Tj/340dPGN1lPPWwoBdi2stjlFsfs5ae5cBCgS/HibP9ne/pdbI3MJwjXl PXkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Sz07fc6I7lIWKPKMNOVSVRZPVjZ/2q5aP50+7giwSck=; b=mlH4exluRywsuir1QDTd4j+ZZrYpw+Hj13be4OmF+fOjD290AlOygfa/g+NFDEAC/p DSXTwE9v7dAvdou7l6PY1kz4Ry565rbF5KW0bdhajZIr1JHe6v+9HXDfJhIgQXYg6fu5 cgjjPi970zMglFgkQr0jcIsdUPof9QM34YGp8ZFXFFJlJJJ2U7Y3+8W52XBKsMK2wmYz Q4xR0pes+SxNdbsz18Mi36n/P837uXyoGnXySJsvQATz2hxazLva1TG7H1XKqS9XV6LO QWiuD+WzSkUl6AnUkvqLtoJT7ttBroEtLfScx5qe3GRWCF4Ek4jKrQx3QLDQPg4JA2di uruA== X-Gm-Message-State: AOAM533QaoK11P5pvD6Q7hZev5/7a19Z+3oWpdhiWPT2ZfcNrCFgf7zV +J1+v7VAcf3qS9tr8ZIEX4GK4CeiUeG1DTJdd63R9g== X-Google-Smtp-Source: ABdhPJx93mXSCF+yEz9k2YvFHTy3Z6BKK4DmU6/ANhw2gPmq6Vl/jGOlUzeXD9No5PoS/iQzRus81pzLrcNCfCP0TIY= X-Received: by 2002:a05:6a00:17a6:b0:505:a751:8354 with SMTP id s38-20020a056a0017a600b00505a7518354mr5003805pfg.82.1649957165014; Thu, 14 Apr 2022 10:26:05 -0700 (PDT) MIME-Version: 1.0 References: <20220408045743.1432968-1-yosryahmed@google.com> <20220408045743.1432968-2-yosryahmed@google.com> In-Reply-To: From: Yosry Ahmed Date: Thu, 14 Apr 2022 10:25:29 -0700 Message-ID: Subject: Re: [PATCH v3 1/4] memcg: introduce per-memcg reclaim interface To: Michal Hocko Cc: Johannes Weiner , Shakeel Butt , Andrew Morton , Roman Gushchin , David Rientjes , Tejun Heo , Dan Schatzberg , Zefan Li , Jonathan Corbet , Shuah Khan , Yu Zhao , Dave Hansen , Wei Xu , Greg Thelen , Chen Wandun , Vaibhav Jain , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Tim Chen , cgroups@vger.kernel.org, linux-doc@vger.kernel.org, Linux Kernel Mailing List , Linux-MM , linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: h15hts8a8pr6h97n8t5nb46z1pimxjdf Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=dF21I7xa; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf27.hostedemail.com: domain of yosryahmed@google.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=yosryahmed@google.com X-Rspamd-Queue-Id: 45CC740011 X-HE-Tag: 1649957166-47923 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 Fri, Apr 8, 2022 at 1:08 PM Yosry Ahmed wrote: > > On Fri, Apr 8, 2022 at 7:55 AM Dan Schatzberg wrote: > > > > On Fri, Apr 08, 2022 at 04:11:05PM +0200, Michal Hocko wrote: > > > Regarding "max" as a possible input. I am not really sure to be honest. > > > I can imagine that it could be legit to simply reclaim all the charges > > > (e.g. before removing the memcg) which should be achieveable by > > > reclaiming the reported consumption. Or what exactly should be the > > > semantic? > > > > Yeah, it just allows you to avoid reading memory.current to just > > reclaim everything if you can specify "max" - you're still protected > > by nretries to eventually bail out. Mostly, though I just feel like > > supporting "max" makes memory.reclaim semetric with a lot of the > > cgroup memory control files which tend to support "max". > > One possible approach here is to have force_empty behavior when we > write "max" to memory.reclaim. From Google's perspective we don't have > a preference, but it seems to me like logical behavior. We can do this > either by directly calling mem_cgroup_force_empty() or just draining > stock and lrus in memory_reclaim(). > > This actually brings up another interesting point. Do you think we > should drain lrus if try_to_free_mem_cgroup_pages() fails to reclaim > the request amount? We can do this after the first call or before the > last one. It could introduce more evictable pages for > try_to_free_mem_cgroup_pages() to free. Hey Michal, any thoughts on this? I am looking for feedback on this before I send out v4.