lkml.org 
[lkml]   [2000]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] adaptive semaphores: better performance for "short semaphores" or "long spinlocks"
In article <38B94CE3.D4ADA16@ping.at> you wrote:
> This is a multi-part message in MIME format.
> --------------C89BA4843543D457680F848F
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit

> This patch adds two functions (down_spin and down_adapt) that try
> to address the problems of

> - semaphores that are generally held for a very short time, so
> scheduling on contention is very inefficient in most cases,
> but still necessary in some others (to avoid deadlocks)

> - spinlocks that are occasionally held for a long time, so scheduling
> would be efficient in some cases - but that have sometimes to be
> taken where scheduling simply is not allowed.

Nice idea! One more thought: Would it be possible (and useful) if the time
spent in spinning is changed dynamically?
I mean:
1) If a lock needed schedule the previous time, decrease the time
spinning for the next time the lock is contented
2) If a lock didn't need to schedule, have a little more patience
and spin somewhat longer the next time

The heuristic can look a bit like the read-ahead in the vfs....

Greetings,
Arjan van de Ven


-
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:56    [W:0.056 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site