[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <874k3d6vuq.fsf@vajain21.in.ibm.com>
Date: Fri, 01 Apr 2022 14:09:25 +0530
From: Vaibhav Jain <vaibhav@...ux.ibm.com>
To: Yosry Ahmed <yosryahmed@...gle.com>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Shakeel Butt <shakeelb@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
David Rientjes <rientjes@...gle.com>
Cc: Tejun Heo <tj@...nel.org>, Zefan Li <lizefan.x@...edance.com>,
Roman Gushchin <roman.gushchin@...ux.dev>,
cgroups@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Jonathan Corbet <corbet@....net>, Yu Zhao <yuzhao@...gle.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Wei Xu <weixugc@...gle.com>, Greg Thelen <gthelen@...gle.com>,
Yosry Ahmed <yosryahmed@...gle.com>
Subject: Re: [PATCH resend] memcg: introduce per-memcg reclaim interface
Yosry Ahmed <yosryahmed@...gle.com> writes:
> From: Shakeel Butt <shakeelb@...gle.com>
>
> Introduce an memcg interface to trigger memory reclaim on a memory cgroup.
<snip>
> +
> + while (nr_reclaimed < nr_to_reclaim) {
> + unsigned long reclaimed;
> +
> + if (signal_pending(current))
> + break;
> +
> + reclaimed = try_to_free_mem_cgroup_pages(memcg,
> + nr_to_reclaim - nr_reclaimed,
> + GFP_KERNEL, true);
> +
> + if (!reclaimed && !nr_retries--)
> + break;
> +
> + nr_reclaimed += reclaimed;
I think there should be a cond_resched() in this loop before
try_to_free_mem_cgroup_pages() to have better chances of reclaim
succeding early.
<snip>
--
Cheers
~ Vaibhav
Powered by blists - more mailing lists