public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Nigel Cunningham <ncunningham@cyclades.com>
Cc: Andrew Morton <akpm@osdl.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Convert refrigerator() to try_to_freeze()
Date: Tue, 19 Jul 2005 15:54:25 +0200	[thread overview]
Message-ID: <20050719135425.GA2410@elf.ucw.cz> (raw)
In-Reply-To: <1121659148.13493.58.camel@localhost>

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.

							Pavel
-- 
teflon -- maybe it is a trademark, but it should not be.

  reply	other threads:[~2005-07-19 13:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-18  3:59 [PATCH] Convert refrigerator() to try_to_freeze() Nigel Cunningham
2005-07-19 13:54 ` Pavel Machek [this message]
2005-07-20  2:31   ` Nigel Cunningham
2005-07-21  4:48   ` Nigel Cunningham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050719135425.GA2410@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncunningham@cyclades.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox