Re: [PATCH 6/9] uml: avoid malloc to sleep in atomic sections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Paolo 'Blaisorblade' Giarrusso" <[email protected]> wrote:
>
> +int __cant_sleep(void) {
> +	return in_atomic() || irqs_disabled() || in_interrupt();

aww, man, this is awful.  Code is supposed to know what context it's
running in, not go fishing about in core internals trying to fix up its own
confusion.

> +	/* Is in_interrupt() really needed? */
>  }

Yes, it is.  in_atomic() is a no-op on !PREEMPT and local irq's can be
enabled in soft- or hard- interrupt context, so irqs_disabled() will return
0.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux