All of lore.kernel.org
 help / color / mirror / Atom feed
* Why reiser does a disk write on every sync() call?
       [not found] <1174932216.16988.ezmlm@namesys.com>
@ 2007-03-26 18:12 ` Lin Shen (lshen)
  2007-03-27  7:59   ` Vladimir V. Saveliev
  0 siblings, 1 reply; 7+ messages in thread
From: Lin Shen (lshen) @ 2007-03-26 18:12 UTC (permalink / raw)
  To: reiserfs-list

I'm using iostat to measure disk reads/writes associated with various
file operations under Reiser. One thing I noticed and can't explain is
that every sync() call by itself (not following a write or anything)
will cause an I/O write. Any ideas?

Lin  

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

* Re: Why reiser does a disk write on every sync() call?
  2007-03-26 18:12 ` Why reiser does a disk write on every sync() call? Lin Shen (lshen)
@ 2007-03-27  7:59   ` Vladimir V. Saveliev
  2007-03-27 17:20     ` Lin Shen (lshen)
  0 siblings, 1 reply; 7+ messages in thread
From: Vladimir V. Saveliev @ 2007-03-27  7:59 UTC (permalink / raw)
  To: Lin Shen (lshen); +Cc: reiserfs-list

Hello

On Monday 26 March 2007 22:12, Lin Shen (lshen) wrote:
> I'm using iostat to measure disk reads/writes associated with various
> file operations under Reiser. One thing I noticed and can't explain is
> that every sync() call by itself (not following a write or anything)
> will cause an I/O write. Any ideas?
> 

The I/O write is performed by reiserfs implementation of sync_fs method of struct super_operations.
If filesystem is mounted r/w - reiserfs_sync_fs begins a transaction (or joins an existing one), journal super block if the transaction has zero length,
closes the transaction and flushes old transactions including the one which was just closed. So, if there were no transaction to flush before sync() - 
one transaction of length 1 gets created, closed, committed and flushed. 5 blocks get written to disk in this case. My calculation can be wrong, though.
How much I/O do you notice? 

> Lin  
> 
> 

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

* RE: Why reiser does a disk write on every sync() call?
  2007-03-27  7:59   ` Vladimir V. Saveliev
@ 2007-03-27 17:20     ` Lin Shen (lshen)
  2007-03-27 18:54       ` Vladimir V. Saveliev
  0 siblings, 1 reply; 7+ messages in thread
From: Lin Shen (lshen) @ 2007-03-27 17:20 UTC (permalink / raw)
  To: Vladimir V. Saveliev; +Cc: reiserfs-list

I saw 32 blocks by calling sync() alone.

Lin

> -----Original Message-----
> From: Vladimir V. Saveliev [mailto:vs@namesys.com] 
> Sent: Tuesday, March 27, 2007 1:00 AM
> To: Lin Shen (lshen)
> Cc: reiserfs-list@namesys.com
> Subject: Re: Why reiser does a disk write on every sync() call?
> 
> Hello
> 
> On Monday 26 March 2007 22:12, Lin Shen (lshen) wrote:
> > I'm using iostat to measure disk reads/writes associated 
> with various 
> > file operations under Reiser. One thing I noticed and can't 
> explain is 
> > that every sync() call by itself (not following a write or 
> anything) 
> > will cause an I/O write. Any ideas?
> > 
> 
> The I/O write is performed by reiserfs implementation of 
> sync_fs method of struct super_operations.
> If filesystem is mounted r/w - reiserfs_sync_fs begins a 
> transaction (or joins an existing one), journal super block 
> if the transaction has zero length, closes the transaction 
> and flushes old transactions including the one which was just 
> closed. So, if there were no transaction to flush before 
> sync() - one transaction of length 1 gets created, closed, 
> committed and flushed. 5 blocks get written to disk in this 
> case. My calculation can be wrong, though.
> How much I/O do you notice? 
> 
> > Lin
> > 
> > 
> 

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

