public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Qing Wang <wangqing7171@gmail.com>
To: vbabka@kernel.org
Cc: akpm@linux-foundation.org, cl@gentwo.org, hao.li@linux.dev,
	harry.yoo@oracle.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, rientjes@google.com,
	roman.gushchin@linux.dev, wangqing7171@gmail.com
Subject: Re: [PATCH] slab: remove alloc_full_sheaf()
Date: Thu, 12 Mar 2026 11:31:05 +0800	[thread overview]
Message-ID: <20260312033105.593829-1-wangqing7171@gmail.com> (raw)
In-Reply-To: <20260311-b4-slab-remove-alloc_full_sheaf-v1-1-c4c5bb587ae5@kernel.org>

On Thu, 12 Mar 2026 at 02:22, "Vlastimil Babka (SUSE)" <vbabka@kernel.org> wrote:
> -	if (!full)
> +	if (refill_sheaf(s, empty, gfp | __GFP_NOMEMALLOC | __GFP_NOWARN)) {
> +		/*
> +		 * we must be very low on memory so don't bother
> +		 * with the barn
> +		 */
> +		sheaf_flush_unused(s, empty);
> +		free_empty_sheaf(s, empty);
> +
>  		return NULL;
> +	}
> +
> +	full = empty;
> +	empty = NULL;

'empty = NULL' is meaningless since 'empty' is not used after here.

>  
>  	if (!local_trylock(&s->cpu_sheaves->lock))
>  		goto barn_put;
>  	pcs = this_cpu_ptr(s->cpu_sheaves);
>  
>  	/*
> -	 * If we are returning empty sheaf, we either got it from the
> -	 * barn or had to allocate one. If we are returning a full
> -	 * sheaf, it's due to racing or being migrated to a different
> -	 * cpu. Breaching the barn's sheaf limits should be thus rare
> -	 * enough so just ignore them to simplify the recovery.
> +	 * If we put any empty or full sheaf to the barn below, it's due to
> +	 * racing or being migrated to a different cpu. Breaching the barn's
> +	 * sheaf limits should be thus rare enough so just ignore them to
> +	 * simplify the recovery.
>  	 */
>  
>  	if (pcs->main->size == 0) {

LGTM.

Reviewed-by: Qing Wang <wangqing7171@gmail.com>

--
Cheers,
Qing


  reply	other threads:[~2026-03-12  3:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 18:22 [PATCH] slab: remove alloc_full_sheaf() Vlastimil Babka (SUSE)
2026-03-12  3:31 ` Qing Wang [this message]
2026-03-12  9:10   ` vbabka
2026-03-12  9:27     ` Qing Wang
2026-03-12  4:36 ` Harry Yoo
2026-03-12  4:51   ` Hao Li

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=20260312033105.593829-1-wangqing7171@gmail.com \
    --to=wangqing7171@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=hao.li@linux.dev \
    --cc=harry.yoo@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=vbabka@kernel.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