[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wjYBy=TBCLwoh4v_7nf4kqLrt1h6D4CsVM7Ws2e06Efcg@mail.gmail.com>
Date: Tue, 12 Feb 2019 09:35:34 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Frederic Weisbecker <frederic@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Mauro Carvalho Chehab <mchehab@...pensource.com>,
"David S . Miller" <davem@...emloft.net>,
Thomas Gleixner <tglx@...utronix.de>,
"Paul E . McKenney" <paulmck@...ux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Pavan Kondeti <pkondeti@...eaurora.org>,
Ingo Molnar <mingo@...nel.org>,
Joel Fernandes <joel@...lfernandes.org>
Subject: Re: [PATCH 01/32] locking/lockdep: Use expanded masks on
find_usage_*() functions
On Tue, Feb 12, 2019 at 9:14 AM Frederic Weisbecker <frederic@...nel.org> wrote:
>
> In order to perform softirq vector-finegrained locking validation we'll
> need to be able to check multiple vector usages at once. Prepare the low
> level usage mask check functions for that purpose.
Why is this using "u64 mask"?
That's not only fairly expensive on 32-bit targets, it wasn't what the
code did before:
> -static inline int usage_match(struct lock_list *entry, void *bit)
> +static inline int usage_match(struct lock_list *entry, void *mask)
> {
> - return entry->class->usage_mask & (1 << (enum lock_usage_bit)bit);
> + return entry->class->usage_mask & *(u64 *)mask;
Note how that was an "int" mask value before, and "usage_mask" itself
is just "unsigned long".
So where does that "u64" come from?
If there is some reason you really want to use a 64-bit value (some
future change?), it should be documented.
Linus
Powered by blists - more mailing lists