From mboxrd@z Thu Jan 1 00:00:00 1970 From: OGAWA Hirofumi Subject: Re: [PATCH v2 3/4] fat: mark superblock as dirty less often Date: Sat, 14 Apr 2012 18:17:32 +0900 Message-ID: <87k41ihdub.fsf@devron.myhome.or.jp> References: <1334326795-2446-1-git-send-email-dedekind1@gmail.com> <1334326795-2446-4-git-send-email-dedekind1@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Andrew Morton , Linux Kernel Maling List , Linux FS Maling List , Artem Bityutskiy To: Artem Bityutskiy Return-path: Received: from mail.parknet.co.jp ([210.171.160.6]:48998 "EHLO mail.parknet.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751011Ab2DNJuN (ORCPT ); Sat, 14 Apr 2012 05:50:13 -0400 In-Reply-To: <1334326795-2446-4-git-send-email-dedekind1@gmail.com> (Artem Bityutskiy's message of "Fri, 13 Apr 2012 17:19:54 +0300") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Artem Bityutskiy writes: > From: Artem Bityutskiy > > This patch is a preparation for further changes. It touches few functions > in fatent.c and prevents them from marking the superblock as dirty > unnecessarily often. Namely, instead of marking it as dirty in the internal > 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. For it, please use local variable like, { int fsinfo_dirty = 0; while (1) { change free_clusters fsinfo_dirty = 1; } if (fsinfo_dirty) mark_fsinfo_dirty() } instead of dirty it always. -- OGAWA Hirofumi