[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170829170757.GA21241@redhat.com>
Date: Tue, 29 Aug 2017 19:07:57 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Byungchul Park <byungchul.park@....com>, mingo@...nel.org,
linux-kernel@...r.kernel.org, kernel-team@....com,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Dave Chinner <david@...morbit.com>, Tejun Heo <tj@...nel.org>,
johannes@...solutions.net
Subject: lockdep && recursive-read
On 08/29, Oleg Nesterov wrote:
>
> Plus process_one_work() does lock_map_acquire_read(), I don't really
> understand this too.
and in fact I don't understand lock_map_acquire_read() itself. I mean, read == 2
and this code in check_prevs_add()
/*
* Only non-recursive-read entries get new dependencies
* added:
*/
if (hlock->read != 2 && hlock->check) {
if (!check_prev_add(curr, hlock, next,
distance, &stack_saved))
Well, I forgot everything I ever knew about lockdep, unlikely I understand what
the code above actually does. But I verified that this code
static DEFINE_SPINLOCK(exlk);
static DEFINE_RWLOCK(rwlk);
spin_lock(&exlk);
write_lock(&rwlk);
write_unlock(&rwlk);
spin_unlock(&exlk);
read_lock(&rwlk);
spin_lock(&exlk);
spin_unlock(&exlk);
read_unlock(&rwlk);
runs without any warning from lockdep. Doesn't look right or I am totally
confused...
Oleg.
Powered by blists - more mailing lists