public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Korty <joe.korty@ccur.com>
To: dhowells@redhat.com, akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] volatile may be needed in rwsem
Date: Tue, 27 Jan 2004 14:11:55 -0500	[thread overview]
Message-ID: <20040127191155.GA12128@tsunami.ccur.com> (raw)

'flags' should be declared volatile as rwsem_down_failed_common() spins
waiting for this to change.  Untested.

Against 2.6.1.


diff -Nua 2.6/lib/rwsem-spinlock.c.0 2.6/lib/rwsem-spinlock.c
--- 2.6/lib/rwsem-spinlock.c.0	2004-01-27 14:03:46.000000000 -0500
+++ 2.6/lib/rwsem-spinlock.c	2004-01-27 14:03:38.000000000 -0500
@@ -12,7 +12,7 @@
 struct rwsem_waiter {
 	struct list_head	list;
 	struct task_struct	*task;
-	unsigned int		flags;
+	volatile unsigned int	flags;
 #define RWSEM_WAITING_FOR_READ	0x00000001
 #define RWSEM_WAITING_FOR_WRITE	0x00000002
 };
diff -Nua 2.6/lib/rwsem.c.0 2.6/lib/rwsem.c
--- 2.6/lib/rwsem.c.0	2004-01-27 14:03:46.000000000 -0500
+++ 2.6/lib/rwsem.c	2004-01-27 14:03:19.000000000 -0500
@@ -10,7 +10,7 @@
 struct rwsem_waiter {
 	struct list_head	list;
 	struct task_struct	*task;
-	unsigned int		flags;
+	volatile unsigned int	flags;
 #define RWSEM_WAITING_FOR_READ	0x00000001
 #define RWSEM_WAITING_FOR_WRITE	0x00000002
 };


             reply	other threads:[~2004-01-27 19:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-27 19:11 Joe Korty [this message]
2004-01-27 19:19 ` [PATCH] volatile may be needed in rwsem David Howells
2004-01-27 19:43   ` Joe Korty
2004-01-27 20:23     ` Paulo Marques
2004-01-27 20:20 ` Christian Borntraeger

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=20040127191155.GA12128@tsunami.ccur.com \
    --to=joe.korty@ccur.com \
    --cc=akpm@osdl.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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