From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH v3 2/4] Keep nr_dentry per super block Date: Sun, 14 Aug 2011 19:38:42 +0200 Message-ID: <1313343522.2798.11.camel@edumazet-laptop> References: <1313334832-1150-1-git-send-email-glommer@parallels.com> <1313334832-1150-3-git-send-email-glommer@parallels.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, containers@lists.linux-foundation.org, Pavel Emelyanov , Al Viro , Hugh Dickins , Nick Piggin , Andrea Arcangeli , Rik van Riel , Dave Hansen , James Bottomley , David Chinner To: Glauber Costa Return-path: Received: from mail-wy0-f174.google.com ([74.125.82.174]:44443 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753805Ab1HNRi7 (ORCPT ); Sun, 14 Aug 2011 13:38:59 -0400 In-Reply-To: <1313334832-1150-3-git-send-email-glommer@parallels.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Le dimanche 14 ao=C3=BBt 2011 =C3=A0 19:13 +0400, Glauber Costa a =C3=A9= crit : > Now that we have per-sb shrinkers, it makes sense to have nr_dentries > stored per sb as well. We turn them into per-cpu counters so we can > keep acessing them without locking. >=20 > Signed-off-by: Glauber Costa > } > diff --git a/fs/super.c b/fs/super.c > index 3f56a26..e95ac4f 100644 > --- a/fs/super.c > +++ b/fs/super.c > @@ -119,6 +119,9 @@ static struct super_block *alloc_super(struct fil= e_system_type *type) > s =3D NULL; > goto out; > } > + > + percpu_counter_init(&s->s_nr_dentry, 0); > + You should take care of possible error return at this point. (We probably should check the percpu_counter_init() done in tcp_init(), but they are done at boot time, with nearly no chance of failure) -- 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