Re: [PATCH 07/11] Task watchers: Register per-task delay accounting task watcher

Shailabh Nagar
2006-06-14T03:31:19Z

Matt Helsley wrote:

>Adapts delayacct to use Task Watchers. Does not adapt taskstats to use Task
>Watchers.
>
>Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
>Cc: Shailabh Nagar <nagar@watson.ibm.com>
>Cc: Balbir Singh <balbir@in.ibm.com>
>Cc: Chandra S. Seetharaman <sekharan@us.ibm.com>
>--
>
> include/linux/delayacct.h | 2 +-
> kernel/delayacct.c | 23 +++++++++++++++++++++++
> kernel/exit.c | 2 --
> kernel/fork.c | 2 --
> 4 files changed, 24 insertions(+), 5 deletions(-)
>
>
>
>
<snip>

>Index: linux-2.6.17-rc5-mm2/include/linux/delayacct.h
>===================================================================
>--- linux-2.6.17-rc5-mm2.orig/include/linux/delayacct.h
>+++ linux-2.6.17-rc5-mm2/include/linux/delayacct.h
>@@ -59,11 +59,11 @@ static inline void delayacct_tsk_init(st
> __delayacct_tsk_init(tsk);
> }
>
> static inline void delayacct_tsk_exit(struct task_struct *tsk)
> {
>- if (tsk->delays)
>+ if (unlikely(tsk->delays))
> __delayacct_tsk_exit(tsk);
> }
>
>

This snippet does not belong to this patchset...since the same check
(for tsk->delays) is
being used elsewhere in the delay accounting code, changes to use of
likely/unlikely should
be done elsewhere too, if deemed necesssary.

Otherwise patch looks good though I've not tested whether delay
accounting works unaffected
(don't see any reason why it shouldn't).

--Shailabh