mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, mingo@elte.hu, rml@tech9.net,
	Alasdair G Kergon <agk@redhat.com>, Milan Broz <mbroz@redhat.com>
Subject: Re: Active waiting with yield()
Date: Tue, 18 Nov 2008 14:40:53 +0000	[thread overview]
Message-ID: <20081118144053.0072d54c@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.64.0811180921450.12274@hs20-bc2-1.build.redhat.com>

> You will touch the wait queue always when finishing the last pending 
> request --- just to find out that there is no one waiting on it.

Why ? If my fast path for this something like

	if (unlikely(foo->unload_pending) && count == 0)
		wake_up(..)

chances are that I can put unload_pending somewhere in a cache line with
other stuff (certainly for L2) and it will get predicted well.

> And besides cache line, there is coding and testing overhead with wait 
> queues.

If you want correctness you don't want busy waiting with yields - as Ingo
pointed out already thats a bug in itself with hard realtime.

> So what are the reasons why you (and others) are against active waiting? 
> All you are saying is that my reasons are wrong, but you haven't single 
> example when active waiting causes trouble. If there is a workload when 

Untrue - I've given very clear reasons twice, and Ingo has given you
more. If you don't wish to accept the answers that is your problem not
mine, just expect such hacks to get a NAK and not make the kernel.

Alan
--
"I can only provide the information, I can't make you hear it."
		- Shelley Bainter


  reply	other threads:[~2008-11-18 14:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-14 18:59 Mikulas Patocka
2008-11-14 19:06 ` Alan Cox
2008-11-14 19:34   ` Mikulas Patocka
2008-11-14 20:57     ` Peter Zijlstra
2008-11-14 21:41       ` Mikulas Patocka
2008-11-15 22:55         ` Peter Zijlstra
2008-11-17 17:39           ` Mikulas Patocka
2008-11-17 18:01             ` Alan Cox
2008-11-18 14:34               ` Mikulas Patocka
2008-11-18 14:40                 ` Alan Cox [this message]
2008-11-18 17:11                   ` Mikulas Patocka
2008-11-18 21:26                     ` Alan Cox
2008-11-20  9:18                       ` Mikulas Patocka
2008-11-19 16:14                     ` Peter Zijlstra
2008-11-18 14:49                 ` Arjan van de Ven
2008-11-18 17:14                   ` Mikulas Patocka
2008-11-14 21:21     ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081118144053.0072d54c@lxorguk.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=agk@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbroz@redhat.com \
    --cc=mingo@elte.hu \
    --cc=mpatocka@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rml@tech9.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®