[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <46161D84.9030706@sw.ru>
Date: Fri, 06 Apr 2007 14:14:28 +0400
From: Pavel Emelianov <xemul@...ru>
To: Ingo Molnar <mingo@...hat.com>,
Arjan van de Ven <arjan@...ux.intel.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [RFC] Lockdep VS rw-semaphores strangeness
Hello Ingo, Arjan.
I'm playing with lockdep and have a question about rw-sems.
down_read_trylock() looks like
int down_read_trylock(struct rw_semaphore *sem)
{
int ret = __down_read_trylock(sem);
if (ret == 1)
rwsem_acquire_read(&sem->dep_map, 0, 1, _RET_IP_);
return ret;
}
i.e. it calls rwsem_acquire_read() with trylock == 1.
But down_write_trylock() -
int down_write_trylock(struct rw_semaphore *sem)
{
int ret = __down_write_trylock(sem);
if (ret == 1)
rwsem_acquire(&sem->dep_map, 0, 0, _RET_IP_);
return ret;
}
- calls lockdep with trylock set to 0. Why?
I've already caught a fake warning when trying to write-lock
an mm->mmap_sem with another mm's mmap_sem write-locked. With the
patch attached everything works, fine.
Did I miss something?
View attachment "diff-lockdep-rwsem-trylock" of type "text/plain" (357 bytes)
Powered by blists - more mailing lists