Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Dec 2008 10:12:06 +0800
From:      Ganbold <ganbold@micom.mng.net>
To:        Konstantin Belousov <kib@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r186433 - head/sys/dev/agp
Message-ID:  <49519A76.6010104@micom.mng.net>
In-Reply-To: <200812231604.mBNG4X91006629@svn.freebsd.org>
References:  <200812231604.mBNG4X91006629@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Konstantin Belousov wrote:
> Author: kib
> Date: Tue Dec 23 16:04:33 2008
> New Revision: 186433
> URL: http://svn.freebsd.org/changeset/base/186433
>
> Log:
>   Clear busy state on the pages which are after the one that failed the bind
>   attempt.
>   
>   Reported and tested by:	ganbold
>   Reviewed by:	rnoland
>   MFC after:	2 weeks
>
> Modified:
>   head/sys/dev/agp/agp.c
>
> Modified: head/sys/dev/agp/agp.c
> ==============================================================================
> --- head/sys/dev/agp/agp.c	Tue Dec 23 15:47:31 2008	(r186432)
> +++ head/sys/dev/agp/agp.c	Tue Dec 23 16:04:33 2008	(r186433)
> @@ -564,6 +564,7 @@ agp_generic_bind_memory(device_t dev, st
>  		device_printf(dev, "memory already bound\n");
>  		error = EINVAL;
>  		VM_OBJECT_LOCK(mem->am_obj);
> +		i = 0;
>  		goto bad;
>  	}
>  	
> @@ -592,7 +593,6 @@ agp_generic_bind_memory(device_t dev, st
>  				 * Bail out. Reverse all the mappings
>  				 * and unwire the pages.
>  				 */
> -				vm_page_wakeup(m);
>  				for (k = 0; k < i + j; k += AGP_PAGE_SIZE)
>  					AGP_UNBIND_PAGE(dev, offset + k);
>  				goto bad;
> @@ -622,8 +622,10 @@ agp_generic_bind_memory(device_t dev, st
>  bad:
>  	mtx_unlock(&sc->as_lock);
>  	VM_OBJECT_LOCK_ASSERT(mem->am_obj, MA_OWNED);
> -	for (i = 0; i < mem->am_size; i += PAGE_SIZE) {
> -		m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(i));
> +	for (k = 0; k < mem->am_size; k += PAGE_SIZE) {
> +		m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(k));
> +		if (k >= i)
> +			vm_page_wakeup(m);
>  		vm_page_lock_queues();
>  		vm_page_unwire(m, 0);
>  		vm_page_unlock_queues();
> _______________________________________________
> svn-src-all@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
>
>
>
>   

Thanks a lot.

Ganbold


-- 
Some books are to be tasted, others to be swallowed, and some few to be 
chewed and digested. -- Francis Bacon [As anyone who has ever owned a 
puppy already knows. Ed.]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49519A76.6010104>