From mboxrd@z Thu Jan 1 00:00:00 1970 From: Artem Bityutskiy Subject: Re: [PATCH v2 3/4] fat: mark superblock as dirty less often Date: Sat, 14 Apr 2012 13:24:17 +0300 Message-ID: <1334399070.2263.3.camel@koala> References: <1334326795-2446-1-git-send-email-dedekind1@gmail.com> <1334326795-2446-4-git-send-email-dedekind1@gmail.com> <87k41ihdub.fsf@devron.myhome.or.jp> Reply-To: dedekind1@gmail.com Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-MMrUMz7v7LL+JyGyxzrv" Cc: Andrew Morton , Linux Kernel Maling List , Linux FS Maling List , Artem Bityutskiy To: OGAWA Hirofumi Return-path: In-Reply-To: <87k41ihdub.fsf@devron.myhome.or.jp> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org --=-MMrUMz7v7LL+JyGyxzrv Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, thanks for feed-back, On Sat, 2012-04-14 at 18:17 +0900, OGAWA Hirofumi wrote: > Artem Bityutskiy writes: >=20 > > From: Artem Bityutskiy > > > > This patch is a preparation for further changes. It touches few functio= ns > > in fatent.c and prevents them from marking the superblock as dirty > > unnecessarily often. Namely, instead of marking it as dirty in the inte= rnal > > tight loops - do it only once at the end of the functions. And instead = of > > marking it as dirty while holding the FAT table lock, do it outside the= lock. > > > > The reason for this patch is that marking the superblock as dirty will = soon > > become a little bit heavier operation, so it is cleaner to do this only= when it > > is necessary. >=20 > For it, please use local variable like, >=20 >=20 > { > int fsinfo_dirty =3D 0; >=20 > while (1) { > change free_clusters > fsinfo_dirty =3D 1; > } >=20 > if (fsinfo_dirty) > mark_fsinfo_dirty() > } >=20 > instead of dirty it always. But could you please explain why do we need an extra variable? What is the problem with doing all our FAT table changes and then marking the FSINFO as dirty? --=20 Best Regards, Artem Bityutskiy --=-MMrUMz7v7LL+JyGyxzrv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAABAgAGBQJPiVBRAAoJEJtuLFy+q7fevn4H/103fsRTTWftqgfhWFFTiAaY bdlvuxsIcpP9HLhLVoYcFEmSTvT2/vfFX1zDqM8blG6r1UT0M/mTk05+ts4njojr X9949f4QICXugXgSsp4q6kcju2w/dbW5BE9vK6PgJAFL4wnFZzbxpeSO0khvNLSJ 23Ex9VGN8orixqL9N1ujVbnrc6z1LHL0A/IAzRG1FkTt+hPSwVFIIZtjYek+uVny 5vOP73csFSFkz19pLD6eQvCNNkqOeqQorhLvw35+Bd7BEy900223IbHNE4MCUIL2 hHhu9N7fUd4Z9Znvf16SGtsHIVdTGaNZ8sdwNMU0NfhI30yaMrwEXUdGmSvjdZw= =c7ju -----END PGP SIGNATURE----- --=-MMrUMz7v7LL+JyGyxzrv--