Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Dec 2010 11:40:59 -0500 (EST)
From:      Venkatesh Srinivas <vsrinivas@dragonflybsd.org>
To:        freebsd-hackers@freebsd.org
Subject:   i386 pmap_zero_page() late sched_pin()?
Message-ID:  <alpine.LFD.2.00.1012121130220.25740@centaur.acm.jhu.edu>

next in thread | raw e-mail | index | archive | help
Hi,

In the i386 pmap's pmap_zero_page(), there is a fragment...

 	sysmaps = &sysmaps_pcpu[PCPU_GET(cpuid)];
 	mtx_lock(&sysmaps->lock);
*	sched_pin();
 	/*map the page we mean to zero at sysmaps->CADDR2*/
 	pagezero(sysmaps->CADDR2);
 	sched_unpin();

I don't know this bit of code too well, so I don't know if the sched_pin() 
being where it is is okay or not. My first reading says its not okay; if a 
thread is moved to another CPU before it is able to pin, it will use the 
wrong sysmaps structure. Is this the case? Is it alright that the wrong 
sysmap structure is used?

Oh, Nathaniel Filardo (nwf@cs.jhu.edu) first spotted this, not I.

Thanks,
-- vs



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.LFD.2.00.1012121130220.25740>