Re: s/PF_BORROWED_MM/PF_KTHREAD/ (was: kernel warning: tried tokill an mm-less task!)

From: Jeff Dike
Date: Tue Apr 15 2008 - 13:12:38 EST


On Tue, Apr 15, 2008 at 02:19:05PM +0400, Oleg Nesterov wrote:
> First, include/asm-um/mmu_context.h:activate_mm() doesn't look right to me,
> use_mm() does switch_mm(), not activate_mm(), so I think we can do
>
> --- include/asm-um/mmu_context.h 2008-02-17 23:40:08.000000000 +0300
> +++ - 2008-04-15 13:35:34.089295980 +0400
> @@ -29,7 +29,7 @@ static inline void activate_mm(struct mm
> * host. Since they're very expensive, we want to avoid that as far as
> * possible.
> */
> - if (old != new && (current->flags & PF_BORROWED_MM))
> + if (old != new)
> __switch_mm(&new->context.id);
>
> arch_dup_mmap(old, new);

I'm thinking I can just change this to call switch_mm, getting rid of
the old != new test too.

Plus, you can get rid of the comment in use_mm about UML needing
PF_BORROWED_MM.

I'll test this to make sure.

Jeff

--
Work email - jdike at linux dot intel dot com
--
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/