lkml.org 
[lkml]   [1999]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC/RFT/PATCH] i386 rw semaphore/spinlocks + use for mmap_sem
"Benjamin C.R. LaHaise" wrote:
>
> 'loo folks,
>
> Okay, here's take two (actually 6) on the rw semaphores, with the same
> technique used for rw spinlocks,

1) you have removed one optimization: the old code needed _no_ register
if the spinlock was stored global variable (such as the tasklist_lock),
now you always clobber the %%eax register.

This might increase the register pressure, but I don't know if egcs
actually uses the %%eax register across "asm volatile".

2) the rw spinlock must starve writers, or you risk a lock-up with
interrupts:

CPU1: CPU2:
read_lock(&lock);
write_lock_irq(&lock);
<hardware interrupt>
<within hardware interrupt:>
read_lock(&lock);
; lock-up! write_lock() must release the lock before spinning.

AFAICS, you hold the lock while spinning.

--
Manfred


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

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