NetBSD-Bugs archive

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

Re: PR/49328 CVS commit: src/sys/dev/pci/ixgbe



On Sun, Feb 01, 2015 at 11:30:57AM -0500, Christos Zoulas wrote:
> Yes, and my plan is to first fix the NOSLEEP allocation issues and then
> fix the driver so it does not do the deallocation/allocation needlessly.
> Here's the next patch for the first target...
> 
> Index: uvm_map.c
> ===================================================================
> RCS file: /cvsroot/src/sys/uvm/uvm_map.c,v
> retrieving revision 1.332
> diff -u -u -r1.332 uvm_map.c
> --- uvm_map.c	23 Jan 2015 16:13:53 -0000	1.332
> +++ uvm_map.c	1 Feb 2015 16:29:46 -0000
> @@ -1182,8 +1182,10 @@
>  	 * If the kernel pmap can't map the requested space,
>  	 * then allocate more resources for it.
>  	 */
> -	if (map == kernel_map && uvm_maxkaddr < (start + size))
> -		uvm_maxkaddr = pmap_growkernel(start + size);
> +	if (map == kernel_map && uvm_maxkaddr < (start + size)) {
> +		if (flags & UVM_FLAG_NOWAIT == 0)
> +			uvm_maxkaddr = pmap_growkernel(start + size);
> +	}
>  #endif
>  
>  	UVMMAP_EVCNT_INCR(map_call);


that is not legal.  pmap_growkernel() is not optional for kmem allocations
which increase the maximum kmem address in use.

and before you try to dive in and make a nowait version of pmap_growkernel(),
let's discuss if that's the way we want to resolve this.  it's currently
illegal to allocate kernel memory (even with nowait/nosleep) while holding a
spin mutex.  if we want to keep that restriction, then we just need to change
this one driver to not do that.  if we want to relax that restriction,
there a bunch of UVM and pmap changes needed.

-Chuck


Home | Main Index | Thread Index | Old Index