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 60AD5C433EF for ; Fri, 1 Apr 2022 21:39:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BD1D36B0071; Fri, 1 Apr 2022 17:39:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B5A316B0072; Fri, 1 Apr 2022 17:39:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9D5468D0001; Fri, 1 Apr 2022 17:39:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 86AF76B0071 for ; Fri, 1 Apr 2022 17:39:16 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 4267921E60 for ; Fri, 1 Apr 2022 21:39:06 +0000 (UTC) X-FDA: 79309625892.01.29EECF0 Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) by imf13.hostedemail.com (Postfix) with ESMTP id D1E4920015 for ; Fri, 1 Apr 2022 21:39:05 +0000 (UTC) Received: by mail-il1-f170.google.com with SMTP id 8so2892996ilq.4 for ; Fri, 01 Apr 2022 14:39:05 -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:content-transfer-encoding; bh=HQybvipiwCmhDTMI61RMqSUH6YQ4cHyMt2incAt7F0M=; b=d7qruhihQmBK9XRXFDTh/OTFwOPUebBbBRONhopS4Kl3YS6Bi5NMrVsCYDEno0qUE2 PHL/op/2RZN53g+F8PqMf+RGpmtoRceNQ2hJQe23qD8n2Z4tyFOh09yDWN3y7im+ON6H FNml4umZ981FkpwzHWjVwer70e8OrdQSzD5wysr24DFRYLuYiltD712vAQUAUj9KU72T K1WC4mgeJ7ck53xxur7kZFSCvvaEcDUFNfFtSXMonZAqw0muNFIglXH5OFJJ+4Hpe5uI 3QccBy7LUbIaoHsAaeYwwpcyr9H8zr5KqFxkFNYMXVUztyCEVKP9JS40ggeGGkCpyAwk uMPw== 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:content-transfer-encoding; bh=HQybvipiwCmhDTMI61RMqSUH6YQ4cHyMt2incAt7F0M=; b=zxjEJ6lEzHzAVR1u6Hfk/r/O0IysJnli3XA6zHcFb862U0mRfImT2c+F27yIrCC9X5 EtwGq0TcMi/8TecgSo2uHwoLNpoB8WFNPddZ8T+ZvowsOzkTdOiZkxYtpsyrWTsRW6XT /IXd7L8ijLsGaTGChnVod3DUtqllJ1pbLtjOFlPa/K0o/H/EZBg7M8LA6PuyvWZSFtkD 1Zbv0aLkOlNtnLYz2pJX4wTJGW7/MzVAi4FIDQrQcwTnZGsQqQsXqT3/gkUQ5x1iG9// U5ENf9M02TRQ60p35NygW+Hvu7puXsS0SKl8EPMd/Lzcywzvnw5mdiW5vwXsiZm2Ym2u U0Ww== X-Gm-Message-State: AOAM533c+cVDOS+D5OfPC/aP2XhLPk3RYopNLmq52mwcTh9l9j5V5Ils wM9u+si+8W1YM5Ch2Kr4DyDENiyO8+D67msBw5c1xQ== X-Google-Smtp-Source: ABdhPJw339gzjfTqTSkdWhWJGffdRyP08iLkKXFtUKR1Qq+D288cs49wq7sJRek+Lkk2yCojN5U4n9uiQvL0a0zxC0M= X-Received: by 2002:a05:6e02:12ed:b0:2c9:adfa:bdf5 with SMTP id l13-20020a056e0212ed00b002c9adfabdf5mr812423iln.164.1648849144956; Fri, 01 Apr 2022 14:39:04 -0700 (PDT) MIME-Version: 1.0 References: <243A0156-D26A-47C9-982A-C8B0CDD69DA2@linux.dev> In-Reply-To: <243A0156-D26A-47C9-982A-C8B0CDD69DA2@linux.dev> From: Wei Xu Date: Fri, 1 Apr 2022 14:38:53 -0700 Message-ID: Subject: Re: [PATCH resend] memcg: introduce per-memcg reclaim interface To: Roman Gushchin Cc: Johannes Weiner , Yosry Ahmed , Michal Hocko , Shakeel Butt , Andrew Morton , David Rientjes , Tejun Heo , Zefan Li , cgroups@vger.kernel.org, linux-doc@vger.kernel.org, Linux Kernel Mailing List , Linux-MM , Jonathan Corbet , Yu Zhao , Dave Hansen , Greg Thelen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Stat-Signature: qjfkjgf1q4sa7k6p1rbrtw6axdnnyuop Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=d7qruhih; spf=pass (imf13.hostedemail.com: domain of weixugc@google.com designates 209.85.166.170 as permitted sender) smtp.mailfrom=weixugc@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: D1E4920015 X-HE-Tag: 1648849145-560948 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 1, 2022 at 2:21 PM Roman Gushchin wr= ote: > > > On Apr 1, 2022, at 2:13 PM, Johannes Weiner wrote: > > > > =EF=BB=BFOn Fri, Apr 01, 2022 at 11:39:30AM -0700, Roman Gushchin wrote= : > >> The interface you're proposing is not really extensible, so we'll like= ly need to > >> introduce a new interface like memory.reclaim_ext very soon. Why not c= reate > >> an extensible API from scratch? > >> > >> I'm looking at cgroup v2 documentation which describes various interfa= ce files > >> formats and it seems like given the number of potential optional argum= ents > >> the best option is nested keyed (please, refer to the Interface Files = section). > >> > >> E.g. the format can be: > >> echo "1G type=3Dfile nodemask=3D1-2 timeout=3D30s" > memory.reclaim > > > > Yeah, that syntax looks perfect. > > I agree this is a better syntax than positional arguments. The latter would require a default value be specified for each earlier argument if we just want to provide a custom value for a later argument. > > But why do you think it's not extensible from the current patch? We > > can add those arguments one by one as we agree on them, and return > > -EINVAL if somebody passes an unknown parameter. > > > > It seems to me the current proposal is forward-compatible that way > > (with the current set of keyword pararms being the empty set :-)) > > It wasn=E2=80=99t obvious to me. We spoke about positional arguments and = then it wasn=E2=80=99t clear how to add them in a backward-compatible way. = The last thing we want is a bunch of memory.reclaim* interfaces :) > So yeah, let=E2=80=99s just describe it properly in the documentation, no= code changes are needed.