lkml.org 
[lkml]   [1998]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: semaphore => spinlock in {get|put}name
Date
> 
> 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

\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.044 / U:0.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site