public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* fs/locks.c BKL removal
@ 2002-05-10 21:48 Dave Hansen
  2002-05-10 22:13 ` Dave Hansen
  2002-05-11 19:45 ` Matthew Wilcox
  0 siblings, 2 replies; 7+ messages in thread
From: Dave Hansen @ 2002-05-10 21:48 UTC (permalink / raw)
  To: matthew; +Cc: linux-kernel

Matthew,
Al Viro pointed me your way.

I'm looking into the fs/locks.c mess.  It appears that there was an 
attempt to convert this over to a semaphore, but it was removed just 
before the 2.4 release because of some deadlocks.

Whenever the i_flock list is traversed, the BKL is held.  It is also 
held while running through the file_lock_list which I think is used 
only for /proc/locks.

We definitely need a semaphore because of all the blocking that goes 
on.  We can either have a global lock for all of them, which I think 
was tried last time.  Or, we can split it up a bit more.  With the 
current design, there will need to be a lock for the global list, each 
individual list, and one for each individual lock to protect against 
access from the reference in the file_lock_list and the inode->i_flock 
list.

However, I think that the file_lock_list complexity may be able to be 
reduced.  If we make the file_lock_list a list of inodes (or just the 
i_flocks) with active locks, we can avoid the complexity of having an 
individual file_lock lock.  That way, we at least reduce the number of 
_types_ of locks.  It increases the number of dereferences, but this 
is /proc we're talking about.  Any comments?

Talking about locks for locks is confusing :)

-- 
Dave Hansen
haveblue@us.ibm.com


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-05-12  2:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-10 21:48 fs/locks.c BKL removal Dave Hansen
2002-05-10 22:13 ` Dave Hansen
2002-05-10 23:17   ` Andrew Morton
2002-05-11 19:48     ` Matthew Wilcox
2002-05-11 19:45 ` Matthew Wilcox
2002-05-12  1:40   ` Dave Hansen
2002-05-12  2:07     ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox