public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin LaHaise <bcrl@redhat.com>
To: Dave Jones <davej@suse.de>,
	Linus Torvalds <torvalds@transmeta.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [patch] v2.5.22 - add wait queue function callback support
Date: Mon, 17 Jun 2002 16:53:40 -0400	[thread overview]
Message-ID: <20020617165340.F1457@redhat.com> (raw)
In-Reply-To: <20020617222812.I758@suse.de>; from davej@suse.de on Mon, Jun 17, 2002 at 10:28:12PM +0200

On Mon, Jun 17, 2002 at 10:28:12PM +0200, Dave Jones wrote:
> On Mon, Jun 17, 2002 at 04:14:34PM -0400, Benjamin LaHaise wrote:
>  > +#define add_wait_queue_cond(q, wait, cond) \
>  > +	({							\
>  > +		unsigned long flags;				\
>  > +		int _raced = 0;					\
>  > +		wq_write_lock_irqsave(&(q)->lock, flags);	\
> 
> I thought we killed off wq_write_lock_irqsave 1-2 kernels ago ?

Ah, I didn't notice that as I've not reached the point of merging 
everything into a working build -- I'd like to get some feedback 
and comments on the mergable units as they become available, since 
I'm rewriting a few portions to fix problems that experience with 
the code revealed.  Anyways, the patch below changes add_wait_queue_cond 
to use spin_locks directly.

		-ben

diff -urN wq-func-v2.5.22.diff/include/linux/wait.h wq-func-v2.5.22-b.diff/include/linux/wait.h
--- wq-func-v2.5.22.diff/include/linux/wait.h	Mon Jun 17 15:53:25 2002
+++ wq-func-v2.5.22-b.diff/include/linux/wait.h	Mon Jun 17 16:46:23 2002
@@ -106,7 +106,7 @@
 	({							\
 		unsigned long flags;				\
 		int _raced = 0;					\
-		wq_write_lock_irqsave(&(q)->lock, flags);	\
+		spin_lock_irqsave(&(q)->lock, flags);	\
 		(wait)->flags = 0;				\
 		__add_wait_queue((q), (wait));			\
 		rmb();						\
@@ -114,7 +114,7 @@
 			_raced = 1;				\
 			__remove_wait_queue((q), (wait));	\
 		}						\
-		wq_write_unlock_irqrestore(&(q)->lock, flags);	\
+		spin_lock_irqrestore(&(q)->lock, flags);	\
 		_raced;						\
 	})
 

  reply	other threads:[~2002-06-17 20:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-17 20:14 [patch] v2.5.22 - add wait queue function callback support Benjamin LaHaise
2002-06-17 20:28 ` Dave Jones
2002-06-17 20:53   ` Benjamin LaHaise [this message]
2002-06-17 21:02     ` Linus Torvalds
2002-06-17 22:09       ` Benjamin LaHaise
2002-06-17 22:20         ` Linus Torvalds
2002-06-17 20:57   ` Bob Miller
2002-06-17 21:08     ` Dave Jones
2002-06-17 21:23       ` Bob Miller
2002-06-17 21:12     ` Robert Love

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=20020617165340.F1457@redhat.com \
    --to=bcrl@redhat.com \
    --cc=davej@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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