[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081114212102.2313a8a3@lxorguk.ukuu.org.uk>
Date: Fri, 14 Nov 2008 21:21:02 +0000
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Mikulas Patocka <mpatocka@...hat.com>
Cc: linux-kernel@...r.kernel.org, mingo@...e.hu, rml@...h9.net,
Alasdair G Kergon <agk@...hat.com>,
Milan Broz <mbroz@...hat.com>
Subject: Re: Active waiting with yield()
> If I have a race condition that gets triggered just for one user in the
> world when repeatedly loading & unloading a driver for an hour, and I use
> yield() to solve it, what's wrong with it? A wait queue increases cache
> footprint for every user. (even if I use preallocated hashed wait queue,
> it still eats a cacheline to access it and find out that it's empty)
Reread what I wrote.
You don't need to use a hashed queue, you don't need to even reference
the queue in the normal case. You cost is one variable, which you can
probably sensibly locate, and a predicted jump.
For that you get proper sleeping behaviour, CPU used by other tasks or
guests and you don't hang on hard real time tasks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists