mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikulas Patocka <mpatocka@redhat.com>
To: Qianfeng Rong <rongqianfeng@vivo.com>
Cc: Alasdair Kergon <agk@redhat.com>,
	Mike Snitzer <snitzer@kernel.org>,
	 "open list:DEVICE-MAPPER  (LVM)" <dm-devel@lists.linux.dev>,
	 open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] dm bufio: remove redundant __GFP_NOWARN
Date: Mon, 11 Aug 2025 14:44:41 +0200 (CEST)	[thread overview]
Message-ID: <649a5bf8-309b-8128-b3f9-971d3a0bb350@redhat.com> (raw)
In-Reply-To: <20250811123638.550822-3-rongqianfeng@vivo.com>

Hi

I think that GFP_NOWAIT already includes __GFP_NORETRY too. So, should we 
drop __GFP_NORETRY as well?

Mikulas


On Mon, 11 Aug 2025, Qianfeng Rong wrote:

> GFP_NOWAIT already includes __GFP_NOWARN, so let's remove the redundant
> __GFP_NOWARN.  Also update comments to clarify the flag semantics.
> 
> Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
> ---
>  drivers/md/dm-bufio.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
> index ff7595caf440..4b20854e92f5 100644
> --- a/drivers/md/dm-bufio.c
> +++ b/drivers/md/dm-bufio.c
> @@ -1337,7 +1337,7 @@ static void use_bio(struct dm_buffer *b, enum req_op op, sector_t sector,
>  	char *ptr;
>  	unsigned int len;
>  
> -	bio = bio_kmalloc(1, GFP_NOWAIT | __GFP_NORETRY | __GFP_NOWARN);
> +	bio = bio_kmalloc(1, GFP_NOWAIT | __GFP_NORETRY);
>  	if (!bio) {
>  		use_dmio(b, op, sector, n_sectors, offset, ioprio);
>  		return;
> @@ -1601,18 +1601,18 @@ static struct dm_buffer *__alloc_buffer_wait_no_callback(struct dm_bufio_client
>  	 * dm-bufio is resistant to allocation failures (it just keeps
>  	 * one buffer reserved in cases all the allocations fail).
>  	 * So set flags to not try too hard:
> -	 *	GFP_NOWAIT: don't wait; if we need to sleep we'll release our
> -	 *		    mutex and wait ourselves.
> +	 *	GFP_NOWAIT: don't wait and don't print a warning in case of
> +	 *		    failure; if we need to sleep we'll release our mutex
> +	 *		    and wait ourselves.
>  	 *	__GFP_NORETRY: don't retry and rather return failure
>  	 *	__GFP_NOMEMALLOC: don't use emergency reserves
> -	 *	__GFP_NOWARN: don't print a warning in case of failure
>  	 *
>  	 * For debugging, if we set the cache size to 1, no new buffers will
>  	 * be allocated.
>  	 */
>  	while (1) {
>  		if (dm_bufio_cache_size_latch != 1) {
> -			b = alloc_buffer(c, GFP_NOWAIT | __GFP_NORETRY | __GFP_NOMEMALLOC | __GFP_NOWARN);
> +			b = alloc_buffer(c, GFP_NOWAIT | __GFP_NORETRY | __GFP_NOMEMALLOC);
>  			if (b)
>  				return b;
>  		}
> -- 
> 2.34.1
> 


  reply	other threads:[~2025-08-11 12:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-11 12:36 [PATCH 0/3] md: " Qianfeng Rong
2025-08-11 12:36 ` [PATCH 1/3] bcache: " Qianfeng Rong
2025-08-11 13:22   ` Coly Li
2025-08-11 13:46     ` Qianfeng Rong
2025-08-11 12:36 ` [PATCH 2/3] dm bufio: " Qianfeng Rong
2025-08-11 12:44   ` Mikulas Patocka [this message]
2025-08-11 12:58     ` Qianfeng Rong
2025-08-11 15:10       ` Mikulas Patocka
2025-08-12  2:18         ` Qianfeng Rong
2025-08-11 12:36 ` [PATCH 3/3] md/raid5: " Qianfeng Rong

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=649a5bf8-309b-8128-b3f9-971d3a0bb350@redhat.com \
    --to=mpatocka@redhat.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rongqianfeng@vivo.com \
    --cc=snitzer@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

all inboxes | Powered by JetHome®