Re: [PATCH/RFC] Futex mmap_sem deadlock

From: Joe Korty
Date: Wed Feb 23 2005 - 09:51:48 EST


On Tue, Feb 22, 2005 at 01:30:27PM -0800, Linus Torvalds wrote:
>
> We really have this already, and it's called "current->preempt". It
> handles any lock at all, and doesn't add yet another special case to all
> the architectures.
>
> Just do
>
> repeat:
> down_read(&current->mm->mmap_sem);
> get_futex_key(...) etc.
> queue_me(...) etc.
> inc_preempt_count();
> ret = get_user(...);
> dec_preempt_count();

Perhaps this should be preempt_disable .... preempt_enable.

Otherwise, a preempt attempt in get_user would not be seen
until some future preempt_enable was executed.

Regards,
Joe
--
"Money can buy bandwidth, but latency is forever" -- John Mashey
-
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/