Re: [PATCH] rework/fix is_single_threaded()

From: Oleg Nesterov
Date: Thu Jul 09 2009 - 17:28:58 EST


On 07/09, David Howells wrote:
>
> Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> > David, do you still dislike ->mmap_sem? I didn't see other objections,
> > and again, imho tasklist_lock is worse.
>
> My main objection to taking mmap_sem is that it restricts where the function
> can be used. It can't, for example, be called by anyone holding a spinlock.

Yes, it is might_sleep().

> Furthermore, the more locks, the more chance of someone accidentally
> deadlocking something.

The current code is not lockless too, tasklist_lock is not free and
can lead too deadlocks as well.

Anyway. I agree it is better to avoid ->mmap_sem, I'll send the patch
in a minute. But I'd really like to do this in a separate patch, the
change is subtle and needs a changelog at least.

> But apart from that, go for it.

Great, thanks. Then I'll make the patch on top.

Oleg.

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