[lkml]   [2019]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 01/32] locking/lockdep: Use expanded masks on find_usage_*() functions
On Tue, Feb 12, 2019 at 9:14 AM Frederic Weisbecker <> 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.


 \ /
  Last update: 2019-02-12 18:37    [W:0.127 / U:5.280 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site