linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@kernel.org>
To: Keith Busch <kbusch@kernel.org>
Cc: Keith Busch <kbusch@meta.com>,
	linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, axboe@kernel.dk, dw@davidwei.uk,
	brauner@kernel.org, Chuck Lever <chuck.lever@oracle.com>,
	linux-nfs@vger.kernel.org
Subject: Re: [PATCH 7/7] iov_iter: remove iov_iter_is_aligned
Date: Mon, 4 Aug 2025 11:25:08 -0400	[thread overview]
Message-ID: <aJDQ1GPV5F5MB1kP@kernel.org> (raw)
In-Reply-To: <aJDAx1Ns9Fg7F6iK@kbusch-mbp>

On Mon, Aug 04, 2025 at 08:16:39AM -0600, Keith Busch wrote:
> On Fri, Aug 01, 2025 at 10:02:49PM -0400, Mike Snitzer wrote:
> > On Fri, Aug 01, 2025 at 04:47:36PM -0700, Keith Busch wrote:
> > > From: Keith Busch <kbusch@kernel.org>
> > > 
> > > No more callers.
> > > 
> > > Signed-off-by: Keith Busch <kbusch@kernel.org>
> > 
> > You had me up until this last patch.
> > 
> > I'm actually making use of iov_iter_is_aligned() in a series of
> > changes for both NFS and NFSD.  Chuck has included some of the
> > NFSD changes in his nfsd-testing branch, see:
> > https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/commit/?h=nfsd-testing&id=5d78ac1e674b45f9c9e3769b48efb27c44f4e4d3
> > 
> > And the balance of my work that is pending review/inclusion is:
> > https://lore.kernel.org/linux-nfs/20250731230633.89983-1-snitzer@kernel.org/
> > https://lore.kernel.org/linux-nfs/20250801171049.94235-1-snitzer@kernel.org/
> > 
> > I only need iov_iter_aligned_bvec, but recall I want to relax its
> > checking with this patch:
> > https://lore.kernel.org/linux-nfs/20250708160619.64800-5-snitzer@kernel.org/
> > 
> > Should I just add iov_iter_aligned_bvec() to fs/nfs_common/ so that
> > both NFS and NFSD can use it?
> 
> If at all possible, I recommend finding a place that already walks the
> vectors and do an opprotunistic check for the alignments there. This
> will save CPU cycles. For example, nfsd_iter_read already iterates the
> bvec while setting each page. Could you check the alignment while doing
> that instead of iterating a second time immediately after?

Nice goal, I'll see if I can pull it off.

I'm currently using iov_iter_is_aligned() in 3 new call sites (for
READ and WRITE) in both NFS and NFSD: nfs_local_iter_init,
nfsd_iter_read, nfsd_vfs_write

nfsd_vfs_write is the only one that doesn't iterate the bvec as-is,
but it does work that _should_ obviate the need to doable check the
alignment.

  reply	other threads:[~2025-08-04 15:25 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-01 23:47 [PATCH 0/7] direct-io: even more flexible io vectors Keith Busch
2025-08-01 23:47 ` [PATCH 1/7] block: check for valid bio while splitting Keith Busch
2025-08-04  6:54   ` Hannes Reinecke
2025-08-01 23:47 ` [PATCH 2/7] block: align the bio after building it Keith Busch
2025-08-04  6:54   ` Hannes Reinecke
2025-08-04 14:08     ` Keith Busch
2025-08-04 16:47       ` Keith Busch
2025-08-05  6:54       ` Hannes Reinecke
2025-08-01 23:47 ` [PATCH 3/7] block: simplify direct io validity check Keith Busch
2025-08-04  6:55   ` Hannes Reinecke
2025-08-04 17:11     ` Keith Busch
2025-08-05  6:57       ` Hannes Reinecke
2025-08-01 23:47 ` [PATCH 4/7] iomap: " Keith Busch
2025-08-04  6:57   ` Hannes Reinecke
2025-08-01 23:47 ` [PATCH 5/7] block: remove bdev_iter_is_aligned Keith Busch
2025-08-04  6:57   ` Hannes Reinecke
2025-08-01 23:47 ` [PATCH 6/7] blk-integrity: use simpler alignment check Keith Busch
2025-08-04  6:58   ` Hannes Reinecke
2025-08-01 23:47 ` [PATCH 7/7] iov_iter: remove iov_iter_is_aligned Keith Busch
2025-08-02  2:02   ` Mike Snitzer
2025-08-04 14:16     ` Keith Busch
2025-08-04 15:25       ` Mike Snitzer [this message]
2025-08-04 15:27         ` Mike Snitzer
2025-08-04 22:26         ` Mike Snitzer
2025-08-04 22:57           ` Keith Busch
2025-08-05  0:24   ` Mike Snitzer
2025-08-02 15:37 ` [PATCH 0/7] direct-io: even more flexible io vectors Jens Axboe
2025-08-04 17:06   ` Keith Busch
2025-08-04 23:45     ` Keith Busch

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=aJDQ1GPV5F5MB1kP@kernel.org \
    --to=snitzer@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=dw@davidwei.uk \
    --cc=kbusch@kernel.org \
    --cc=kbusch@meta.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).