From: David Laight <David.Laight@ACULAB.COM>
To: 'David Howells' <dhowells@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>, Jens Axboe <axboe@kernel.dk>,
"Christoph Hellwig" <hch@list.de>,
Christian Brauner <christian@brauner.io>,
"Matthew Wilcox" <willy@infradead.org>,
Jeff Layton <jlayton@kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v3 2/2] iov_iter: Don't deal with iter->copy_mc in memcpy_from_iter_mc()
Date: Fri, 18 Aug 2023 12:16:23 +0000 [thread overview]
Message-ID: <b9c32d9669174dbbbb8e944146814a98@AcuMS.aculab.com> (raw)
In-Reply-To: <1748360.1692358952@warthog.procyon.org.uk>
From: David Howells
> Sent: Friday, August 18, 2023 12:43 PM
>
> Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> > Well, that part is trivially fixable, and we should do that anyway for
> > other reasons.
> > ..
> > enum iter_type {
> > /* iter types */
> > - ITER_IOVEC,
> > - ITER_KVEC,
> > - ITER_BVEC,
> > - ITER_XARRAY,
> > - ITER_DISCARD,
> > - ITER_UBUF,
> > + ITER_IOVEC = 1,
> > + ITER_UBUF = 2,
> > + ITER_KVEC = 4,
> > + ITER_BVEC = 8,
> > + ITER_XARRAY = 16,
> > + ITER_DISCARD = 32,
That could be zero - no bits and default.
> > };
>
> It used to be this way, but Al switched it:
>
> 8cd54c1c848031a87820e58d772166ffdf8c08c0
> iov_iter: separate direction from flavour
Except it also had the direction flag inside the enum.
That caused its own piles of grief.
IIRC Linus had type:6 - that doesn't leave any headroom
for additional types (even though they shouldn't proliferate).
It may be best to avoid bits 15+ (in a bitfield) due to
issues with large constants and sign extension.
On x86 (I think) 'and immediate' and 'bit test' are the same
size for bit 0 to 7, BIT wins for higher bits.
gcc generates strange code for some initialisers (see yesterday's
thread) and you definitely mustn't leave unused bits in a bitfield.
Might be better is the fields are assigned later!
(I also saw clang carefully preserving %eax on stabck!)
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2023-08-18 12:16 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 12:07 [PATCH v3 0/2] iov_iter: Convert the iterator macros into inline funcs David Howells
2023-08-16 12:07 ` [PATCH v3 1/2] iov_iter: Convert iterate*() to " David Howells
2023-08-16 12:07 ` [PATCH v3 2/2] iov_iter: Don't deal with iter->copy_mc in memcpy_from_iter_mc() David Howells
2023-08-16 12:28 ` David Laight
2023-08-16 13:00 ` David Howells
2023-08-16 14:19 ` David Laight
2023-08-16 18:50 ` Linus Torvalds
2023-08-16 20:35 ` David Howells
2023-08-17 4:18 ` Linus Torvalds
2023-08-17 8:41 ` David Laight
2023-08-17 14:38 ` Linus Torvalds
2023-08-17 15:16 ` David Laight
2023-08-17 15:31 ` Linus Torvalds
2023-08-17 16:06 ` David Laight
2023-08-18 15:19 ` David Howells
2023-08-18 15:42 ` David Laight
2023-08-18 16:48 ` David Howells
2023-08-18 21:39 ` David Laight
2023-08-18 11:42 ` David Howells
2023-08-18 12:16 ` David Laight [this message]
2023-08-18 12:26 ` Matthew Wilcox
2023-08-18 12:41 ` David Laight
2023-08-18 13:33 ` David Howells
2023-08-18 11:39 ` David Howells
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=b9c32d9669174dbbbb8e944146814a98@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=axboe@kernel.dk \
--cc=christian@brauner.io \
--cc=dhowells@redhat.com \
--cc=hch@list.de \
--cc=jlayton@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.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