linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <piggin@cyberone.com.au>
To: torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] might_sleep() improvements
Date: Tue, 02 Sep 2003 18:44:51 +1000	[thread overview]
Message-ID: <3F545883.8090800@cyberone.com.au> (raw)
In-Reply-To: <bj1kr3$a2g$1@build.pdx.osdl.net>



Linus Torvalds wrote:

>Nick Piggin wrote:
>
>>I think these should be pushed down to where the sleeping
>>actually happens if possible.
>>
>
>No, that ends up doing the wrong thing for most of the really common cases.
>
>In particular, most of the memory allocation functions very seldom actually
>sleep. After all, they'll find plenty of free memory (or easily freeable
>memory) without having to wait for any pageouts or anything like that.
>
>Yet the bug is there - the call _could_ have slept.
>
>So "might_sleep()" really does what the name suggests: it is used to say
>that a particular case _may_ sleep, even if it ends up being unlikely.
>
>Because what we're after is not a bug actually happening, but a latent bug
>that has been hidden by the fact that it happens so rarely in practice.
>
>This is why "might_sleep()" should happen as early as possible, and not
>get pushed down.
>
>

Yes I see. I agree. I thought some could be pushed down further without
losing info. I was mainly worried about adding the might_sleep_if
function.



  reply	other threads:[~2003-09-02  8:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-02  7:51 [PATCH] might_sleep() improvements Mitchell Blank Jr
2003-09-02  8:14 ` Nick Piggin
2003-09-02  8:32   ` Mitchell Blank Jr
2003-09-02  8:39     ` Nick Piggin
2003-09-02  8:36   ` Linus Torvalds
2003-09-02  8:44     ` Nick Piggin [this message]
2003-09-02 13:55 ` Robert Love
2003-09-02 18:39   ` Mitchell Blank Jr
2003-09-09  3:10     ` Rob Landley

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=3F545883.8090800@cyberone.com.au \
    --to=piggin@cyberone.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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;
as well as URLs for NNTP newsgroup(s).