mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: linux-kernel@vger.kernel.org, mochel@digitalimplant.org
Subject: Re: swsusp: clean up reading
Date: Sat, 11 Sep 2004 16:19:46 -0700	[thread overview]
Message-ID: <20040911161946.6f064c77.akpm@osdl.org> (raw)
In-Reply-To: <20040910085405.GC12751@elf.ucw.cz>

Pavel Machek <pavel@ucw.cz> wrote:
>
>  -static void wait_io(void)
>  -{
>  -	while(atomic_read(&io_done))
>  -		io_schedule();
>  -}
>  -
>  -
>   static struct block_device * resume_bdev;
>   
> ...
> 
>  -	wait_io();
>  +	while (atomic_read(&io_done))
>  +		yield();

This doesn't seem to be much of an improvement, really.  It still runs the
risk that the caller might have SCHIED_FIFO policy and we end up in a
spinloop until I/O completion.

Why not stick a `struct completion' at bio->bi_private, do complete() in
the end_io handler and wait_for_completion() in the caller?

I'll add the current patch to -mm for now, thanks.

      reply	other threads:[~2004-09-11 23:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-10  8:54 Pavel Machek
2004-09-11 23:19 ` Andrew Morton [this message]

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=20040911161946.6f064c77.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@digitalimplant.org \
    --cc=pavel@ucw.cz \
    /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

Powered by JetHome