All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG in Reiserfs Journal Thread
@ 2004-09-15 20:02 Vijayan Prabhakaran
  2004-09-15 20:07 ` Chris Mason
  0 siblings, 1 reply; 3+ messages in thread
From: Vijayan Prabhakaran @ 2004-09-15 20:02 UTC (permalink / raw)
  To: mason, reiserfs-list; +Cc: reiser, vijayan

Dear Chris Mason,

I found a bug in Reiserfs journal thread. This bug is in function
reiserfs_journal_commit_thread().

I'm trying to measure the impact of journal thread on data flushes. I
changed the commit interval from the default of 5 seconds (this value
is hard coded in the function) to other different values. I found that
irrespective of changing the journal thread's timer value, the dirty
data was not getting flushed after the time out at the commit thread.

The reason for this is due to a bug in the code. The code looks like

while(1) {

  /*blah blah blah*/

  if (CURRENT_TIME - last_run > 5) {
    reiserfs_flush_old_commits(s);
  }

  /*blah blah blah*/

  interruptible_sleep_on_timeout(&reiserfs_commit_thread_wait, 5 * HZ) ;

  /*thread wakes up*/
}

If you see the code, the thread sleeps for 5 seconds. But after waking
up, it again checks the condition:

if (CURRENT_TIME - last_run > 5) {
   reiserfs_flush_old_commits(s);
}

Actually, the condition should be ">=" instead of ">". Since the
thread wakes up immediately after the timer expires, the condition
will never satisfy if it is ">".

Chris, can you please verify this and add the fix ?

I appreciate your help.

Vijayan

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

end of thread, other threads:[~2004-09-15 20:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-15 20:02 BUG in Reiserfs Journal Thread Vijayan Prabhakaran
2004-09-15 20:07 ` Chris Mason
2004-09-15 20:17   ` Vijayan Prabhakaran

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.