lkml.org 
[lkml]   [2003]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] might_sleep() improvements
From
Date
On Tue, 2003-09-02 at 03:51, Mitchell Blank Jr wrote:

> Andrew - I thought this might be appropriate for -mm kernels.
>
> This patch makes the following improvements to might_sleep():

Good. These checks are very useful.

> o Add a "might_sleep_if()" macro for when we might sleep only if some
> condition is met.

But I am neutral about this. One thing that BUG_ON() gives is that the
if has an unlikely() in it, so it at least guarantees some improved
semantics.

Another bit is that we have historically avoided conditional code (i.e.,
cruft like smp_if() etc. that you see elsewhere) like this. Maybe
renaming this "might_sleep_on()" at least brings it more in line with
BUG_ON(), and avoids looking like the gross constructs I fear.

> o Add might_sleep checks to skb_share_check() and skb_unshare() which
> sometimes need to allocate memory.

Great.

> o Make all architectures call might_sleep() in both down() and
> down_interruptible(). Before only ppc, ppc64, and i386 did this check.
> (sh did the check on down() but not down_interruptible())

Even better.

Robert Love


-
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/
On Tue, 2003-09-02 at 03:51, Mitchell Blank Jr wrote:

> Andrew - I thought this might be appropriate for -mm kernels.
>
> This patch makes the following improvements to might_sleep():

Good. These checks are very useful.

> o Add a "might_sleep_if()" macro for when we might sleep only if some
> condition is met.

But I am neutral about this. One thing that BUG_ON() gives is that the
if has an unlikely() in it, so it at least guarantees some improved
semantics.

Another bit is that we have historically avoided conditional code (i.e.,
cruft like smp_if() etc. that you see elsewhere) like this. Maybe
renaming this "might_sleep_on()" at least brings it more in line with
BUG_ON(), and avoids looking like the gross constructs I fear.

> o Add might_sleep checks to skb_share_check() and skb_unshare() which
> sometimes need to allocate memory.

Great.

> o Make all architectures call might_sleep() in both down() and
> down_interruptible(). Before only ppc, ppc64, and i386 did this check.
> (sh did the check on down() but not down_interruptible())

Even better.

Robert Love


-
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-03-22 13:48    [W:0.104 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site