Re: 2.6.0-test3-mm1: scheduling while atomic (ext3?)

From: Andrew Morton
Date: Wed Aug 13 2003 - 04:59:32 EST


Jurriaan on adsl-gate <thunder7@xxxxxxxxx> wrote:
>
> > Exactly what sort of CPU are you using?
> > -
> AMD Athlon XP2400+ on a VIA KT400 chipset, single CPU-system.

OK, thanks. The word is that Athlons will, very occasionally,
take a fault when prefetching from an unmapped address.

include/linux/list.h | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)

diff -puN include/linux/list.h~hlist_for_each-fix include/linux/list.h
--- 25/include/linux/list.h~hlist_for_each-fix 2003-08-13 02:29:32.000000000 -0700
+++ 25-akpm/include/linux/list.h 2003-08-13 02:37:33.000000000 -0700
@@ -504,11 +504,15 @@ static __inline__ void hlist_add_after(s

#define hlist_entry(ptr, type, member) container_of(ptr,type,member)

-/* Cannot easily do prefetch unfortunately */
-#define hlist_for_each(pos, head) \
- for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
- pos = pos->next)
+#define hlist_for_each(pos, head) \
+ for ( pos = (head)->first; \
+ likely(pos) && ({ \
+ if (likely(pos->next)) \
+ prefetch(pos->next); \
+ 1; }); \
+ pos = pos->next)

+/* Cannot easily do prefetch unfortunately */
#define hlist_for_each_safe(pos, n, head) \
for (pos = (head)->first; n = pos ? pos->next : 0, pos; \
pos = n)

_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/