Re: [PATCH] might_sleep() improvements

From: Mitchell Blank Jr
Date: Tue Sep 02 2003 - 13:35:26 EST


Robert Love wrote:
> > o Add a "might_sleep_if()" macro for when we might sleep only if some
> > condition is met.
>
> But I am neutral about this.

That's understandable - I have some of the same reservations myself. In
the end I think it's a slight win though.

> 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.

I named it that at first but I was afraid that someone might get confused
and thing the semantics were "might_sleep_on(&waitqueue)" since 'sleeping
on' means something already. To me might_sleep_if(cond) looked a lot
clearer at first glance.

-Mitch
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Robert Love wrote:
> > o Add a "might_sleep_if()" macro for when we might sleep only if some
> > condition is met.
>
> But I am neutral about this.

That's understandable - I have some of the same reservations myself. In
the end I think it's a slight win though.

> 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.

I named it that at first but I was afraid that someone might get confused
and thing the semantics were "might_sleep_on(&waitqueue)" since 'sleeping
on' means something already. To me might_sleep_if(cond) looked a lot
clearer at first glance.

-Mitch
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/