From: Michal Hocko <mhocko@kernel.org>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: willy@infradead.org, hannes@cmpxchg.org, vdavydov.dev@gmail.com,
akpm@linux-foundation.org, linux-mm@kvack.org
Subject: Re: [PATCH v2] mm, memcg: fix error return value of mem_cgroup_css_alloc()
Date: Tue, 7 Apr 2020 08:44:23 +0200 [thread overview]
Message-ID: <20200407064423.GC18914@dhcp22.suse.cz> (raw)
In-Reply-To: <20200407063621.GA18914@dhcp22.suse.cz>
On Tue 07-04-20 08:36:24, Michal Hocko wrote:
> On Mon 06-04-20 23:48:54, Yafang Shao wrote:
> > When I run my memcg testcase which creates lots of memcgs, I found
> > there're unexpected out of memory logs while there're still enough
> > available free memory. The error log is,
> > mkdir: cannot create directory 'foo.65533': Cannot allocate memory
> >
> > The reason is when we try to create more than MEM_CGROUP_ID_MAX memcgs, an
> > -ENOMEM errno will be set by mem_cgroup_css_alloc(), but the right errno
> > should be -EBUSY "Device or resource busy". That is same with
> > memcg_alloc_cache_id().
>
> I do not see EBUSY being listed as expected return value for mkdir(2)
> which is the primary way to create a cgroup.
>
> > As the errno really misled me, we should make it right. After this patch,
> > the error log will be,
> > mkdir: cannot create directory 'foo.65533': Device or resource busy
>
> I do see ENOMEM being slightly confusing but if we really need to fix
> this then ENOSPC sounds like a better fit to me.
Btw. I have just checked 73f576c04b94 ("mm: memcontrol: fix cgroup
creation failure after many small jobs") and it explicitly talks about
ENOSPC being returned prior to this patch.
--
Michal Hocko
SUSE Labs
prev parent reply other threads:[~2020-04-07 6:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-06 15:48 Yafang Shao
2020-04-06 16:42 ` Matthew Wilcox
2020-04-06 16:51 ` Yafang Shao
2020-04-07 6:36 ` Michal Hocko
2020-04-07 6:44 ` Michal Hocko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200407064423.GC18914@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=laoar.shao@gmail.com \
--cc=linux-mm@kvack.org \
--cc=vdavydov.dev@gmail.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox