public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Olivier Langlois <olivier@trillion01.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Chris Metcalf <cmetcalf@tilera.com>,
	Christoph Lameter <cl@linux.com>,
	Geoff Levand <geoff@infradead.org>,
	Gilad Ben Yossef <gilad@benyossef.com>,
	Hakan Akkan <hakanakkan@gmail.com>,
	Kevin Hilman <khilman@linaro.org>,
	Li Zhong <zhong@linux.vnet.ibm.com>,
	Oleg Nesterov <oleg@redhat.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 2/3] posix_timers: Defer per process timer stop after timers processing
Date: Fri, 19 Apr 2013 00:30:02 -0400	[thread overview]
Message-ID: <1366345802.2855.38.camel@Wailaba2> (raw)
In-Reply-To: <1366305822-5499-3-git-send-email-fweisbec@gmail.com>

Hi Frederic,
>  /*
> @@ -1279,6 +1277,7 @@ void run_posix_cpu_timers(struct task_struct *tsk)
>  	LIST_HEAD(firing);
>  	struct k_itimer *timer, *next;
>  	unsigned long flags;
> +	struct signal_struct *sig;
>  
>  	BUG_ON(!irqs_disabled());
>  
> @@ -1336,6 +1335,10 @@ void run_posix_cpu_timers(struct task_struct *tsk)
>  			cpu_timer_fire(timer);
>  		spin_unlock(&timer->it_lock);
>  	}
> +
> +	sig = tsk->signal;
> +	if (task_cputime_zero(&sig->cputime_expires))
> +		stop_process_timers(sig);
>  }
>  
>  /*
I have proposed a different modification for the same problem yesterday:

https://lkml.org/lkml/2013/4/17/351

I might be mistaken but I believe that firing timers are not rescheduled
in the current interrupt context. They are going to be rescheduled later
from the task context handling the timer generated signal.

Also, if the cputimer is started by posix_cpu_timer_set() without arming
any timer, the stop_process_timers() function will never be reached.

My methodology to test the modifications that I have proposed is by
adding a printk() statement inside thread_group_cputimer() where the
cputimer is initialized and run

glibc-2.17/rt/tst-cputimer1 unittest.

Before the changes, the cputimer is initialized 4 times!
I was expecting with the proposed changes to see that number reduced to
2 but it ended up to be even better and be only 1 because the second
waves of posix cpu timers is set within 1 tick.

If you do the same test with your changes, I think that there is a
chance that it will not get the same positive result for the reason that
I have stated above.

To conclude, I would be very interested to get your input in posix cpu
timer modification proposal that I did last week. My proposal is either
too complex or I am very bad explaining it so since your knowledgable in
the area, your input would be very helpful.

https://lkml.org/lkml/2013/4/5/370

Thank you!!!
Olivier




  reply	other threads:[~2013-04-19  4:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-18 17:23 [RFC GIT PULL] nohz: Posix cpu timers handling on full dynticks Frederic Weisbecker
2013-04-18 17:23 ` [PATCH 1/3] nohz: New APIs to re-evaluate the tick on full dynticks CPUs Frederic Weisbecker
2013-04-18 17:23 ` [PATCH 2/3] posix_timers: Defer per process timer stop after timers processing Frederic Weisbecker
2013-04-19  4:30   ` Olivier Langlois [this message]
2013-04-19 12:47     ` Frederic Weisbecker
2013-04-26  4:27       ` Olivier Langlois
2013-04-26  6:21         ` Olivier Langlois
2013-04-30 12:54         ` Frederic Weisbecker
2013-04-30 17:51           ` Olivier Langlois
2013-05-06 23:03             ` Frederic Weisbecker
2013-04-18 17:23 ` [PATCH 3/3] posix_timers: Kick full dynticks CPUs when a posix cpu timer is armed Frederic Weisbecker
2013-04-19 12:51 ` [RFC GIT PULL] nohz: Posix cpu timers handling on full dynticks Frederic Weisbecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1366345802.2855.38.camel@Wailaba2 \
    --to=olivier@trillion01.com \
    --cc=cl@linux.com \
    --cc=cmetcalf@tilera.com \
    --cc=fweisbec@gmail.com \
    --cc=geoff@infradead.org \
    --cc=gilad@benyossef.com \
    --cc=hakanakkan@gmail.com \
    --cc=khilman@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=zhong@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox