From mboxrd@z Thu Jan 1 00:00:00 1970 From: Artem Bityutskiy Subject: Re: [PATCHv5 04/16] VFS: add memory barrier to sb_mark_clean and sb_mark_dirty Date: Wed, 09 Jun 2010 19:36:50 +0300 Message-ID: <1276101410.5677.158.camel@localhost> References: <1275835829-1478-1-git-send-email-dedekind1@gmail.com> <1275835829-1478-5-git-send-email-dedekind1@gmail.com> Reply-To: Artem.Bityutskiy@nokia.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Andrew Morton , LKML , linux-fsdevel@vger.kernel.org To: Al Viro Return-path: In-Reply-To: <1275835829-1478-5-git-send-email-dedekind1@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sun, 2010-06-06 at 17:50 +0300, Artem Bityutskiy wrote: > From: Artem Bityutskiy >=20 > The proper way for file-systems to synchronize the superblock > should be as follows: >=20 > 1. when modifying the SB, first modify it, then mark it as dirty; > 2. when synchronizing the SB, first mark as clean, then start > synchronizing. >=20 > And to make ensure the order, we need memory barriers in 'sb_mark_cle= an()' > and 'sb_mark_dirty()'. I believe this stuff is a separate story, and should be handled separately. I'll keep this separately from the 'sync_supers()' wakes up optimization. I actually now cannot prove myself whether these smp_mb()'s I added in this patch make sense or not, and whether the races in FSes I was tryin= g to address can be addressed without spinlocks. Really dunno - but I wil= l keep trying to get better understanding. Reading Documentation/memory-barriers.txt and some McKenny's docs only did not help so far :-) --=20 Best Regards, Artem Bityutskiy (=D0=90=D1=80=D1=82=D1=91=D0=BC =D0=91=D0=B8=D1=82=D1=8E= =D1=86=D0=BA=D0=B8=D0=B9)