2006-12-15 00:24:11

by Matt Helsley

[permalink] [raw]
Subject: Prefetch hint

Prefetch the entire array of function pointers.

Signed-off-by: Matt Helsley <[email protected]>

---
kernel/task_watchers.c | 2 ++
1 file changed, 2 insertions(+)

Index: linux-2.6.19/kernel/task_watchers.c
===================================================================
--- linux-2.6.19.orig/kernel/task_watchers.c
+++ linux-2.6.19/kernel/task_watchers.c
@@ -1,6 +1,7 @@
#include <linux/init.h>
+#include <linux/prefetch.h>

/* Defined in include/asm-generic/vmlinux.lds.h */
extern const task_watcher_fn __start_task_init[],
__start_task_clone[], __start_task_exec[],
__start_task_uid[], __start_task_gid[],
@@ -30,10 +31,11 @@ int notify_task_watchers(unsigned int ev

tw_call = twtable[ev];
tw_end = twtable[ev + 1];

/* Call all of the watchers, report the first error */
+ prefetch_range(tw_call, tw_end - tw_call);
for (; tw_call < tw_end; tw_call++) {
err = (*tw_call)(val, tsk);
if (unlikely((err < 0) && (ret_err == 0)))
ret_err = err;
}

--