All of lore.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, 26 Apr 2013 00:27:59 -0400	[thread overview]
Message-ID: <1366950479.7911.22.camel@Wailaba2> (raw)
In-Reply-To: <CAFTL4hzTbko=jArO+kFF3icDbXmZzamDr1FJL3Vx+11Q54NABg@mail.gmail.com>

On Fri, 2013-04-19 at 14:47 +0200, Frederic Weisbecker wrote:

> 
> >
> > 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.
> 
> No, when the timer fires, it might generate a signal. But it won't
> execute that signal right away in the same code path. Instead, after
> signal generation, it may reschedule the timer if necessary then look
> at the next firing timer in the list. This is all made from the same
> timer interrupt context from the same call to run_posix_cpu_timers().
> The signal itself is executed asynchronously. Either by interrupting a
> syscall, or from the irq return path.
> 
Frederic, be careful with the interpretation, there are 2 locations from
where posix_cpu_timer_schedule() can be called.

Call to posix_cpu_timer_schedule() from cpu_timer_fire() only happens if
the signal isn't sent because it is ignored by the recipient.

Maybe the condition around the posix_cpu_timer_schedule() block inside
cpu_timer_fire() could even be a good candidate for 'unlikely'
qualifier.

IMO, a more likely scenario, posix_cpu_timer_schedule() will be called
from dequeue_signal() which will be from from a different context than
the interrupt context.

At best, you have an interesting race!

dequeue_signal() is called when delivering a signal, not when it is
generated, right?

If you have a different understanding then please explain when call to
posix_cpu_timer_schedule() from dequeue_signal() will happen.



  reply	other threads:[~2013-04-26  4:28 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
2013-04-19 12:47     ` Frederic Weisbecker
2013-04-26  4:27       ` Olivier Langlois [this message]
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=1366950479.7911.22.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.