From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH 17/17] RCU'd vfsmounts Date: Thu, 3 Oct 2013 22:14:48 +0100 Message-ID: <20131003211448.GN13318@ZenIV.linux.org.uk> References: <20131003105130.GE13318@ZenIV.linux.org.uk> <20131003174439.GG13318@ZenIV.linux.org.uk> <20131003194351.GK13318@ZenIV.linux.org.uk> <20131003204142.GL13318@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel , Linux Kernel Mailing List To: Linus Torvalds Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Oct 03, 2013 at 01:52:45PM -0700, Linus Torvalds wrote: > Yeah, I think we should be guaranteed that, because the > synchronize_rcu() will guarantee that all other CPU's go through an > idle period. So the "read A" on CPU2 cannot possibly see a 1 _unless_ > it happens so early that synchronize_rcu() definitely sees it (ie it's > a "preexisting reader" by definition), in which case synchronize_rcu() > will be waiting for a subsequent idle period, in which case the B=0 on > CPU2 is not only guaranteed to happen but also be visible out, so the > "read B" on CPU1 will see 0. And that's true even if CPU2 doesn't have > an explicit memory barrier, because the "RCU idle" state implies that > it has gone through a barrier. > > So I don't see how they could possibly see ones. Modulo terminal bugs > in synchronize_barrier() (which can be very slow, but for umount I > wouldn't worry). Or modulo my brain being fried. There's one more place similar to that - kern_unmount(). There we also go from "longterm vfsmount, mntput() doesn't need to bother checking" to NULL ->mnt_ns. We can, of course, slap synchronize_rcu() there as well, but that might make pid_ns and ipc_ns destruction slow...