Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1520638

Re: fsnotify_mark_srcu wtf?

From Amir Goldstein <amir73il@gmail.com>
Newsgroups linux.kernel
Subject Re: fsnotify_mark_srcu wtf?
Date 2016-11-13 19:50 +0100
Message-ID <sD80N-46V-19@gated-at.bofh.it> (permalink)
References (1 earlier) <sAgQV-4L1-3@gated-at.bofh.it> <sAprc-1ZO-3@gated-at.bofh.it> <sBz59-6zy-47@gated-at.bofh.it> <sBFNi-2u3-83@gated-at.bofh.it> <sC3wd-2e1-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Nov 10, 2016 at 9:46 PM, Jan Kara <jack@suse.cz> wrote:

...

>
> Well but how would you like to protect the mark list hanging off the inode
> / mountpoint with two SRCUs? You'd need two lists hanging off the inode &
> mountpoint (for different priorities) and that's too big cost to pay to
> accomodate broken userspace...
>

This is the plan.
I have a rough implementation, which still requires some testing:

/*
 * fsnotify_perm_mark[1] protects reads of the first half of inode/vfsmount
 * mark lists, which consist of the high priority (>0) marks, whose masks
 * may contain permission events.
 *
 * fsnotify_perm_mark[0] protects reads of the second half of inode/vfsmount
 * mark lists, which consist of the low priority (0) marks, whose masks
 * do not contain permission events.
 *
 * High priority marks and low priority marks are added to different
 * destroy lists and freed by different reapers, who synchronize only
 * the relevant srcu.
 *
 * Before traversing to first mark on the list we must hold both srcu.
 * While traversing first half, we may temporary drop fsnotify_perm_mark[0]
 * to handle a blocking permission event.
 * When we reach the first low level mark, we may drop fsnotify_perm_mark[1]
 * for good.
 */

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: fsnotify_mark_srcu wtf? Amir Goldstein <amir73il@gmail.com> - 2016-11-13 19:50 +0100
  Re: fsnotify_mark_srcu wtf? Amir Goldstein <amir73il@gmail.com> - 2016-11-14 13:10 +0100

csiph-web