lkml.org 
[lkml]   [2010]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH/RFC] mutex: Fix optimistic spinning vs. BKL
Date
On Wednesday 28 April 2010, Benjamin Herrenschmidt wrote:
> Now, we -could- make it a bit smarter about the BKL by introducing a
> contention counter and only go out if we own the BKL and it is contended,
> but I didn't feel like this was worth the effort, time is better spent
> removing the BKL from sensitive code path instead.

Agreed.

> - for (;;) {
> + for (timeout = jiffies + 2; jiffies < timeout;) {
> [...]
> - for (;;) {
> + while (jiffies < timeout) {

This needs to use time_before() to avoid problems on jiffies wraparound.

Arnd


\
 
 \ /
  Last update: 2010-04-28 14:09    [W:0.076 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site