From: Pekka Enberg <penberg@iki.fi>
To: Peng Wang <rocking@whu.edu.cn>,
cl@linux.com, penberg@kernel.org, rientjes@google.com,
iamjoonsoo.kim@lge.com, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/slub.c: freelist is ensured to be NULL when new_slab() fails
Date: Sat, 29 Dec 2018 12:02:14 +0200 [thread overview]
Message-ID: <56ee5ac0-0785-cf2a-c1b4-95d4df2d11f1@iki.fi> (raw)
In-Reply-To: <20181229062512.30469-1-rocking@whu.edu.cn>
On 29/12/2018 8.25, Peng Wang wrote:
> new_slab_objects() will return immediately if freelist is not NULL.
>
> if (freelist)
> return freelist;
>
> One more assignment operation could be avoided.
>
> Signed-off-by: Peng Wang <rocking@whu.edu.cn>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
> ---
> mm/slub.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index 36c0befeebd8..cf2ef4ababff 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -2463,8 +2463,7 @@ static inline void *new_slab_objects(struct kmem_cache *s, gfp_t flags,
> stat(s, ALLOC_SLAB);
> c->page = page;
> *pc = c;
> - } else
> - freelist = NULL;
> + }
>
> return freelist;
> }
>
next prev parent reply other threads:[~2018-12-29 10:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-29 6:25 Peng Wang
2018-12-29 10:02 ` Pekka Enberg [this message]
2019-01-02 21:43 ` David Rientjes
2019-01-02 21:43 ` David Rientjes
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=56ee5ac0-0785-cf2a-c1b4-95d4df2d11f1@iki.fi \
--to=penberg@iki.fi \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=rocking@whu.edu.cn \
/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