lkml.org 
[lkml]   [2009]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [rfc] "fair" rw spinlocks


On Mon, 30 Nov 2009, Nick Piggin wrote:
>
> Two questions. Firstly, does tasklist_lock benefit much from read
> side paralellism? Looking at some of the critical sections some seem
> to hold it for quite a while (over task and thread iterations). So
> it might not be the right thing to convert it to a spinlock?

I do agree that it's a potential problem.

> Secondly:
>
> > static void tasklist_read_lock(void)
> > {
> > preempt_disable();
> > if (!current->tasklist_count++)
>
> What happens if an interrupt and nested tasklist_read_lock() happens
> here?

You're right. We'd still need to disable hardware interrupts. Very
annoying, because that is pretty much _guaranteed_ to eat up any advantage
of the faster spin_unlock path.

So scratch that approach. My earlier suggestion still looks technically
correct, but has all the performance disadvantages.

The best option really would be to try to make it all use RCU, rather than
paper over things. That _really_ should improve performance.

Linus


\
 
 \ /
  Last update: 2009-11-30 18:21    [W:0.116 / U:1.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site