X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=kernel%2Ffutex.c;h=684d7549825a4300ced2002a3fbec0a5698a18d1;hb=e880e87488d5bbf630dd716e6de8a53585614568;hp=395b967841b4af2870b63892b97b920fac2eb015;hpb=c23fe83138ed7b11ad763cbe8bf98e5378c04bd6;p=firefly-linux-kernel-4.4.55.git diff --git a/kernel/futex.c b/kernel/futex.c index 395b967841b4..684d7549825a 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -255,9 +255,18 @@ struct futex_hash_bucket { struct plist_head chain; } ____cacheline_aligned_in_smp; -static unsigned long __read_mostly futex_hashsize; +/* + * The base of the bucket array and its size are always used together + * (after initialization only in hash_futex()), so ensure that they + * reside in the same cacheline. + */ +static struct { + struct futex_hash_bucket *queues; + unsigned long hashsize; +} __futex_data __read_mostly __aligned(2*sizeof(long)); +#define futex_queues (__futex_data.queues) +#define futex_hashsize (__futex_data.hashsize) -static struct futex_hash_bucket *futex_queues; /* * Fault injections for futexes.