mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: janitor@sternwelten.at
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch 21/25]  hvc_console: replace schedule_timeout() with msleep()
Date: Wed, 1 Sep 2004 15:30:34 -0700	[thread overview]
Message-ID: <20040901153034.35104957.akpm@osdl.org> (raw)
In-Reply-To: <E1C2cAg-0007UH-3I@sputnik>

janitor@sternwelten.at wrote:
>
> -#define TIMEOUT		((HZ + 99) / 100)
> +#define TIMEOUT		10
>  
>  static struct tty_driver *hvc_driver;
>  static int hvc_offset;
> @@ -276,8 +277,7 @@ int khvcd(void *unused)
>  			for (i = 0; i < MAX_NR_HVC_CONSOLES; ++i)
>  				hvc_poll(i);
>  		}
> -		set_current_state(TASK_INTERRUPTIBLE);
> -		schedule_timeout(TIMEOUT);
> +		msleep(TIMEOUT);

This one is wrong: we need to sleep in interruptible state here, otherwise
this kernel thread will contribute to the system load average.

Several other of your msleep conversion patches actually fix bugs.  You've
found drivers which want to sleep for a fixed period, but they do that with
TASK_INTERRUPTIBLE.  If someone sends the calling process a signal, these
drivers will end up not sleeping at all and may fail.

I'll going through these patches and shall apply the ones which look right.
Please consider them all to have been handled, thanks.


  reply	other threads:[~2004-09-01 22:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-01 20:57 janitor
2004-09-01 22:30 ` Andrew Morton [this message]
2004-09-01 23:08   ` maximilian attems
2004-09-01 23:36     ` Andrew Morton

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=20040901153034.35104957.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=janitor@sternwelten.at \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®