On Thu, 22 Apr 2021 17:06:00 -0400, Scott Bennett <[email protected]> 
wrote:
> On Thu, 22 Apr 2021 15:38:53 +0200, Martin Pieuchot <[email protected]> wrote:
> > Diff below remove the KERNEL_LOCK()/UNLOCK() dance from uvm_fault() for
> > both amd64 and sparc64.  That means the kernel lock will only be taken
> > for lower faults and some amap/anon code will now run without it.
>
> Hi Martin,
> 
> I'd be willing to test this on octeon. However, with my poor little EdgeRouter
> Lite, I would only be able to test building a few packages.
> 
> Would this be the correct diff for octeon?
> 
> diff 5fe2fdbf987b2faadb61c6a00cf1dd30ab3e7fa6 /usr/src
> blob - 6530ef75203fbea02a4f1aaca62e4e78a81f4cdf
> file + sys/arch/mips64/mips64/trap.c
> --- sys/arch/mips64/mips64/trap.c
> +++ sys/arch/mips64/mips64/trap.c
> @@ -340,9 +340,7 @@ itsa(struct trapframe *trapframe, struct cpu_info *ci,
>                       va = trunc_page((vaddr_t)trapframe->badvaddr);
>                       onfault = pcb->pcb_onfault;
>                       pcb->pcb_onfault = 0;
> -                     KERNEL_LOCK();
>                       rv = uvm_fault(kernel_map, va, 0, access_type);
> -                     KERNEL_UNLOCK();
>                       pcb->pcb_onfault = onfault;
>                       if (rv == 0)
>                               return;
> @@ -421,9 +419,7 @@ fault_common_no_miss:
>  
>               onfault = pcb->pcb_onfault;
>               pcb->pcb_onfault = 0;
> -             KERNEL_LOCK();
>               rv = uvm_fault(map, va, 0, access_type);
> -             KERNEL_UNLOCK();
>               pcb->pcb_onfault = onfault;
>  
>               /*
> 

I tested the above by doing a kernel build and building one package
(lang/tcl/8.6). The system was stable, but the build times were virtually
the same. I used a snapshot from April 27 and applied my diff to sources
checked out on April 27.

kernel build times:

Before diff:
erl$ time make -j 2
   63m31.25s real   113m05.96s user    11m52.75s system

After diff:
erl$ time make -j 2
   63m09.83s real   112m49.24s user    11m33.18s system


lang/tcl/8.6 build times:

Before diff:
erl$ time make build
   39m04.35s real    34m35.00s user     3m43.20s system

After diff:
erl$ time make build
   39m04.12s real    34m34.70s user     3m41.03s system

Reply via email to