lkml.org 
[lkml]   [1998]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: global kernel lock
On Fri, Nov 13, 1998 at 09:33:18PM +0100, Linus Torvalds wrote:
>
>
>
> Yes. You missed kswapd and synchronous processes trying to make more
> memory available, walking and modifying page tables behind your back
> unless you hold the kernel lock.

Thank you for correcting me.

>
> That's why we can unlock early in the (very common) case of doing an new
> anonymous page: nobody is going to _add_ entries to the page tables
> without holding the mm semaphore, and the anonymous page case doesn't need
> the kernel lock for anything else either.

There seems to be another race: running do_anonymous_page outside the global
lock relies on put_page/set_pte being atomic.

set_pte is

#define set_pte(pteptr, pteval) ((*(pteptr)) = (pteval))

on i386. Nobody gurantees that gcc generates an atomic sequence for this
statement, also it needs a memory barrier to avoid SMP inconsisties.

-Andi

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

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.042 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site