[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d8500b7f585d41628b9c53a9848d9875@AcuMS.aculab.com>
Date: Thu, 17 Aug 2023 16:06:35 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Linus Torvalds' <torvalds@...ux-foundation.org>
CC: David Howells <dhowells@...hat.com>,
Al Viro <viro@...iv.linux.org.uk>,
Jens Axboe <axboe@...nel.dk>,
Christian Brauner <christian@...uner.io>,
Matthew Wilcox <willy@...radead.org>,
Jeff Layton <jlayton@...nel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v3 2/2] iov_iter: Don't deal with iter->copy_mc in
memcpy_from_iter_mc()
From: Linus Torvalds
> Sent: Thursday, August 17, 2023 4:31 PM
...
> movzwl .LC1(%rip), %eax
> testl %esi, %esi
> movb $0, (%rdi)
> movb $1, 4(%rdi)
> movw %ax, 1(%rdi)
> movq $0, 8(%rdi)
> movq %rdx, 16(%rdi)
> movq %r8, 24(%rdi)
> movq %rcx, 32(%rdi)
> setne 3(%rdi)
>
> which is that disgusting "move two bytes from memory", and makes
> absolutely no sense as a way to "write 2 zero bytes":
>
> .LC1:
> .byte 0
> .byte 0
>
> I think that's some odd gcc bug, actually.
I get that with some code, but not others.
Seems to depend on random other stuff.
Happens for:
struct { unsigned char x:7, y:1; };
but not if I add anything after if (that gets zeroed).
Which seems to be the opposite of what you see.
If I use explicit assignments (rather than an initialiser)
I still get merged writes (even if not a bitfield) but also
lose the memory access.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists