lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YlBCeadBqbeVvALK@dhcp22.suse.cz>
Date:   Fri, 8 Apr 2022 16:11:05 +0200
From:   Michal Hocko <mhocko@...e.com>
To:     Dan Schatzberg <schatzberg.dan@...il.com>
Cc:     Yosry Ahmed <yosryahmed@...gle.com>,
        Johannes Weiner <hannes@...xchg.org>,
        Shakeel Butt <shakeelb@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Roman Gushchin <roman.gushchin@...ux.dev>,
        David Rientjes <rientjes@...gle.com>,
        Tejun Heo <tj@...nel.org>, Zefan Li <lizefan.x@...edance.com>,
        Jonathan Corbet <corbet@....net>,
        Shuah Khan <shuah@...nel.org>, Yu Zhao <yuzhao@...gle.com>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Wei Xu <weixugc@...gle.com>, Greg Thelen <gthelen@...gle.com>,
        Chen Wandun <chenwandun@...wei.com>,
        Vaibhav Jain <vaibhav@...ux.ibm.com>,
        Michal Koutný <mkoutny@...e.com>,
        Tim Chen <tim.c.chen@...ux.intel.com>, cgroups@...r.kernel.org,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v3 1/4] memcg: introduce per-memcg reclaim interface

On Fri 08-04-22 09:43:03, Dan Schatzberg wrote:
> On Fri, Apr 08, 2022 at 04:57:40AM +0000, Yosry Ahmed wrote:
> > +static ssize_t memory_reclaim(struct kernfs_open_file *of, char *buf,
> > +			      size_t nbytes, loff_t off)
> > +{
> > +	struct mem_cgroup *memcg = mem_cgroup_from_css(of_css(of));
> > +	unsigned int nr_retries = MAX_RECLAIM_RETRIES;
> > +	unsigned long nr_to_reclaim, nr_reclaimed = 0;
> > +	int err;
> > +
> > +	buf = strstrip(buf);
> > +	err = page_counter_memparse(buf, "", &nr_to_reclaim);
> 
> Is there a reason not to support "max"? Empty string seems odd to me
> here.

I have to say I have missed the special meaning of the empty string here
and I agree this would indeed really weird. Does cgroup core even call
here? cgroup_file_write seems to drop !nbytes input.

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?
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