All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	Eric Paris <eparis@redhat.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: fsnotify_mark_srcu wtf?
Date: Sun, 13 Nov 2016 20:43:12 +0200	[thread overview]
Message-ID: <CAOQ4uxjaPj6XfU_r1CLXaMsPupjDvjXh8ae00DjrwgvJMvOzLA@mail.gmail.com> (raw)
In-Reply-To: <20161110194625.GG31098@quack2.suse.cz>

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.
 */

  parent reply	other threads:[~2016-11-13 18:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-02 22:09 fsnotify_mark_srcu wtf? Miklos Szeredi
2016-11-03 10:25 ` Amir Goldstein
2016-11-05 21:43   ` Jan Kara
2016-11-05 21:34 ` Jan Kara
2016-11-06  6:45   ` Amir Goldstein
2016-11-09 11:10     ` Jan Kara
2016-11-09 18:26       ` Amir Goldstein
2016-11-10 19:46         ` Jan Kara
2016-11-10 20:02           ` Amir Goldstein
2016-11-10 20:44           ` Miklos Szeredi
2016-11-10 22:41             ` Amir Goldstein
2016-11-13 18:43           ` Amir Goldstein [this message]
2016-11-14 11:59             ` Amir Goldstein
2016-12-02  8:26           ` Miklos Szeredi
2016-12-02 10:48             ` Jan Kara
2016-12-02 11:02               ` Miklos Szeredi
2016-12-06 17:07                 ` Jan Kara
2016-12-02 11:41               ` Amir Goldstein
2016-12-02 11:57                 ` Amir Goldstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOQ4uxjaPj6XfU_r1CLXaMsPupjDvjXh8ae00DjrwgvJMvOzLA@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=eparis@redhat.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.