* Re: [PATCH net-next v3 10/18] nvme/host: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage
[not found] ` <58466.1688074499@warthog.procyon.org.uk>
@ 2023-06-29 23:43 ` Jakub Kicinski
2023-06-30 16:10 ` Nathan Chancellor
0 siblings, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2023-06-29 23:43 UTC (permalink / raw)
To: David Howells
Cc: Aurelien Aptel, netdev, Alexander Duyck, David S. Miller,
Eric Dumazet, Paolo Abeni, Willem de Bruijn, David Ahern,
Matthew Wilcox, Jens Axboe, linux-mm, linux-kernel, Sagi Grimberg,
Willem de Bruijn, Keith Busch, Jens Axboe, Christoph Hellwig,
Chaitanya Kulkarni, linux-nvme, llvm
On Thu, 29 Jun 2023 22:34:59 +0100 David Howells wrote:
> if (!sendpage_ok(page))
> - msg.msg_flags &= ~MSG_SPLICE_PAGES,
> + msg.msg_flags &= ~MSG_SPLICE_PAGES;
😵️
Let me CC llvm@ in case someone's there is willing to make
the compiler warn about this.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v3 10/18] nvme/host: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage
2023-06-29 23:43 ` [PATCH net-next v3 10/18] nvme/host: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage Jakub Kicinski
@ 2023-06-30 16:10 ` Nathan Chancellor
2023-06-30 16:14 ` Jakub Kicinski
0 siblings, 1 reply; 5+ messages in thread
From: Nathan Chancellor @ 2023-06-30 16:10 UTC (permalink / raw)
To: Jakub Kicinski
Cc: David Howells, Aurelien Aptel, netdev, Alexander Duyck,
David S. Miller, Eric Dumazet, Paolo Abeni, Willem de Bruijn,
David Ahern, Matthew Wilcox, Jens Axboe, linux-mm, linux-kernel,
Sagi Grimberg, Willem de Bruijn, Keith Busch, Jens Axboe,
Christoph Hellwig, Chaitanya Kulkarni, linux-nvme, llvm
On Thu, Jun 29, 2023 at 04:43:18PM -0700, Jakub Kicinski wrote:
> On Thu, 29 Jun 2023 22:34:59 +0100 David Howells wrote:
> > if (!sendpage_ok(page))
> > - msg.msg_flags &= ~MSG_SPLICE_PAGES,
> > + msg.msg_flags &= ~MSG_SPLICE_PAGES;
>
> 😵️
>
> Let me CC llvm@ in case someone's there is willing to make
> the compiler warn about this.
>
Turns out clang already has a warning for this, -Wcomma:
drivers/nvme/host/tcp.c:1017:38: error: possible misuse of comma operator here [-Werror,-Wcomma]
1017 | msg.msg_flags &= ~MSG_SPLICE_PAGES,
| ^
drivers/nvme/host/tcp.c:1017:4: note: cast expression to void to silence warning
1017 | msg.msg_flags &= ~MSG_SPLICE_PAGES,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| (void)( )
1 error generated.
Let me do some wider build testing to see if it is viable to turn this
on for the whole kernel because it seems worth it, at least in this
case. There are a lot of cases where a warning won't be emitted (see the
original upstream review for a list: https://reviews.llvm.org/D3976) but
something is better than nothing, right? :)
Cheers,
Nathan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v3 10/18] nvme/host: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage
2023-06-30 16:10 ` Nathan Chancellor
@ 2023-06-30 16:14 ` Jakub Kicinski
2023-06-30 19:28 ` Nathan Chancellor
0 siblings, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2023-06-30 16:14 UTC (permalink / raw)
To: Nathan Chancellor
Cc: David Howells, Aurelien Aptel, netdev, Alexander Duyck,
David S. Miller, Eric Dumazet, Paolo Abeni, Willem de Bruijn,
David Ahern, Matthew Wilcox, Jens Axboe, linux-mm, linux-kernel,
Sagi Grimberg, Willem de Bruijn, Keith Busch, Jens Axboe,
Christoph Hellwig, Chaitanya Kulkarni, linux-nvme, llvm
On Fri, 30 Jun 2023 09:10:43 -0700 Nathan Chancellor wrote:
> > Let me CC llvm@ in case someone's there is willing to make
> > the compiler warn about this.
>
> Turns out clang already has a warning for this, -Wcomma:
>
> drivers/nvme/host/tcp.c:1017:38: error: possible misuse of comma operator here [-Werror,-Wcomma]
> 1017 | msg.msg_flags &= ~MSG_SPLICE_PAGES,
> | ^
> drivers/nvme/host/tcp.c:1017:4: note: cast expression to void to silence warning
> 1017 | msg.msg_flags &= ~MSG_SPLICE_PAGES,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> | (void)( )
> 1 error generated.
>
> Let me do some wider build testing to see if it is viable to turn this
> on for the whole kernel because it seems worth it, at least in this
> case. There are a lot of cases where a warning won't be emitted (see the
> original upstream review for a list: https://reviews.llvm.org/D3976) but
> something is better than nothing, right? :)
Ah, neat. Misleading indentation is another possible angle, I reckon,
but not sure if that's enabled/possible to enable for the entire kernel
either :( We test-build with W=1 in networking, FWIW, so W=1 would be
enough for us.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v3 10/18] nvme/host: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage
2023-06-30 16:14 ` Jakub Kicinski
@ 2023-06-30 19:28 ` Nathan Chancellor
2023-07-07 20:45 ` Nick Desaulniers
0 siblings, 1 reply; 5+ messages in thread
From: Nathan Chancellor @ 2023-06-30 19:28 UTC (permalink / raw)
To: Jakub Kicinski
Cc: David Howells, Aurelien Aptel, netdev, Alexander Duyck,
David S. Miller, Eric Dumazet, Paolo Abeni, Willem de Bruijn,
David Ahern, Matthew Wilcox, Jens Axboe, linux-mm, linux-kernel,
Sagi Grimberg, Willem de Bruijn, Keith Busch, Jens Axboe,
Christoph Hellwig, Chaitanya Kulkarni, linux-nvme, llvm
On Fri, Jun 30, 2023 at 09:14:42AM -0700, Jakub Kicinski wrote:
> On Fri, 30 Jun 2023 09:10:43 -0700 Nathan Chancellor wrote:
> > > Let me CC llvm@ in case someone's there is willing to make
> > > the compiler warn about this.
> >
> > Turns out clang already has a warning for this, -Wcomma:
> >
> > drivers/nvme/host/tcp.c:1017:38: error: possible misuse of comma operator here [-Werror,-Wcomma]
> > 1017 | msg.msg_flags &= ~MSG_SPLICE_PAGES,
> > | ^
> > drivers/nvme/host/tcp.c:1017:4: note: cast expression to void to silence warning
> > 1017 | msg.msg_flags &= ~MSG_SPLICE_PAGES,
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > | (void)( )
> > 1 error generated.
> >
> > Let me do some wider build testing to see if it is viable to turn this
> > on for the whole kernel because it seems worth it, at least in this
> > case. There are a lot of cases where a warning won't be emitted (see the
> > original upstream review for a list: https://reviews.llvm.org/D3976) but
> > something is better than nothing, right? :)
Well, that was a pipe dream :/ In ARCH=arm multi_v7_defconfig alone,
there are 289 unique instances of the warning (although a good number
have multiple instances per line, so it is not quite as bad as it seems,
but still bad):
$ rg -- -Wcomma arm-multi_v7_defconfig.log | sort | uniq -c | wc -l
289
https://gist.github.com/nathanchance/907867e0a7adffc877fd39fd08853801
Probably not a good sign of the signal to noise ratio, I looked through
a good handful and all the cases I saw were not interesting... Perhaps
the warning could be tuned further to become useful for the kernel but
in its current form, it is definitely a no-go :/
> Ah, neat. Misleading indentation is another possible angle, I reckon,
> but not sure if that's enabled/possible to enable for the entire kernel
Yeah, I was surprised there was no warning for misleading indentation...
it is a part of -Wall for both clang and GCC, so it is on for the
kernel, it just appears not to trigger in this case.
> either :( We test-build with W=1 in networking, FWIW, so W=1 would be
> enough for us.
Unfortunately, even in its current form, it is way too noisy for W=1, as
the qualifier for W=1 is "do not occur too often". Probably could be
placed under W=2 but it still has the problem of wading through every
instance and it is basically a no-op because nobody tests with W=2.
Cheers,
Nathan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v3 10/18] nvme/host: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage
2023-06-30 19:28 ` Nathan Chancellor
@ 2023-07-07 20:45 ` Nick Desaulniers
0 siblings, 0 replies; 5+ messages in thread
From: Nick Desaulniers @ 2023-07-07 20:45 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Jakub Kicinski, David Howells, Aurelien Aptel, netdev,
Alexander Duyck, David S. Miller, Eric Dumazet, Paolo Abeni,
Willem de Bruijn, David Ahern, Matthew Wilcox, Jens Axboe,
linux-mm, linux-kernel, Sagi Grimberg, Willem de Bruijn,
Keith Busch, Jens Axboe, Christoph Hellwig, Chaitanya Kulkarni,
linux-nvme, llvm
On Fri, Jun 30, 2023 at 12:28 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> On Fri, Jun 30, 2023 at 09:14:42AM -0700, Jakub Kicinski wrote:
> > On Fri, 30 Jun 2023 09:10:43 -0700 Nathan Chancellor wrote:
> > > > Let me CC llvm@ in case someone's there is willing to make
> > > > the compiler warn about this.
> > >
> > > Turns out clang already has a warning for this, -Wcomma:
> > >
> > > drivers/nvme/host/tcp.c:1017:38: error: possible misuse of comma operator here [-Werror,-Wcomma]
> > > 1017 | msg.msg_flags &= ~MSG_SPLICE_PAGES,
> > > | ^
> > > drivers/nvme/host/tcp.c:1017:4: note: cast expression to void to silence warning
> > > 1017 | msg.msg_flags &= ~MSG_SPLICE_PAGES,
> > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > | (void)( )
> > > 1 error generated.
> > >
> > > Let me do some wider build testing to see if it is viable to turn this
> > > on for the whole kernel because it seems worth it, at least in this
> > > case. There are a lot of cases where a warning won't be emitted (see the
> > > original upstream review for a list: https://reviews.llvm.org/D3976) but
> > > something is better than nothing, right? :)
>
> Well, that was a pipe dream :/ In ARCH=arm multi_v7_defconfig alone,
> there are 289 unique instances of the warning (although a good number
> have multiple instances per line, so it is not quite as bad as it seems,
> but still bad):
>
> $ rg -- -Wcomma arm-multi_v7_defconfig.log | sort | uniq -c | wc -l
> 289
>
> https://gist.github.com/nathanchance/907867e0a7adffc877fd39fd08853801
It's definitely interesting to take a look at some of these cases.
Some are pretty funny IMO.
>
> Probably not a good sign of the signal to noise ratio, I looked through
> a good handful and all the cases I saw were not interesting... Perhaps
> the warning could be tuned further to become useful for the kernel but
> in its current form, it is definitely a no-go :/
>
> > Ah, neat. Misleading indentation is another possible angle, I reckon,
> > but not sure if that's enabled/possible to enable for the entire kernel
>
> Yeah, I was surprised there was no warning for misleading indentation...
> it is a part of -Wall for both clang and GCC, so it is on for the
> kernel, it just appears not to trigger in this case.
>
> > either :( We test-build with W=1 in networking, FWIW, so W=1 would be
> > enough for us.
>
> Unfortunately, even in its current form, it is way too noisy for W=1, as
> the qualifier for W=1 is "do not occur too often". Probably could be
> placed under W=2 but it still has the problem of wading through every
> instance and it is basically a no-op because nobody tests with W=2.
>
> Cheers,
> Nathan
>
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-07-07 20:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <253mt0il43o.fsf@mtr-vdi-124.i-did-not-set--mail-host-address--so-tickle-me>
[not found] ` <20230620145338.1300897-1-dhowells@redhat.com>
[not found] ` <20230620145338.1300897-11-dhowells@redhat.com>
[not found] ` <58466.1688074499@warthog.procyon.org.uk>
2023-06-29 23:43 ` [PATCH net-next v3 10/18] nvme/host: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage Jakub Kicinski
2023-06-30 16:10 ` Nathan Chancellor
2023-06-30 16:14 ` Jakub Kicinski
2023-06-30 19:28 ` Nathan Chancellor
2023-07-07 20:45 ` Nick Desaulniers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox