public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Caleb Sander Mateos <csander@purestorage.com>,
	Keith Busch <kbusch@meta.com>,
	linux-block@vger.kernel.org, axboe@kernel.dk,
	ebiggers@kernel.org,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCHv6] blk-integrity: support arbitrary buffer alignment
Date: Tue, 25 Nov 2025 07:24:27 -0700	[thread overview]
Message-ID: <aSW8G5C--oIzmfJa@kbusch-mbp> (raw)
In-Reply-To: <20251125113144.GA22938@lst.de>

On Tue, Nov 25, 2025 at 12:31:44PM +0100, Christoph Hellwig wrote:
> On Mon, Nov 24, 2025 at 07:41:16PM -0800, Caleb Sander Mateos wrote:
> > > Compare kmap_local_page() with kmap_local_folio(). They both resolve to
> > > the same lower level mapping function, and folios have no problem
> > > spanning pages.
> > 
> > Documentation/mm/highmem.rst seems to suggest that kmap_local_folio()
> > only maps the page that contains the specified offset, not the whole
> > folio:
> 
> Yes.  Additionally multi-page bvecs aren't folios, they just are
> physically contiguous ranges.  So I don't think we could even use any
> folio helpers if they worked, as a single range might consist of multiple
> folios.
> 
> (Sorry for not spotting this earlier)

So the solution is to replace mp_bvec_iter_bvec() with bvec_iter_bvec()
to ensure we don't cross pages? It's a little less efficient, but that's
not a big deal.

I assumed mapping physically congiguous memory was contiguous in kernel
address space too, and that seems to work out in testing, but I don't
have CONFIG_HIGHMEM enable where that might matter.

  reply	other threads:[~2025-11-25 14:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-24 16:17 [PATCHv6] blk-integrity: support arbitrary buffer alignment Keith Busch
2025-11-24 16:31 ` Martin K. Petersen
2025-11-24 17:57   ` Keith Busch
2025-11-24 20:49     ` Martin K. Petersen
2025-11-24 16:58 ` Christoph Hellwig
2025-11-24 21:34 ` Caleb Sander Mateos
2025-11-24 22:56   ` Keith Busch
2025-11-25  3:41     ` Caleb Sander Mateos
2025-11-25 11:31       ` Christoph Hellwig
2025-11-25 14:24         ` Keith Busch [this message]
2025-11-25 16:46           ` Christoph Hellwig

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=aSW8G5C--oIzmfJa@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=csander@purestorage.com \
    --cc=ebiggers@kernel.org \
    --cc=hch@lst.de \
    --cc=kbusch@meta.com \
    --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