All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: akpm@linux-foundation.org, 21cnbao@gmail.com,
	herbert@gondor.apana.org.au, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lib/rhashtable: cleanup fallback check in bucket_table_alloc()
Date: Fri, 9 Aug 2024 09:56:59 +0200	[thread overview]
Message-ID: <ZrXLy6-EpFJdro8b@tiehlicka> (raw)
In-Reply-To: <20240806153927.184515-1-dave@stgolabs.net>

On Tue 06-08-24 08:39:27, Davidlohr Bueso wrote:
> Upon allocation failure, the current check with the nofail bits
> is unnecessary, and further stands in the way of discouraging
> direct use of __GFP_NOFAIL. Remove this and replace with the
> proper way of determining if doing a non-blocking allocation
> for the nested table case.
> 
> Suggested-by: Michal Hocko <mhocko@suse.com>
> Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>

Thanks. This is not really something I feel qualified to ack but the
change looks good to me.

> ---
>  lib/rhashtable.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/rhashtable.c b/lib/rhashtable.c
> index dbbed19f8fff..6c902639728b 100644
> --- a/lib/rhashtable.c
> +++ b/lib/rhashtable.c
> @@ -189,7 +189,7 @@ static struct bucket_table *bucket_table_alloc(struct rhashtable *ht,
>  
>  	size = nbuckets;
>  
> -	if (tbl == NULL && (gfp & ~__GFP_NOFAIL) != GFP_KERNEL) {
> +	if (tbl == NULL && !gfpflags_allow_blocking(gfp)) {
>  		tbl = nested_bucket_table_alloc(ht, nbuckets, gfp);
>  		nbuckets = 0;
>  	}
> -- 
> 2.45.2

-- 
Michal Hocko
SUSE Labs

      reply	other threads:[~2024-08-09  7:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-06 15:39 [PATCH] lib/rhashtable: cleanup fallback check in bucket_table_alloc() Davidlohr Bueso
2024-08-09  7:56 ` 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=ZrXLy6-EpFJdro8b@tiehlicka \
    --to=mhocko@suse.com \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.