lkml.org 
[lkml]   [2005]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Convert refrigerator() to try_to_freeze()
From
Date
Hi.

On Tue, 2005-07-19 at 23:54, Pavel Machek wrote:
> Hi!
>
> > This patch removes the few remaining direct invocations of the
> > refrigerator in 2.6.13-rc3. In drivers/media/video/msp3400.c, it also
> > shifts the call to after the remove_wait_queue; this seems to be the
> > more appropriate place.
>
>
> > diff -ruNp 230-refrigerator-to-try_to_freeze.patch-old/fs/jbd/journal.c 230-refrigerator-to-try_to_freeze.patch-new/fs/jbd/journal.c
> > --- 230-refrigerator-to-try_to_freeze.patch-old/fs/jbd/journal.c 2005-07-18 06:36:59.000000000 +1000
> > +++ 230-refrigerator-to-try_to_freeze.patch-new/fs/jbd/journal.c 2005-07-18 13:54:47.000000000 +1000
> > @@ -175,7 +175,7 @@ loop:
> > */
> > jbd_debug(1, "Now suspending kjournald\n");
> > spin_unlock(&journal->j_state_lock);
> > - refrigerator();
> > + try_to_freeze();
> > spin_lock(&journal->j_state_lock);
> > } else {
> > /*
>
> They probably tested it before, why test again?
>
> > diff -ruNp 230-refrigerator-to-try_to_freeze.patch-old/fs/jfs/jfs_logmgr.c 230-refrigerator-to-try_to_freeze.patch-new/fs/jfs/jfs_logmgr.c
> > --- 230-refrigerator-to-try_to_freeze.patch-old/fs/jfs/jfs_logmgr.c 2005-07-18 06:36:59.000000000 +1000
> > +++ 230-refrigerator-to-try_to_freeze.patch-new/fs/jfs/jfs_logmgr.c 2005-07-18 13:54:47.000000000 +1000
> > @@ -2361,7 +2361,7 @@ int jfsIOWait(void *arg)
> > }
> > if (freezing(current)) {
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > spin_unlock_irq(&log_redrive_lock);
> > - refrigerator();
> > + try_to_freeze();
> > } else {
> > add_wait_queue(&jfs_IO_thread_wait, &wq);
> > set_current_state(TASK_INTERRUPTIBLE);
>
> See? You are needlessly testing condition twice.

True. I was just concerned that things are messy and inconsistent as
they stand (sometimes we use try_to_freeze and implicitly call
refrigerator(), sometimes we call freezing() and refrigerator). *shrug*

Regards,

Nigel
--
Evolution.
Enumerate the requirements.
Consider the interdependencies.
Calculate the probabilities.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-20 04:33    [W:0.056 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site