Re: [PATCH/RFC] Futex mmap_sem deadlock

Joe Korty
2005-02-23T14:50:06Z

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