Messages in this thread | | | From | Jakub Jelinek <> | Subject | Re: semaphore => spinlock in {get|put}name | Date | Mon, 9 Mar 1998 15:24:55 +0100 (MET) |
| |
> > Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz> writes: > > > Hi! > > > > Is there any reason why do we use an expensive semaphore instead of a cheap > > spinlock? > > I think the reason is that get_free_page(GFP_KERNEL) may sleep, also a spin > lock is a nop on UP (and UP needs it too because of the sleep).
But what I did in the patch was to move get_free_page out of the guarded area... Once we find out we need to get_free_page, we won't touch any shared variable, so we don't need to stay protected by the semaphore/spinlock...
Cheers, Jakub ___________________________________________________________________ Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz Administrator of SunSITE Czech Republic, MFF, Charles University ___________________________________________________________________ Ultralinux - first 64bit OS to take full power of the UltraSparc Linux version 2.1.89 on a sparc64 machine (498.80 BogoMips). ___________________________________________________________________
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu
| |