Subject: Re: kern/34892: panic: lockmgr: no context, when freeing sigacts in
To: None <gnats-bugs@NetBSD.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: netbsd-bugs
Date: 12/12/2006 15:50:09
> >Number:         34892
> >Category:       kern
> >Synopsis:       panic: lockmgr: no context

> >Description:
> panic: lockmgr: no context
> Stopped at      netbsd:cpu_Debugger+0x4:        leave
> db> t
> cpu_Debugger(ce3eda0c,e044,ce3eda2c,ce3eda18,10022) at netbsd:cpu_Debugger+0x4
> panic(c07f874b,e09934b4,ce3eda5c,c036a31c,ce3eda48) at netbsd:panic+0x141
> lockmgr(c08de9a4,10022,c08dea4c,81,c263f780) at netbsd:lockmgr+0x861
> uvm_unmap1(c08de9a0,fac40000,fac60000,2800000,0) at netbsd:uvm_unmap1+0x4d
> km_vacache_free(c08dea78,fac40000,74629163,ce3edad0,44d) at netbsd:km_vacache_free+0x29
> pool_allocator_free(c08de9a0,fac40000,ce3edb04,ce3edb04,cf7db350) at netbsd:pool_allocator_free+0xe
> pr_pagelist_free(44d,0,ce3edb4c,fac40fdc,0) at netbsd:pr_pagelist_free+0x34
> pool_put(c08dea78,fac40000,ce3edb74,0,44d) at netbsd:pool_put+0x28
> pool_allocator_free(0,0,ce3edb64,ce3edb64,cf7db350) at netbsd:pool_allocator_free+0xe
> pr_pagelist_free(0,0,0,0,0) at netbsd:pr_pagelist_free+0x34
> pool_put(c08fd8c0,fac40404,ce3edbfc,246,cf7db350) at netbsd:pool_put+0x28
> sigactsfree(fac40404,cf7db350,ce3edbfc,c03dc5af,1000) at netbsd:sigactsfree+0x2a
> exit1(de5eaf50,0,e32c8d0c,de5eaf50,0) at netbsd:exit1+0x3ca
> sys_exit(de5eaf50,ce3edc48,ce3edc68,0,bbbcc000) at netbsd:sys_exit+0x31
> syscall_plain() at netbsd:syscall_plain+0x155
> --- syscall (number 1) ---
> 0xbbbc693f:

the problem is that, while pool_put is considered as non-sleepable by
many of callers, freeing the kva into kernel_map needs to sleep.
i think the similar problem can happen with pool_get(NOWAIT),
when it involves pool_reclaim.

for long term, i want to replace in-kernel kva allocator with vmem,
so that freeing non-pageable kva doesn't need to sleep.  ie. register only
pageable mappings to kernel_map.

YAMAMOTO Takashi