public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] volatile may be needed in rwsem
@ 2004-01-27 19:11 Joe Korty
  2004-01-27 19:19 ` David Howells
  2004-01-27 20:20 ` Christian Borntraeger
  0 siblings, 2 replies; 5+ messages in thread
From: Joe Korty @ 2004-01-27 19:11 UTC (permalink / raw)
  To: dhowells, akpm; +Cc: linux-kernel

'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
 };


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-01-27 20:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-27 19:11 [PATCH] volatile may be needed in rwsem Joe Korty
2004-01-27 19:19 ` David Howells
2004-01-27 19:43   ` Joe Korty
2004-01-27 20:23     ` Paulo Marques
2004-01-27 20:20 ` Christian Borntraeger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox