Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1214043 > unrolled thread

Re: [PATCH 2/3] timer: Check thread timers only when there are active thread timers

Started by"George Spelvin" <linux@horizon.com>
First post2015-08-26 19:10 +0200
Last post2015-08-26 19:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  Re: [PATCH 2/3] timer: Check thread timers only when there are active thread timers "George Spelvin" <linux@horizon.com> - 2015-08-26 19:10 +0200
    Re: [PATCH 2/3] timer: Check thread timers only when there are  active thread timers Jason Low <jason.low2@hp.com> - 2015-08-26 19:50 +0200

#1214043 — Re: [PATCH 2/3] timer: Check thread timers only when there are active thread timers

From"George Spelvin" <linux@horizon.com>
Date2015-08-26 19:10 +0200
SubjectRe: [PATCH 2/3] timer: Check thread timers only when there are active thread timers
Message-ID<q1Mn0-3z4-1@gated-at.bofh.it>
-	check_thread_timers(tsk, &firing);
+	if (!task_cputime_zero(&tsk->cputime_expires))
+		check_thread_timers(tsk, &firing);

Sincere question; I'm not certain myself: would it make more sense to put
this shortcut into check_thread_timers()?

It seems more like an optimization of that function than something the
caller needs to know about.
--
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/

[toc] | [next] | [standalone]


#1214076 — Re: [PATCH 2/3] timer: Check thread timers only when there are active thread timers

FromJason Low <jason.low2@hp.com>
Date2015-08-26 19:50 +0200
SubjectRe: [PATCH 2/3] timer: Check thread timers only when there are active thread timers
Message-ID<q1MZH-4is-3@gated-at.bofh.it>
In reply to#1214043
On Wed, 2015-08-26 at 13:04 -0400, George Spelvin wrote:
> -	check_thread_timers(tsk, &firing);
> +	if (!task_cputime_zero(&tsk->cputime_expires))
> +		check_thread_timers(tsk, &firing);
> 
> Sincere question; I'm not certain myself: would it make more sense to put
> this shortcut into check_thread_timers()?
> 
> It seems more like an optimization of that function than something the
> caller needs to know about.

Yes, I also thought it might be better if we add something like:

	if (task_cputime_zero(&tsk->cputime_expires)
		return;

in check_thread_timers(). The reason I made it this way though is
because in the next few lines, we do a similar check before calling
check_process_timers(), and I wanted to keep things consistent.

However, perhaps we can consider also moving that
tsk->signal->cputimer.running check into check_process_timers() too.

Thanks for the suggestions.

--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web