public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Tejun Heo <tj@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Question about synchronize_sched_expedited()
Date: Mon, 25 Oct 2010 12:41:40 -0700	[thread overview]
Message-ID: <20101025194140.GB6390@linux.vnet.ibm.com> (raw)
In-Reply-To: <4CC5AA5F.9060909@kernel.org>

On Mon, Oct 25, 2010 at 06:03:43PM +0200, Tejun Heo wrote:
> Hello, Paul.
> 
> On 10/25/2010 05:43 PM, Paul E. McKenney wrote:
> > Hello, Tejun,
> > 
> > I was taking another look at synchronize_sched_expedited(), and was
> > concerned about the scenario listed out in the following commit.
> > Is this scenario a real problem, or am I missing the synchronization
> > that makes it safe?
> > 
> > (If my concerns are valid, I should also be able to change this
> > to non-atomically increment synchronize_sched_expedited_count, but
> > one step at a time...)
> 
> I think your concern is valid and this can happen w/o preemption given
> enough cpus and perfect timing.  Was the original code free from this
> problem?

I believe so -- there was a mutex guarding the whole operation, including
the increment.

> IMHO the counter based mechanism is a bit too difficult to ponder and
> verify.  Can we do more conventional double queueing (ie. flipping
> pending and executing queues so that multiple sync calls can get
> coalesced while another one is in progress)?  That's what the code is
> trying to achieve anyway, right?

Hmmm...  But it would be necessary to flip the queues somewhere, and
wouldn't determining where that somewhere was involve the same analysis
and complexity as determining where to increment the counter?

							Thanx, Paul

  reply	other threads:[~2010-10-25 19:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-25 15:43 Question about synchronize_sched_expedited() Paul E. McKenney
2010-10-25 16:03 ` Tejun Heo
2010-10-25 19:41   ` Paul E. McKenney [this message]
2010-10-26  9:25     ` Tejun Heo

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=20101025194140.GB6390@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /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