On Thu, 22 Apr 2021 15:38:53 +0200, Martin Pieuchot <m...@openbsd.org> 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.
> 
> I'd be interested to have this tested and see how much does that impact
> the build time of packages.
> 
> We should be able to do the switch on an arch-by-arch basis.  It's
> easier for me to develop & debug on these two architectures so I started
> with them.  If you want to unlock another architecture and report back,
> I'd be glad.
> 
> Thanks,
> Martin

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

Reply via email to