[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160630125919.GD30154@twins.programming.kicks-ass.net>
Date: Thu, 30 Jun 2016 14:59:19 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Byungchul Park <byungchul.park@....com>
Cc: mingo@...nel.org, linux-kernel@...r.kernel.org, npiggin@...e.de,
sergey.senozhatsky@...il.com, gregkh@...uxfoundation.org,
minchan@...nel.org
Subject: Re: [PATCH 1/5] lockdep: Implement bitlock map allocator
On Mon, Jun 20, 2016 at 01:55:11PM +0900, Byungchul Park wrote:
> +struct bitlock_map {
> + struct hlist_node hash_entry;
> + unsigned long bitaddr; /* ID */
> + struct lockdep_map map;
> + int ref; /* reference count */
> +};
So this is effectively bigger than just adding a struct lockdep_map into
whatever structure holds the bit spinlock to begin with.
What is the gain?
> +static inline unsigned long get_bitaddr(int bitnum, unsigned long *addr)
> +{
> + return (unsigned long)((char *)addr + bitnum);
> +}
And given you keep these lockdep_map thingies out-of-line, the original
structure remains dense and thus the above munging can easily result in
collisions.
Now, I suppose its rather unlikely, but given its entirely silent if it
happens, this is bad.
Powered by blists - more mailing lists