Re: Possible mem cgroup bug in kernels between 4.18.0 and 5.3-rc1.

From: Michal Hocko
Date: Fri Aug 02 2019 - 04:18:14 EST


[Hillf, your email client or workflow mangles emails. In this case you
are seem to be reusing the message id from the email you are replying to
which confuses my email client to assume your email is a duplicate.]

On Fri 02-08-19 16:08:01, Hillf Danton wrote:
[...]
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -2547,8 +2547,12 @@ retry:
> nr_reclaimed = try_to_free_mem_cgroup_pages(mem_over_limit, nr_pages,
> gfp_mask, may_swap);
>
> - if (mem_cgroup_margin(mem_over_limit) >= nr_pages)
> - goto retry;
> + if (mem_cgroup_margin(mem_over_limit) >= nr_pages) {
> + if (nr_retries--)
> + goto retry;
> + /* give up charging memhog */
> + return -ENOMEM;
> + }

Huh, what? You are effectively saying that we should fail the charge
when the requested nr_pages would fit in. This doesn't make much sense
to me. What are you trying to achive here?
--
Michal Hocko
SUSE Labs