lkml.org 
[lkml]   [2017]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectlockdep && 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.

\
 
 \ /
  Last update: 2017-08-29 19:09    [W:0.171 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site