From: Johannes Weiner <hannes@cmpxchg.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@kernel.org>,
Yafang Shao <laoar.shao@gmail.com>,
Matthew Wilcox <willy@infradead.org>,
Vladimir Davydov <vdavydov.dev@gmail.com>,
Linux MM <linux-mm@kvack.org>
Subject: Re: [PATCH v3] mm, memcg: fix error return value of mem_cgroup_css_alloc()
Date: Tue, 21 Apr 2020 10:44:26 -0400 [thread overview]
Message-ID: <20200421144426.GD341682@cmpxchg.org> (raw)
In-Reply-To: <20200420164437.80b7c43dc8962ea9acf0519e@linux-foundation.org>
On Mon, Apr 20, 2020 at 04:44:37PM -0700, Andrew Morton wrote:
> From: Yafang Shao <laoar.shao@gmail.com>
> Subject: mm, memcg: fix error return value of mem_cgroup_css_alloc()
>
> 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 -ENOSPC "No space left on device", which is an appropriate errno
> for userspace's failed mkdir.
>
> 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': No
> space left on device"
>
> [akpm@linux-foundation.org: s/EBUSY/ENOSPC/, per Michal]
> Link: http://lkml.kernel.org/r/20200407063621.GA18914@dhcp22.suse.cz
> Link: http://lkml.kernel.org/r/1586192163-20099-1-git-send-email-laoar.shao@gmail.com
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> Suggested-by: Matthew Wilcox <willy@infradead.org>
> Acked-by: Michal Hocko <mhocko@kernel.org>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Fixes: 73f576c04b94 ("mm: memcontrol: fix cgroup creation failure after many small jobs")
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
prev parent reply other threads:[~2020-04-21 14:44 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-06 16:56 [PATCH v3] mm, memcg: fix error return value of mem_cgroup_css_alloc() Yafang Shao
2020-04-06 23:23 ` Andrew Morton
2020-04-07 3:02 ` Yafang Shao
2020-04-07 3:09 ` Andrew Morton
2020-04-07 3:11 ` Yafang Shao
2020-04-07 6:43 ` Michal Hocko
2020-04-07 9:31 ` Yafang Shao
2020-04-07 11:10 ` Michal Hocko
2020-04-07 18:10 ` Johannes Weiner
2020-04-09 1:29 ` Andrew Morton
2020-04-09 6:57 ` Michal Hocko
2020-04-09 13:59 ` Yafang Shao
2020-04-09 14:07 ` Michal Hocko
2020-04-20 23:44 ` Andrew Morton
2020-04-21 14:44 ` Johannes Weiner [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=20200421144426.GD341682@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=laoar.shao@gmail.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.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;
as well as URLs for NNTP newsgroup(s).