Re: [PATCH] Priority-based real-time futexes [Try two, stupid

Robert Love (rml@tech9.net)
18 Oct 2002 23:18:47 -0400


On Fri, 2002-10-18 at 22:57, Perez-Gonzalez, Inaky wrote:

> I have completed the priority-based futex support; now the code
> behaves well completely, as futex_fd and poll() work as before, but
> priority based. So, tasks that are sleeping on a futex get waken up by
> priority order. This is useful for real-time locking, with most
> benefits being for the NGPT and NPTL thread libraries.

Very useful for real-time tasks...

I did not think NPTL did real-time threads, though?

> - I don't remember if it is safe to call kmalloc with GFP_KERNEL from
> inside an spinlock. Common sense says NO to me - just in case, in
> the areas where I need it, I use GFP_ATOMIC. Any confirmations?

No, it is not safe as then you can sleep and consequently deadlock.

GFP_ATOMIC is the fix but be weary of how much memory you allocate and
make sure you always check for failure and have some course of action
there.

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/