From: Dave Chinner <david@fromorbit.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: Build regressions/improvements in v5.18-rc1
Date: Wed, 6 Apr 2022 07:05:13 +1000 [thread overview]
Message-ID: <20220405210513.GX1544202@dread.disaster.area> (raw)
In-Reply-To: <CAK8P3a1JArChbzRDFU0YPCy-7QZgqSoHe8JTH4g0yOz_Mi_MEA@mail.gmail.com>
On Tue, Apr 05, 2022 at 09:08:13AM +0200, Arnd Bergmann wrote:
> ?On Tue, Apr 5, 2022 at 8:47 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > On Tue, Apr 5, 2022 at 12:16 AM Dave Chinner <david@fromorbit.com> wrote:
> > > So XFS only uses these flags in unsigned int fields that are
> > > typed via:
> > >
> > > typedef unsigned int xfs_buf_flags_t;
> > >
> > > So on the surface, declaring the flag values as ULONG and then writing
> > > them into a UINT field is not a nice thing to be doing.
> > >
> > > I really don't want to change the xfs_buf_flags_t type to an
> > > unsigned long, because that changes the packing of the first
> > > cacheline of the struct xfs_buf and the contents of that cacheline
> > > are performance critical for the lookup fastpath....
> >
> > Hence just use "1u << n" instead of "1ul << n"?
>
> Right, that avoids the error as well. I picked '1ul' to match the type of
> the variable it's assigned to, but as Dave said the intended type is
> 'u32', so '1u' is better here.
Ok, I'll queue up a patch to make this modification. I'll also need
to check all the other trace flags fields we print as well, as they
likely have the same issue but there's no warnings from them because
they don't use the high bit in the 32 bit field yet...
> > > Looking at __print_flags, the internal array type declaration is:
> > >
> > > struct trace_print_flags {
> > > unsigned long mask;
> > > const char *name;
> > > };
> > >
> > > and that's the source of the problem. I notice __print_flags_u64()
> > > exists, but __print_flags_u32() does not. Should it?
>
> It's not the source of the error, as there is no signed integer
> overflow when assigning an unsigned int to an unsigned long.
Thanks for the clarification!
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2022-04-06 2:27 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-03 22:14 Linux 5.18-rc1 Linus Torvalds
2022-04-04 2:22 ` Guenter Roeck
2022-04-04 3:29 ` Linus Torvalds
2022-04-04 4:23 ` Guenter Roeck
2022-04-04 7:30 ` Ron Economos
2022-04-04 15:32 ` Linus Torvalds
2022-04-04 16:21 ` Greg Kroah-Hartman
2022-04-04 16:45 ` Guenter Roeck
2022-04-04 17:09 ` Linus Torvalds
2022-04-05 21:14 ` Konstantin Ryabitsev
2022-04-04 6:01 ` Jiri Slaby
2022-04-05 12:19 ` Sudip Mukherjee
2022-04-05 13:18 ` Guenter Roeck
2022-04-04 7:47 ` Build regressions/improvements in v5.18-rc1 Geert Uytterhoeven
2022-04-04 8:16 ` Geert Uytterhoeven
2022-04-04 9:26 ` Dave Chinner
2022-04-04 10:19 ` Geert Uytterhoeven
2022-04-04 11:45 ` Arnd Bergmann
2022-04-04 12:31 ` Arnd Bergmann
2022-04-04 22:16 ` Dave Chinner
2022-04-05 6:47 ` Geert Uytterhoeven
2022-04-05 7:08 ` Arnd Bergmann
2022-04-05 21:05 ` Dave Chinner [this message]
2022-04-04 18:39 ` Kalle Valo
2022-04-05 6:46 ` Geert Uytterhoeven
2022-04-05 6:52 ` Kalle Valo
2022-04-05 6:45 ` Helge Deller
2022-04-05 6:49 ` Geert Uytterhoeven
2022-04-28 7:25 ` Michael Ellerman
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=20220405210513.GX1544202@dread.disaster.area \
--to=david@fromorbit.com \
--cc=arnd@arndb.de \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@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