* Re: Why reiser does a disk write on every sync() call?
  2007-03-27 17:20     ` Lin Shen (lshen)
@ 2007-03-27 18:54       ` Vladimir V. Saveliev
  2007-05-12 13:03         ` Grzegorz Jaśkiewicz
  0 siblings, 1 reply; 7+ messages in thread
From: Vladimir V. Saveliev @ 2007-03-27 18:54 UTC (permalink / raw)
  To: Lin Shen (lshen); +Cc: reiserfs-list

Hello

On Tuesday 27 March 2007 21:20, Lin Shen (lshen) wrote:
> I saw 32 blocks by calling sync() alone.
> 

iostat used to count sectors which are 512 bytes long. Did you take that into account?

> Lin
> 
> > -----Original Message-----
> > From: Vladimir V. Saveliev [mailto:vs@namesys.com] 
> > Sent: Tuesday, March 27, 2007 1:00 AM
> > To: Lin Shen (lshen)
> > Cc: reiserfs-list@namesys.com
> > Subject: Re: Why reiser does a disk write on every sync() call?
> > 
> > Hello
> > 
> > On Monday 26 March 2007 22:12, Lin Shen (lshen) wrote:
> > > I'm using iostat to measure disk reads/writes associated 
> > with various 
> > > file operations under Reiser. One thing I noticed and can't 
> > explain is 
> > > that every sync() call by itself (not following a write or 
> > anything) 
> > > will cause an I/O write. Any ideas?
> > > 
> > 
> > The I/O write is performed by reiserfs implementation of 
> > sync_fs method of struct super_operations.
> > If filesystem is mounted r/w - reiserfs_sync_fs begins a 
> > transaction (or joins an existing one), journal super block 
> > if the transaction has zero length, closes the transaction 
> > and flushes old transactions including the one which was just 
> > closed. So, if there were no transaction to flush before 
> > sync() - one transaction of length 1 gets created, closed, 
> > committed and flushed. 5 blocks get written to disk in this 
> > case. My calculation can be wrong, though.
> > How much I/O do you notice? 
> > 
> > > Lin
> > > 
> > > 
> > 
> 
> 

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

* Re: Why reiser does a disk write on every sync() call?
  2007-03-27 18:54       ` Vladimir V. Saveliev
@ 2007-05-12 13:03         ` Grzegorz Jaśkiewicz
  2007-05-12 14:56           ` Toby Thain
  2007-05-16 15:32           ` Vladimir V. Saveliev
  0 siblings, 2 replies; 7+ messages in thread
From: Grzegorz Jaśkiewicz @ 2007-05-12 13:03 UTC (permalink / raw)
  To: Vladimir V. Saveliev; +Cc: reiserfs-list

sounds like useless waste of time and space
You haven't stated the reason, why it has to create and commit empty
transaction.

-- 
GJ

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

* Re: Why reiser does a disk write on every sync() call?
  2007-05-12 13:03         ` Grzegorz Jaśkiewicz
@ 2007-05-12 14:56           ` Toby Thain
  2007-05-16 15:32           ` Vladimir V. Saveliev
  1 sibling, 0 replies; 7+ messages in thread
From: Toby Thain @ 2007-05-12 14:56 UTC (permalink / raw)
  To: Grzegorz Jaśkiewicz; +Cc: ReiserFS List


On 12-May-07, at 9:03 AM, Grzegorz Jaśkiewicz wrote:

> sounds like useless waste of time and space
> You haven't stated the reason, why it has to create and commit empty
> transaction.

Why'd you call sync()?

--T

>
> -- 
> GJ


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

* Re: Why reiser does a disk write on every sync() call?
  2007-05-12 13:03         ` Grzegorz Jaśkiewicz
  2007-05-12 14:56           ` Toby Thain
@ 2007-05-16 15:32           ` Vladimir V. Saveliev
  1 sibling, 0 replies; 7+ messages in thread
From: Vladimir V. Saveliev @ 2007-05-16 15:32 UTC (permalink / raw)
  To: Grzegorz Jaśkiewicz; +Cc: reiserfs-list, reiserfs-dev

Hello

On Saturday 12 May 2007 17:03, Grzegorz Jaśkiewicz wrote:
> sounds like useless waste of time and space
> You haven't stated the reason, why it has to create and commit empty
> transaction.
> 

I think we should fix that.

Chris, do you think that we could avoid creating fake transactions with the below patch?


diff -puN fs/reiserfs/super.c~reiserfs-avoid-syncing-clean-fs fs/reiserfs/super.c
--- linux-2.6.21-mm2/fs/reiserfs/super.c~reiserfs-avoid-syncing-clean-fs	2007-05-16 18:18:45.000000000 +0300
+++ linux-2.6.21-mm2-vs/fs/reiserfs/super.c	2007-05-16 18:19:06.000000000 +0300
@@ -62,7 +62,7 @@ static int reiserfs_statfs(struct dentry
 
 static int reiserfs_sync_fs(struct super_block *s, int wait)
 {
-	if (!(s->s_flags & MS_RDONLY)) {
+	if (!(s->s_flags & MS_RDONLY) && s->s_dirt) {
 		struct reiserfs_transaction_handle th;
 		reiserfs_write_lock(s);
 		if (!journal_begin(&th, s, 1))

_

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

end of thread, other threads:[~2007-05-16 15:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1174932216.16988.ezmlm@namesys.com>
2007-03-26 18:12 ` Why reiser does a disk write on every sync() call? Lin Shen (lshen)
2007-03-27  7:59   ` Vladimir V. Saveliev
2007-03-27 17:20     ` Lin Shen (lshen)
2007-03-27 18:54       ` Vladimir V. Saveliev
2007-05-12 13:03         ` Grzegorz Jaśkiewicz
2007-05-12 14:56           ` Toby Thain
2007-05-16 15:32           ` Vladimir V. Saveliev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.