Nicolas Pitre
d6f029130f
[PATCH] fix race with preempt_enable()
...
Currently a simple
void foo(void) { preempt_enable(); }
produces the following code on ARM:
foo:
bic r3, sp, #8128
bic r3, r3, #63
ldr r2, [r3, #4 ]
ldr r1, [r3, #0 ]
sub r2, r2, #1
tst r1, #4
str r2, [r3, #4 ]
blne preempt_schedule
mov pc, lr
The problem is that the TIF_NEED_RESCHED flag is loaded _before_ the
preemption count is stored back, hence any interrupt coming within that
3 instruction window causing TIF_NEED_RESCHED to be set won't be
seen and scheduling won't happen as it should.
Nothing currently prevents gcc from performing that reordering. There
is already a barrier() before the decrement of the preemption count, but
another one is needed between this and the TIF_NEED_RESCHED flag test
for proper code ordering.
Signed-off-by: Nicolas Pitre <nico@cam.org >
Acked-by: Nick Piggin <nickpiggin@yahoo.com.au >
Signed-off-by: Linus Torvalds <torvalds@osdl.org >
2005-12-22 09:17:39 -08:00
..
2005-12-12 08:57:44 -08:00
2005-11-28 21:00:29 +00:00
2005-12-18 16:28:24 -08:00
2005-11-14 15:24:59 -08:00
2005-11-20 21:11:31 -08:00
2005-11-07 07:53:48 -08:00
2005-11-09 07:56:40 -08:00
2005-11-07 07:53:48 -08:00
2005-11-13 18:14:17 -08:00
2005-11-13 18:14:16 -08:00
2005-11-29 16:16:41 -08:00
2005-11-14 19:55:16 -08:00
2005-11-12 10:56:06 +01:00
2005-12-16 10:52:46 -08:00
2005-11-18 22:00:17 +01:00
2005-11-13 18:14:10 -08:00
2005-12-12 08:57:42 -08:00
2005-11-16 00:52:57 -08:00
2005-11-10 15:33:38 -08:00
2005-11-07 07:53:52 -08:00
2005-11-28 14:42:23 -08:00
2005-11-07 18:18:11 -08:00
2005-11-17 16:23:43 +00:00
2005-11-17 16:23:42 +00:00
2005-12-12 22:31:17 -08:00
2005-11-13 18:14:10 -08:00
2005-11-12 10:14:02 -08:00
2005-11-09 07:55:57 -08:00
2005-11-09 07:55:59 -08:00
2005-11-13 18:14:10 -08:00
2005-11-07 07:53:42 -08:00
2005-11-10 02:26:41 +01:00
2005-11-12 10:55:21 +01:00
2005-11-22 19:39:30 -08:00
2005-11-13 18:14:13 -08:00
2005-11-19 22:17:55 +01:00
2005-11-13 18:14:12 -08:00
2005-12-12 08:57:45 -08:00
2005-12-15 02:20:15 +01:00
2005-11-08 17:14:08 +01:00
2005-11-10 13:03:08 -08:00
2005-11-08 09:40:47 -08:00
2005-11-09 07:55:57 -08:00
2005-11-13 18:14:16 -08:00
2005-12-12 08:57:43 -08:00
2005-11-13 18:14:13 -08:00
2005-11-07 07:54:07 -08:00
2005-11-07 07:53:43 -08:00
2005-12-21 14:45:25 -08:00
2005-11-09 07:55:57 -08:00
2005-11-22 21:58:37 -08:00
2005-11-07 14:18:56 +01:00
2005-11-07 14:18:56 +01:00
2005-11-07 14:18:56 +01:00
2005-11-07 07:53:37 -08:00
2005-11-07 07:54:08 -08:00
2005-12-12 08:57:45 -08:00
2005-12-13 02:29:45 -05:00
2005-12-12 08:57:43 -08:00
2005-11-28 14:42:23 -08:00
2005-12-16 10:21:23 -08:00
2005-11-22 19:39:30 -08:00
2005-11-07 18:18:11 -08:00
2005-11-09 07:56:00 -08:00
2005-11-07 18:18:10 -08:00
2005-11-07 07:53:55 -08:00
2005-11-10 13:01:24 -08:00
2005-11-09 16:38:16 -08:00
2005-11-10 02:26:40 +01:00
2005-12-19 23:12:09 -05:00
2005-11-22 09:13:42 -08:00
2005-11-13 18:14:12 -08:00
2005-12-12 08:57:45 -08:00
2005-12-15 02:11:55 +01:00
2005-11-10 16:09:15 -08:00
2005-11-10 16:09:17 -08:00
2005-11-13 18:14:15 -08:00
2005-11-09 07:55:57 -08:00
2005-11-09 17:23:39 +00:00
2005-11-13 18:14:10 -08:00
2005-11-13 18:14:10 -08:00
2005-11-07 07:54:09 -08:00
2005-11-08 09:40:47 -08:00
2005-12-22 09:17:39 -08:00
2005-11-08 17:57:30 -08:00
2005-11-07 07:53:42 -08:00
2005-11-07 18:18:09 -08:00
2005-11-07 07:53:39 -08:00
2005-11-07 07:53:37 -08:00
2005-12-12 08:57:42 -08:00
2005-12-20 17:33:22 -08:00
2005-11-07 07:53:47 -08:00
2005-11-07 07:53:46 -08:00
2005-11-07 07:53:46 -08:00
2005-11-07 07:53:47 -08:00
2005-11-28 14:42:25 -08:00
2005-11-07 14:25:38 +01:00
2005-12-19 13:54:44 -08:00
2005-11-28 14:42:23 -08:00
2005-11-07 07:53:41 -08:00
2005-11-28 18:09:44 +00:00
2005-11-07 07:53:37 -08:00
2005-11-20 21:25:15 -08:00
2005-11-07 07:53:24 -08:00
2005-11-13 18:14:13 -08:00
2005-11-23 08:44:05 -08:00
2005-11-09 07:55:57 -08:00
2005-11-07 07:53:28 -08:00
2005-11-28 14:42:25 -08:00
2005-12-05 13:42:06 -08:00
2005-11-10 17:14:59 -08:00
2005-11-13 18:14:14 -08:00
2005-12-12 08:57:42 -08:00
2005-11-20 00:51:33 -05:00
2005-11-23 23:04:28 -08:00
2005-11-13 18:14:18 -08:00
2005-11-09 07:56:23 -08:00
2005-11-07 07:53:41 -08:00