From: Michal Hocko <mhocko@suse.cz>
To: Nicholas Krause <xerofoify@gmail.com>
Cc: hannes@cmpxchg.org, cgroups@vger.kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm:Return proper error code return if call to kzalloc_node falis in the function alloc_mem_cgroup_per_zone_info
Date: Mon, 29 Jun 2015 17:52:14 +0200 [thread overview]
Message-ID: <20150629155214.GD4612@dhcp22.suse.cz> (raw)
In-Reply-To: <1435592813-24499-1-git-send-email-xerofoify@gmail.com>
On Mon 29-06-15 11:46:53, Nicholas Krause wrote:
> This changes us returning the value of one to -ENOMEM when the call
> for allocating memory with the function kzalloc_node fails in order
> to better comply with kernel coding pratices of returning this
> particular error code when memory allocations that are unrecoverable
> occur.
I do not see any point in such a patch. Let me repeat, and hopefully for
the last time, the patch has to make _sense_ and the changelog should
provide a _justification_ for the change. None of this is true for this
patch.
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
I am not interested in changes like this in the code I maintain.
> ---
> mm/memcontrol.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index acb93c5..4e80811 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -4442,7 +4442,7 @@ static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *memcg, int node)
> tmp = -1;
> pn = kzalloc_node(sizeof(*pn), GFP_KERNEL, tmp);
> if (!pn)
> - return 1;
> + return -ENOMEM;
>
> for (zone = 0; zone < MAX_NR_ZONES; zone++) {
> mz = &pn->zoneinfo[zone];
> --
> 2.1.4
>
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2015-06-29 15:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-29 15:46 Nicholas Krause
2015-06-29 15:52 ` 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=20150629155214.GD4612@dhcp22.suse.cz \
--to=mhocko@suse.cz \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=xerofoify@gmail.com \
/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