linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* vfat unlink latency 54.6ms for 128MB files
@ 2005-01-10  1:23 Sami Farin
  2005-01-10 18:38 ` OGAWA Hirofumi
  0 siblings, 1 reply; 5+ messages in thread
From: Sami Farin @ 2005-01-10  1:23 UTC (permalink / raw)
  To: linux-kernel Mailing List

Just wondering, when I remove a 128MB file on vfat partition
(usb-storage, memcard reader), it causes 54.6ms latency
in rtc_latencytest...  latency seems to increase linearly
as the filesize grows.  I calculated 1s would be reached with
2344MB file but I didn't bother trying that yet.
Are there any possible fixes for fat fs so
that it doesn't disable interrupts for that long a time?

When I use loop device (the file on reiserfs), I get 45.9ms latency,
so this is not usb's fault. 

These with Linux-2.6.10-ac8 on UP, PPro+, no preempt.
http://safari.iki.fi/vfat-unlink/

-- 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: vfat unlink latency 54.6ms for 128MB files
  2005-01-10  1:23 vfat unlink latency 54.6ms for 128MB files Sami Farin
@ 2005-01-10 18:38 ` OGAWA Hirofumi
  2005-01-10 19:39   ` Sami Farin
  2005-01-10 22:36   ` Robert Hardy
  0 siblings, 2 replies; 5+ messages in thread
From: OGAWA Hirofumi @ 2005-01-10 18:38 UTC (permalink / raw)
  To: linux-kernel Mailing List

Sami Farin <7atbggg02@sneakemail.com> writes:

> Just wondering, when I remove a 128MB file on vfat partition
> (usb-storage, memcard reader), it causes 54.6ms latency
> in rtc_latencytest...  latency seems to increase linearly
> as the filesize grows.  I calculated 1s would be reached with
> 2344MB file but I didn't bother trying that yet.
> Are there any possible fixes for fat fs so
> that it doesn't disable interrupts for that long a time?

The fatfs itself doesn't disable any interrupt.  I guess the thing
depending on file size is the fat_free().

So, the following patch may change the behavior...
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

