mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/14] fsnotify: simplify locking
@ 2011-01-19 16:42 Lino Sanfilippo
  2011-01-19 16:42 ` [PATCH 01/14] fsnotify: change locking order in fsnotify_add_mark() Lino Sanfilippo
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Lino Sanfilippo @ 2011-01-19 16:42 UTC (permalink / raw)
  To: eparis; +Cc: linux-kernel, linux-fsdevel

This patchset simplifies some of the locking that is needed to handle the addition and 
removal of marks from groups and vfs objects (inodes, mounts). It applies against
commit ef9bf3b7144bee6ce1da5616015cabc8771206af of branch 
'origin/for-next' from git.infradead.org/users/eparis/notify.git


The recent locking order used in fsnotify is 

mark->lock
group->mark_lock
inode->i_lock

The problem is that we cant use the group->mark_lock to synchronize addition and 
removal of marks to/from a group, so we have to use an additional mutex, namely the 
group->mutex, for this purpose. 
We also need a dedicated kernel thread for mark destruction since we cant call 
synchronize() for the mark_srcu with a spinlock held (at least i assume that this 
is the main reason this thread exists).

The main goal of these patches is to change the locking order to 

group->mark_lock
inode->i_lock
mark->lock

and by this simplify the concerning code:
- use the group->mark_lock for group list iteration and addition/removal of marks
- call synchronize() for mark_srcu as soon as a mark is removed from its 
  fsobject and thus avoid the need for the "fsnotify_mark" thread
- avoid temporary lists for mark traversal 

 


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

end of thread, other threads:[~2011-01-19 17:13 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-19 16:42 [PATCH 0/14] fsnotify: simplify locking Lino Sanfilippo
2011-01-19 16:42 ` [PATCH 01/14] fsnotify: change locking order in fsnotify_add_mark() Lino Sanfilippo
2011-01-19 16:42 ` [PATCH 02/14] fsnotify: rename fsnotify_add_mark() to fsnotify_add_mark_locked() Lino Sanfilippo
2011-01-19 16:42 ` [PATCH 03/14] fsnotify: adjust locking in fsnotify_add_[inode|vfsmount]_mark() Lino Sanfilippo
2011-01-19 16:42 ` [PATCH 04/14] fsnotify: simplify fsnotify_destroy_mark() Lino Sanfilippo
2011-01-19 16:42 ` [PATCH 05/14] fsnotify: synchronize mark_srcu after a mark has been removed from a fsobject Lino Sanfilippo
2011-01-19 16:42 ` [PATCH 06/14] fsnotify: clear fsobject marks with object lock held Lino Sanfilippo
2011-01-19 16:42 ` [PATCH 07/14] fsnotify: handle number of marks and group ref counting independently from each other Lino Sanfilippo
2011-01-19 16:42 ` [PATCH 08/14] fanotify: add an extra flag to mark_remove_from_mask that indicates wheather a mark could be destroyed Lino Sanfilippo
2011-01-19 16:42 ` [PATCH 09/14] fsnotify: add new function fsnotify_remove_mark_locked() Lino Sanfilippo
2011-01-19 16:42 ` [PATCH 10/14] fanotify,dnotify,inotify,audit: replace destroy_mark() with remove_mark_locked() Lino Sanfilippo
2011-01-19 17:12 ` [PATCH 0/14] fsnotify: simplify locking Eric Paris

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

all inboxes | Powered by JetHome®