linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: linux1394-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 2.6.17-mm1 4/3] ieee1394: convert ieee1394_transactions from semaphores to waitqueue
Date: Sun, 25 Jun 2006 19:27:16 +0200	[thread overview]
Message-ID: <449EC774.5060908@s5r6.in-berlin.de> (raw)
In-Reply-To: <tkrat.3f9c07538e381afd@s5r6.in-berlin.de>

I wrote on 2006-06-24:
> +	return wait_event_interruptible(tlabel_wq,
> +					!hpsb_get_tlabel_atomic(packet));

Hmm. "Linux Device Drivers" says about wait_event_interruptible(wq, 
condition): ''Note that @condition may be evaluated an arbitrary number 
of times, so it should not have any side effects.''

Alas the hpsb_get_tlabel_atomic() _does_ have a side effect, but only 
when !hpsb_get_tlabel_atomic(packet) is true.

The current implementation of wait_event_interruptible() seems to 
evaluate @condition multiple times if it is false but only _once_ while 
it is true. May I rely on this fact or do I have to rewrite the 
condition to be completely free of side effects?

I don't believe there would be ever a sensible implementation of 
wait_event_interruptible() which would evaluate @condition again after 
it became true.

Thanks,
-- 
Stefan Richter
-=====-=-==- -==- ==--=
http://arcgraph.de/sr/

      parent reply	other threads:[~2006-06-25 17:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <449BEBFB.60302@s5r6.in-berlin.de>
     [not found] ` <200606230904.k5N94Al3005245@shell0.pdx.osdl.net>
     [not found]   ` <30866.1151072338@warthog.cambridge.redhat.com>
     [not found]     ` <tkrat.df6845846c72176e@s5r6.in-berlin.de>
2006-06-24  9:32       ` [RFC PATCH 2.6.17-mm1 1/3] ieee1394: reduce size of hpsb_host by 252 bytes Stefan Richter
2006-06-24  9:33         ` [RFC PATCH 2.6.17-mm1 2/3] ieee1394: coarser locking for tlabel allocation Stefan Richter
2006-06-24  9:35           ` [RFC PATCH 2.6.17-mm1 3/3] ieee1394: nodemgr: read tlabel attributes atomically Stefan Richter
2006-06-24 17:32             ` [RFC PATCH 2.6.17-mm1 4/3] ieee1394: convert ieee1394_transactions from semaphores to waitqueue Stefan Richter
2006-06-24 17:45               ` Stefan Richter
2006-06-24 18:12                 ` Arjan van de Ven
2006-06-24 20:28                   ` Stefan Richter
2006-06-24 20:56                     ` Stefan Richter
2006-06-25 19:37                   ` [RFC PATCH 2.6.17-mm1 5/3] ieee1394: raw1394: remove redundant counting semaphore Stefan Richter
2006-06-25 19:54                     ` Stefan Richter
2006-06-25 17:27               ` Stefan Richter [this message]

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=449EC774.5060908@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.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;
as well as URLs for NNTP newsgroup(s).