All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: "Chen, Dennis (SRDC SW)" <Dennis1.Chen@amd.com>
Cc: Clemens Ladisch <clemens@ladisch.de>,
	Ingo Molnar <mingo@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: semaphore and mutex in current Linux kernel (3.2.2)
Date: Mon, 9 Apr 2012 11:45:39 -0700	[thread overview]
Message-ID: <20120409184538.GE2430@linux.vnet.ibm.com> (raw)
In-Reply-To: <491D6B4EAD0A714894D8AD22F4BDE0439F9ED2@SCYBEXDAG02.amd.com>

On Fri, Apr 06, 2012 at 05:47:28PM +0000, Chen, Dennis (SRDC SW) wrote:
> On Fri, Apr 6, 2012 at 6:10 PM, Clemens Ladisch <clemens@ladisch.de> wrote:
> > Chen, Dennis (SRDC SW) wrote:
> >> On Thu, Apr 5, 2012 at 10:15 PM, Clemens Ladisch <clemens@ladisch.de> wrote:
> >>
> >> I guess this is related with RCU component, but I don't found the right place where the code
> >> Located yet.
> >
> > "On the internet, nobody can hear you being subtle."
> >
> > If some other process wants to run on the same CPU, needs_resched() is set.
> > (This might happen to make the cursor blink, for keyboard input, or when
> > somebody starts a rogue process like ps.)
> >
> 
> Hmm, I forget that in each timer interrupt, __rcu_pending() will be called, it will call
> set_need_resched() to set the TIF_NEED_RESCHED in some condition...
> The optimization of mutex work closely with rcu, so fantastic!

I must confess that you all lost me on this one.

There is a call to set_need_resched() in __rcu_pending(), which is
invoked when the current CPU has not yet responded to a non-preemptible
RCU grace period for some time.  However, in the common case where the
CPUs all respond in reasonable time, __rcu_pending() will never call
set_need_resched().

However, we really do not want to call set_need_resched() on every call
to __rcu_pending().  There is almost certainly a better solution to any
problem that might be solved by a per-jiffy call to set_need_resched().

So, what are you really trying to do?

							Thanx, Paul


  reply	other threads:[~2012-04-09 18:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-01  9:56 semaphore and mutex in current Linux kernel (3.2.2) Chen, Dennis (SRDC SW)
2012-04-01 12:19 ` Ingo Molnar
2012-04-02 15:28   ` Chen, Dennis (SRDC SW)
2012-04-03  7:52     ` Ingo Molnar
2012-04-05  8:37       ` Chen, Dennis (SRDC SW)
2012-04-05 14:15         ` Clemens Ladisch
2012-04-06  9:45           ` Chen, Dennis (SRDC SW)
2012-04-06 10:10             ` Clemens Ladisch
2012-04-06 17:47               ` Chen, Dennis (SRDC SW)
2012-04-09 18:45                 ` Paul E. McKenney [this message]
2012-04-11  5:04                   ` Chen, Dennis (SRDC SW)
2012-04-11 17:30                     ` Paul E. McKenney
2012-04-12  9:42                       ` Chen, Dennis (SRDC SW)
2012-04-12 15:18                         ` Paul E. McKenney
2012-04-13 14:15                           ` Chen, Dennis (SRDC SW)
2012-04-13 18:43                             ` Paul E. McKenney
2012-04-16  8:33                               ` [PATCH 0/2] tools perf: Add a new benchmark tool for semaphore/mutex Chen, Dennis (SRDC SW)
2012-04-16  9:24                                 ` Ingo Molnar
2012-04-16 14:10                                   ` Chen, Dennis (SRDC SW)

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=20120409184538.GE2430@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=Dennis1.Chen@amd.com \
    --cc=clemens@ladisch.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@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 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.