Re: [PATCH][CFT] dcache-ac7-J - dcache threading

From: Tigran Aivazian (
Date: Sat Jun 03 2000 - 14:46:19 EST

On Sat, 3 Jun 2000, Alexander Viro wrote:
> Please, try it. Thing is on
> Unless I'm seroiusly mistaken, big lock ceased to be the main source of
> contention (and no, it's not because other sources had grown ;-) Results
> of testing with different loads are more than appreciated, indeed.

The patch looks very impressive (and I only read the first 1466 lines
yet) and the first comment I have is:

diff -urN linux-2.4.0-test1-ac7/drivers/sgi/char/shmiq.c
--- linux-2.4.0-test1-ac7/drivers/sgi/char/shmiq.c Thu Jun 1
11:42:06 2000
+++ linux-bird.vfs-0/drivers/sgi/char/shmiq.c Sat Jun 3 02:34:58 2000
@@ -279,7 +279,9 @@
                s = req.arg * sizeof (struct shmqevent) + sizeof (struct
                v = sys_munmap (vaddr, s);
+ down(&current->mm->mmap_sem);
                do_mmap (filp, vaddr, s, PROT_READ | PROT_WRITE,
+ up(&current->mm->mmap_sem);
                shmiqs [minor].events = req.arg;

isn't it better to move down() up before sys_munmap() and change
sys_munmap() to do_munmap() - that saves:

a) extra function call

b) extra up() semaphore operation

c) &current->mm is probably known to the compiler at the caller's level
  - no need to recalculate it inside sys_munmap() (not certain on this one
  - just a guess)


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:17 EST