public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: hch <hch@lst.de>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: hch <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: [PATCH 2/2] block: make bio auto-integrity deadlock safe
Date: Mon, 3 Nov 2025 14:45:33 +0100	[thread overview]
Message-ID: <20251103134533.GA23818@lst.de> (raw)
In-Reply-To: <bd4e2d68-bece-442a-8a00-4fe2d5e14645@wdc.com>

On Mon, Nov 03, 2025 at 01:40:10PM +0000, Johannes Thumshirn wrote:
> On 11/3/25 11:18 AM, Christoph Hellwig wrote:
> > +void bio_integrity_alloc_buf(struct bio *bio, bool zero_buffer)
> > +{
> > +	struct blk_integrity *bi = blk_get_integrity(bio->bi_bdev->bd_disk);
> > +	struct bio_integrity_payload *bip = bio_integrity(bio);
> > +	unsigned int len = bio_integrity_bytes(bi, bio_sectors(bio));
> > +	gfp_t gfp = GFP_NOIO | (zero_buffer ? __GFP_ZERO : 0);
> > +	void *buf;
> > +
> > +	buf = kmalloc(len, (gfp & ~__GFP_DIRECT_RECLAIM) |
> > +			__GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN);
> 
> 
> Why can't we clear the flags when assigning gfp, or at least outside of 
> kmalloc()s parameter list?

We could, but what's the point?

> > +++ b/include/linux/bio-integrity.h
> > @@ -14,6 +14,8 @@ enum bip_flags {
> >   	BIP_CHECK_REFTAG	= 1 << 6, /* reftag check */
> >   	BIP_CHECK_APPTAG	= 1 << 7, /* apptag check */
> >   	BIP_P2P_DMA		= 1 << 8, /* using P2P address */
> > +
> > +	BIP_MEMPOOL		= 1 << 15, /* buffer backed by mempool */
> >   };
> >   
> 
> Any specific reason for the hole?

Because it's really just an internal flag.  (So is BIP_P2P_DMA, but
that should go away this merge window).


  reply	other threads:[~2025-11-03 13:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-03 10:16 make block layer auto-PI deadlock safe v3 Christoph Hellwig
2025-11-03 10:16 ` [PATCH 1/2] block: blocking mempool_alloc doesn't fail Christoph Hellwig
2025-11-03 11:16   ` Kanchan Joshi
2025-11-03 11:26   ` John Garry
2025-11-03 11:52     ` Christoph Hellwig
2025-11-03 13:20   ` Anuj gupta
2025-11-03 13:28   ` Johannes Thumshirn
2025-11-03 10:16 ` [PATCH 2/2] block: make bio auto-integrity deadlock safe Christoph Hellwig
2025-11-03 11:15   ` Kanchan Joshi
2025-11-03 13:20   ` Anuj gupta
2025-11-03 13:40   ` Johannes Thumshirn
2025-11-03 13:45     ` hch [this message]
2025-11-03 13:47       ` Johannes Thumshirn
2025-11-03 13:49         ` hch
2025-11-04 19:47 ` make block layer auto-PI deadlock safe v3 Jens Axboe
2025-11-05 13:23   ` Christoph Hellwig
2025-11-05 15:03     ` Jens Axboe
2025-11-05 19:46       ` Christoph Hellwig
2025-11-05 19:48         ` Jens Axboe
2025-11-05 15:06 ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2025-10-30 14:44 make block layer auto-PI deadlock safe v2 Christoph Hellwig
2025-10-30 14:44 ` [PATCH 2/2] block: make bio auto-integrity deadlock safe Christoph Hellwig
2025-11-03  3:24   ` Martin K. Petersen

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=20251103134533.GA23818@lst.de \
    --to=hch@lst.de \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=martin.petersen@oracle.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