lkml.org 
[lkml]   [2002]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] fast reader/writer lock for gettimeofday 2.5.30
From
Date
>  The following patch generalizes Andrea's trick of using sequence numbers
> to create a reader region/writer lock. It against the 2.5.30 kernel.

Ah! Very nice! I have hit the xtime_lock starvation issue, and was
looking to implement something like vxtime_lock to help it (I'm also
hoping to port the vsyscall gtod to i386 as well).

> A new composite primitive 'frlock' is defined in include/linux/frlock.h
> and used to replace the rwlock xtime_lock enforce consistent access to
> the clock time variables.

My only comment is that while you have wrapped it up nicely, I'm not
sure this locking algorithm is worth generalizing. While the vxtime_lock
implementation for x86-64 might take a bit to grasp, the macros are very
short, fairly straight forward, and difficult to confuse with a standard
spin/rw_lock. Additionally, the extra complexity of managing the
sequence number isn't really being hidden (and really, I'm not sure how
one would hide it).

Maybe I'm just partial to the way Andrea did it (especially considering
I'd like to use the lock from userspace as well), but regardless this
style of rwlock is definitely needed for the xtime_lock. Very cool!

thanks
-john


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

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