Current-Users archive

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

Re: Panic: vrelel: bad ref count (9.99.54)



Hi Yorick,

On Fri, Nov 27, 2020 at 06:29:07PM +0200, Yorick Hardy wrote:
> 
> I think that uvm_mremap did not keep pace with changes in uvm.
> This patch seems to fix it for me, although I have only tested
> for two days so far (I am usually able to trigger the panic by
> now ... but lets see).

Your patch looks good, please go ahead and commit it.

-Chuck


> Leonardo, would you be willing to try the patch?
> 
> -- 
> Kind regards,
> 
> Yorick Hardy
> 
> Index: sys/uvm/uvm_mremap.c
> ===================================================================
> RCS file: /cvsroot/src/sys/uvm/uvm_mremap.c,v
> retrieving revision 1.20
> diff -u -r1.20 uvm_mremap.c
> --- sys/uvm/uvm_mremap.c	23 Feb 2020 15:46:43 -0000	1.20
> +++ sys/uvm/uvm_mremap.c	26 Nov 2020 19:14:06 -0000
> @@ -80,10 +80,8 @@
>  			error = E2BIG; /* XXX */
>  			goto done;
>  		}
> -		rw_enter(uobj->vmobjlock, RW_WRITER);
> -		KASSERT(uobj->uo_refs > 0);
> -		atomic_inc_uint(&uobj->uo_refs);
> -		rw_exit(uobj->vmobjlock);
> +		if (uobj->pgops->pgo_reference)
> +			uobj->pgops->pgo_reference(uobj);
>  		reserved_entry->object.uvm_obj = uobj;
>  		reserved_entry->offset = newoffset;
>  	}


Home | Main Index | Thread Index | Old Index