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: Sun, 06 Jun 2010 22:22:22 +0300 Message-ID: <1275852142.17909.7.camel@localhost.localdomain> References: <1275835829-1478-1-git-send-email-dedekind1@gmail.com> <1275835829-1478-5-git-send-email-dedekind1@gmail.com> <1275844581.17909.2.camel@localhost.localdomain> Reply-To: dedekind1@gmail.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, Artem Bityutskiy To: Al Viro Return-path: Received: from mail-fx0-f46.google.com ([209.85.161.46]:61804 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752072Ab0FFTW1 (ORCPT ); Sun, 6 Jun 2010 15:22:27 -0400 In-Reply-To: <1275844581.17909.2.camel@localhost.localdomain> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sun, 2010-06-06 at 20:16 +0300, Artem Bityutskiy wrote: > On Sun, 2010-06-06 at 17:50 +0300, Artem Bityutskiy wrote: > > void sb_mark_dirty(struct super_block *sb); > > static inline void sb_mark_clean(struct super_block *sb) > > { > > sb->s_dirty =3D 0; > > + /* > > + * Normally FSes first unset the sb->s_dirty flag, and then start > > + * synchronizing the SB. The memory barrier ensures this order. > > + */ > > + smp_mb(); > ... > > void sb_mark_dirty(struct super_block *sb) > > { > > + /* > > + * Normally FSes modify the SB, and then mark it as dirty. The me= mory > > + * barrier ensures this order. > > + */ > > + smp_mb(); > ... >=20 > Hmm, these ones should be 'mb()', not 'smp_mb()'. Actually no, sorry, I completely missed that all memory barriers are a compiler barriers. I thought smp_mb() is nought, which is not true - smp_mb() is a barrier() on UP. --=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) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html