lkml.org 
[lkml]   [1999]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: 2.3 Pagedir allocation/free and update races
Date
> 
> From: kanoj@google.engr.sgi.com (Kanoj Sarcar)
> Date: Tue, 14 Dec 1999 15:00:19 -0800 (PST)
>
> Yes, I am sorry for the misleading logic in my note. Per-cpu caches are
> safe (I wonder why it was taken out for i386). For architectures that
> have to do set_pgdir() though, the pgdir update code might be racy,
> unless the arch code has locks to protect the page directory scanning.
>
> Btw, Linus indicated to me he ran into problems with the patch, and
> will be pulling it out in the next pre-release. I will take a closer look
> at the code.
>
> Just handle the set_pgdir() stuff like this:
>
> pgcache_update_flag = 0;
> smp_call_func(ALL_CPUS, update_pgcaches_and_wait_on_flag);
> update_local_pgcache();
> pgcache_update_flag = 1;
> for_each_task(tsk)
> update_pgdir(tsk);

As I mentioned, there are possibly multiple ways in which this can
be fixed. Note that mmlists are not needed solely for set_pgdir().

David, unless I am mistaken (which is happening fairly frequently),
in your solution, set_pgdir() is going to miss a page directory that
a parent has allocated for a child, but the child is not yet on the
tasklist. Yes, the arch code can keep a list of all allocated page
directories ... I am just trying to come up with a solution that
will work for most architectures, where the common case is that
the pgdir cache does not have a lock because it is percpu.

Kanoj

>
> That should give the correct synchronization with zero cost
> for the fast normal paths which can rely solely on the cpu
> localness of the data structure.
>
> Later,
> David S. Miller
> davem@redhat.com
>


-
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:55    [W:0.039 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site