Prefetch hint

Matt Helsley
2006-12-15T00:08:04Z

[-- Attachment #1: task-watchers-prefetch --]
[-- Type: text/plain, Size: 996 bytes --]

Prefetch the entire array of function pointers.

Signed-off-by: Matt Helsley <matthltc@us.ibm.com>

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

--