NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/56932: x68k frequently hangs up after uvm change in 9.99.75



The following reply was made to PR kern/56932; it has been noted by GNATS.

From: Chuck Silvers <chuq%chuq.com@localhost>
To: Tetsuya Isaki <isaki%pastel-flower.jp@localhost>, gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/56932: x68k frequently hangs up after uvm change in 9.99.75
Date: Tue, 26 Jul 2022 13:17:00 -0700

 --LcQpLW3uv3hruG60
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Tue, Jul 26, 2022 at 05:22:43PM +0900, Tetsuya Isaki wrote:
 > db> trace/a 84a440
 > mi_switch(84a440,7c6fbc,7e,15e836,0) + 2aa
 > sleepq_block(0,0,29a864,0,ffffffe4) + 1cc
 > turnstile_block(0,1,797e9c,29a864) + 2ce
 > rw_enter(797e9c,1,774700,797ea4,0) + e2
 > uvmpd_trylockowner(7746d0,2954c0,84a500,3979f54,87f) + 6e
 > uvmpdpol_selectvictim(3979f54,84a51c,1fcb4,40,84a440) + 1c4
 > uvm_pageout(84a440) + 16e
 > lwp_trampoline() + e
 
 the pagedaemon is getting stuck in the way that I expected it was.
 
 
 > db> trace/a 8bba40
 > trace: pid 726 lid 726 at 0x39ddbe4
 > mi_switch(8bba40,7c6fbc,29c300,204,8bba40) + 2aa
 > sleepq_block(0,0,29cc78,295440) + 1cc
 > uvm_wait(2564a5,797fec,41be000,1,0) + 80
 > pmap_enter_ptpage(83ce30,41be000,1) + 39a
 > pmap_enter(83ce30,41be000,6e8000,5,20) + cc
 > uvm_fault_internal(8eb910,41c1000,1,0,ffffffff) + baa
 > trap(39ddf60,8,4015162,41c1574) + 666
 > faultstkadj() + 4
 
 this thread is the problem.  it's calling uvm_wait() to wait
 for the pagedaemon to free memory while holding a page-owner lock
 (either a vm_anon or uvm_object lock), and this is no doubt
 the same lock that the pagedaemon is stuck on.
 
 the attached patch should fix this, please give it a try.
 
 -Chuck
 
 --LcQpLW3uv3hruG60
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="diff.m68k-pmap-ptpage.1"
 
 Index: src/sys/arch/m68k/m68k/pmap_motorola.c
 ===================================================================
 RCS file: /home/chs/netbsd/cvs/src/sys/arch/m68k/m68k/pmap_motorola.c,v
 retrieving revision 1.76
 diff -u -p -r1.76 pmap_motorola.c
 --- src/sys/arch/m68k/m68k/pmap_motorola.c	16 Apr 2022 18:15:21 -0000	1.76
 +++ src/sys/arch/m68k/m68k/pmap_motorola.c	26 Jul 2022 18:31:40 -0000
 @@ -2585,6 +2585,10 @@ pmap_enter_ptpage(pmap_t pmap, vaddr_t v
  					   va - vm_map_min(kernel_map),
  					   NULL, UVM_PGA_ZERO)) == NULL) {
  			rw_exit(uvm_kernel_object->vmobjlock);
 +			if (can_fail) {
 +				pmap->pm_sref--;
 +				return ENOMEM;
 +			}
  			uvm_wait("ptpage");
  			rw_enter(uvm_kernel_object->vmobjlock, RW_WRITER);
  		}
 
 --LcQpLW3uv3hruG60--
 


Home | Main Index | Thread Index | Old Index