lkml.org 
[lkml]   [2006]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch 3/8] cpu delays
Dave Hansen wrote:

>On Wed, 2006-03-29 at 19:42 -0500, Shailabh Nagar wrote:
>
>
>>-#ifdef CONFIG_SCHEDSTATS
>>- memset(&p->sched_info, 0, sizeof(p->sched_info));
>>+#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
>>+ if (unlikely(sched_info_on()))
>>+ memset(&p->sched_info, 0, sizeof(p->sched_info));
>> #endif
>>
>>
>
>If you unconditionally define sched_info_on(), you can get get rid of
>this #ifdef.
>
>+#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
>+
>+static inline int sched_info_on(void)
>+{
>+ #ifdef CONFIG_SCHEDSTATS
>+ return 1;
>+#elif defined(CONFIG_TASK_DELAY_ACCT)
>+ return delayacct_on;
>+#else
>+ return 0;
>+#endif
>+}
>
>Might as well hide the junk in a header.
>
>
Thanks, good point.
The sched_info_on() was wrong anyway and your snippet fixes that and
gives the
junk reduction.

Will incorporate.

--Shailabh

>-- Dave
>
>
>

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

\
 
 \ /
  Last update: 2006-03-30 18:06    [W:0.102 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site