diff -up linux-2.6.10/fs/fat/cache.c.orig linux-2.6.10/fs/fat/cache.c
--- linux-2.6.10/fs/fat/cache.c.orig	2004-12-25 06:35:24.000000000 +0900
+++ linux-2.6.10/fs/fat/cache.c	2005-01-11 03:34:54.000000000 +0900
@@ -491,6 +491,8 @@ int fat_free(struct inode *inode, int sk
 		if (MSDOS_SB(sb)->free_clusters != -1)
 			MSDOS_SB(sb)->free_clusters++;
 		inode->i_blocks -= MSDOS_SB(sb)->cluster_size >> 9;
+
+		cond_resched();
 	} while (nr != FAT_ENT_EOF);
 	fat_clusters_flush(sb);
 	nr = 0;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: vfat unlink latency 54.6ms for 128MB files
  2005-01-10 18:38 ` OGAWA Hirofumi
@ 2005-01-10 19:39   ` Sami Farin
  2005-01-10 22:36   ` Robert Hardy
  1 sibling, 0 replies; 5+ messages in thread
From: Sami Farin @ 2005-01-10 19:39 UTC (permalink / raw)
  To: linux-kernel Mailing List

On Tue, Jan 11, 2005 at 03:38:32AM +0900, OGAWA Hirofumi wrote:
> Sami Farin <7atbggg02@sneakemail.com> writes:
> 
> > Just wondering, when I remove a 128MB file on vfat partition
> > (usb-storage, memcard reader), it causes 54.6ms latency
> > in rtc_latencytest...  latency seems to increase linearly
> > as the filesize grows.  I calculated 1s would be reached with
> > 2344MB file but I didn't bother trying that yet.
> > Are there any possible fixes for fat fs so
> > that it doesn't disable interrupts for that long a time?
> 
> The fatfs itself doesn't disable any interrupt.  I guess the thing
> depending on file size is the fat_free().
> 
> So, the following patch may change the behavior...
> -- 
> OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
> 
> diff -up linux-2.6.10/fs/fat/cache.c.orig linux-2.6.10/fs/fat/cache.c
> --- linux-2.6.10/fs/fat/cache.c.orig	2004-12-25 06:35:24.000000000 +0900
> +++ linux-2.6.10/fs/fat/cache.c	2005-01-11 03:34:54.000000000 +0900
> @@ -491,6 +491,8 @@ int fat_free(struct inode *inode, int sk
>  		if (MSDOS_SB(sb)->free_clusters != -1)
>  			MSDOS_SB(sb)->free_clusters++;
>  		inode->i_blocks -= MSDOS_SB(sb)->cluster_size >> 9;
> +
> +		cond_resched();
>  	} while (nr != FAT_ENT_EOF);
>  	fat_clusters_flush(sb);
>  	nr = 0;

Oh yeah, now max latency is around 1.5ms.
Thanks for the patch.

-- 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: vfat unlink latency 54.6ms for 128MB files
  2005-01-10 18:38 ` OGAWA Hirofumi
  2005-01-10 19:39   ` Sami Farin
@ 2005-01-10 22:36   ` Robert Hardy
  2005-01-10 23:41     ` OGAWA Hirofumi
  1 sibling, 1 reply; 5+ messages in thread
From: Robert Hardy @ 2005-01-10 22:36 UTC (permalink / raw)
  To: OGAWA Hirofumi; +Cc: linux-kernel Mailing List

On Tue, 11 Jan 2005, OGAWA Hirofumi wrote:
> Sami Farin <7atbggg02@sneakemail.com> writes:
>
>> Just wondering, when I remove a 128MB file on vfat partition
>> (usb-storage, memcard reader), it causes 54.6ms latency
>> in rtc_latencytest...  latency seems to increase linearly
>> as the filesize grows.  I calculated 1s would be reached with
>> 2344MB file but I didn't bother trying that yet.
>> Are there any possible fixes for fat fs so
>> that it doesn't disable interrupts for that long a time?
>
> The fatfs itself doesn't disable any interrupt.  I guess the thing
> depending on file size is the fat_free().
>
> So, the following patch may change the behavior...

diff -up linux-2.6.10/fs/fat/cache.c.orig linux-2.6.10/fs/fat/cache.c
--- linux-2.6.10/fs/fat/cache.c.orig    2004-12-25 06:35:24.000000000 +0900
+++ linux-2.6.10/fs/fat/cache.c 2005-01-11 03:34:54.000000000 +0900
@@ -491,6 +491,8 @@ int fat_free(struct inode *inode, int sk
                 if (MSDOS_SB(sb)->free_clusters != -1)
                         MSDOS_SB(sb)->free_clusters++;
                 inode->i_blocks -= MSDOS_SB(sb)->cluster_size >> 9;
+
+               cond_resched();
         } while (nr != FAT_ENT_EOF);
         fat_clusters_flush(sb);
         nr = 0;
-

Thanks for your patchset.tar (in another thread) from:
Thu, 30 Dec 2004 12:02:14 +0900.

Based on the patch above, is an additional cond_resched() call required
somewhere in your 2004/12/30 patchset?

In your 2004/12/30 patchset, if I am reading it correctly, fat_free seems to
have moved from cache.c to file.c and the code isn't similar enough for me
to see where a cond_resched() could be added.

Perhaps you have already have a newer patchset?

Thanks for your time.

Regards,
Rob

-- 
---------------------"Happiness is understanding."----------------------
Robert Hardy, B.Eng Computer Systems                  C.E.O. Webcon Inc.
rhardy <at> webcon <dot> ca    GPG Key available          (613) 276-7327

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: vfat unlink latency 54.6ms for 128MB files
  2005-01-10 22:36   ` Robert Hardy
@ 2005-01-10 23:41     ` OGAWA Hirofumi
  0 siblings, 0 replies; 5+ messages in thread
From: OGAWA Hirofumi @ 2005-01-10 23:41 UTC (permalink / raw)
  To: Robert Hardy; +Cc: linux-kernel Mailing List

Robert Hardy <rhardy@webcon.ca> writes:

> Thanks for your patchset.tar (in another thread) from:
> Thu, 30 Dec 2004 12:02:14 +0900.
>
> Based on the patch above, is an additional cond_resched() call required
> somewhere in your 2004/12/30 patchset?
>
> In your 2004/12/30 patchset, if I am reading it correctly, fat_free seems to
> have moved from cache.c to file.c and the code isn't similar enough for me
> to see where a cond_resched() could be added.

Yes. For that patchset, need to add the similar code to
fat_free_cluster() in fs/fat/fatent.c.

		err = fat_write_entry(sb, &fatent, FAT_ENT_FREE);
		if (err)
			goto error;
		if (sbi->free_clusters != -1)
			sbi->free_clusters++;

                cond_resched();     <---  add this line
	} while (cluster != FAT_ENT_EOF);


> Perhaps you have already have a newer patchset?

Yes. I added the 8~10 patches to patchset. However, current patchset
can't compile temporarily.  Sorry. Please wait for next weekend.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-01-10 23:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-10  1:23 vfat unlink latency 54.6ms for 128MB files Sami Farin
2005-01-10 18:38 ` OGAWA Hirofumi
2005-01-10 19:39   ` Sami Farin
2005-01-10 22:36   ` Robert Hardy
2005-01-10 23:41     ` OGAWA Hirofumi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).