Re: [patch] adaptive semaphores: better performance for "short semaphores" or "long spinlocks"

From: Arjan van de Ven (arjan@fenrus.demon.nl)
Date: Mon Feb 28 2000 - 01:58:25 EST


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/



This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:19 EST