Re: [patch] __flush_one_page() on i386

Andrea Arcangeli (andrea@suse.de)
Thu, 16 Sep 1999 15:47:06 +0200 (CEST)


On Thu, 16 Sep 1999, Alan Cox wrote:

>> In 2.3.18 __flush_one_page() actually is called by flush_tlb_page() in
>> smp.c and flush_tlb_page is called by kswapd. kswapd has no current->mm so
>> then flush_tlb_current_page() oopses because current->mm is null and it's
>> trying to dereference it to flush the mm of the current (kswapd) task.
>
>For this latter item would it not be better to give kswapd and everything else
>a valid mm (eg the task 0 mm), just to be more regular

AFIK Linus removed such &init_mm thing because tsk->mm == 0 is more
regular in his opinion.

The tsk->mm == 0 thing Oopses because the i386 version of
__flush_one_page() is buggy (and my patch fixes the bug). With the bug
fixed the new tsk->mm == 0 logic (should) work fine on i386 too without
further changes. And just to avoid mistakes: with "i386" this time I mean
a real 386 and not a 486 or Pentium with the invlpg instruction ;).

As last thing tsk->mm == 0 is faster as the asm doesn't need to play with
the &init_mm address (the zero version will work with a plain testl on the
tsk->mm value).

Andrea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/