[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170116151319.GE3144@twins.programming.kicks-ass.net>
Date: Mon, 16 Jan 2017 16:13:19 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Byungchul Park <byungchul.park@....com>
Cc: mingo@...nel.org, tglx@...utronix.de, walken@...gle.com,
boqun.feng@...il.com, kirill@...temov.name,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
iamjoonsoo.kim@....com, akpm@...ux-foundation.org,
npiggin@...il.com
Subject: Re: [PATCH v4 07/15] lockdep: Implement crossrelease feature
On Fri, Dec 09, 2016 at 02:12:03PM +0900, Byungchul Park wrote:
> + /*
> + * We assign class_idx here redundantly even though following
> + * memcpy will cover it, in order to ensure a rcu reader can
> + * access the class_idx atomically without lock.
> + *
> + * Here we assume setting a word-sized variable is atomic.
which one, where?
> + */
> + xlock->hlock.class_idx = hlock->class_idx;
> + gen_id = (unsigned int)atomic_inc_return(&cross_gen_id);
> + WRITE_ONCE(xlock->gen_id, gen_id);
> + memcpy(&xlock->hlock, hlock, sizeof(struct held_lock));
> + INIT_LIST_HEAD(&xlock->xlock_entry);
> + list_add_tail_rcu(&xlock->xlock_entry, &xlocks_head);
Powered by blists - more mailing lists