lkml.org 
[lkml]   [2012]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 3/4] fat: mark superblock as dirty less often
Date
Artem Bityutskiy <dedekind1@gmail.com> writes:

> On Sat, 2012-04-14 at 18:17 +0900, OGAWA Hirofumi wrote:
>> Artem Bityutskiy <dedekind1@gmail.com> writes:
>>
>> > From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
>> >
>> > 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.
>
> 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?

Above example may not be proper. I meant please dirty FSINFO only if
necessary. Your patch seems to be dirty even if code didn't change
FSINFO.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>


\
 
 \ /
  Last update: 2012-04-14 12:41    [W:0.038 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site