linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* -Walign-mismatch in block/blk-mq.c
@ 2021-03-10 18:23 Nathan Chancellor
  2021-03-10 20:21 ` Jens Axboe
  0 siblings, 1 reply; 8+ messages in thread
From: Nathan Chancellor @ 2021-03-10 18:23 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block, linux-kernel, clang-built-linux

Hi Jens,

There is a new clang warning added in the development branch,
-Walign-mismatch, which shows an instance in block/blk-mq.c:

block/blk-mq.c:630:39: warning: passing 8-byte aligned argument to
32-byte aligned parameter 2 of 'smp_call_function_single_async' may
result in an unaligned pointer access [-Walign-mismatch]
                smp_call_function_single_async(cpu, &rq->csd);
                                                    ^
1 warning generated.

There appears to be some history here as I can see that this member was
purposefully unaligned in commit 4ccafe032005 ("block: unalign
call_single_data in struct request"). However, I later see a change in
commit 7c3fb70f0341 ("block: rearrange a few request fields for better
cache layout") that seems somewhat related. Is it possible to get back
the alignment by rearranging the structure again? This seems to be the
only solution for the warning aside from just outright disabling it,
which would be a shame since it seems like it could be useful for
architectures that cannot handle unaligned accesses well, unless I am
missing something obvious :)

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-03-11 13:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 18:23 -Walign-mismatch in block/blk-mq.c Nathan Chancellor
2021-03-10 20:21 ` Jens Axboe
2021-03-10 20:33   ` Nathan Chancellor
2021-03-10 20:40     ` Jens Axboe
2021-03-10 20:52       ` Nathan Chancellor
2021-03-10 21:03         ` Jens Axboe
2021-03-10 22:52           ` Nathan Chancellor
2021-03-11 13:42       ` David Laight

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).