All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Hugh Dickins <hughd@google.com>
Cc: Chintan Pandya <cpandya@codeaurora.org>,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	John Stultz <john.stultz@linaro.org>,
	Ingo Molnar <mingo@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Paul McKenney <paulmck@linux.vnet.ibm.com>
Subject: Re: [PATCH v4 2/2] ksm: provide support to use deferrable timers for scanner thread
Date: Wed, 10 Sep 2014 10:10:00 +0200	[thread overview]
Message-ID: <20140910081000.GN6758@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <alpine.LSU.2.11.1409091225310.8432@eggly.anvils>

[-- Attachment #1: Type: text/plain, Size: 1345 bytes --]

On Tue, Sep 09, 2014 at 01:14:50PM -0700, Hugh Dickins wrote:
> On Mon, 8 Sep 2014, Peter Zijlstra wrote:
> > >  		switch_mm(oldmm, mm, next);
> > > +		wake_ksm = ksm_switch(mm);
> > 
> > Is this the right mm?
> 
> It's next->mm, that's the one I intended (though the patch might
> be equally workable using prev->mm instead: given free rein, I'd
> have opted for hooking into both prev and next, but free rein is
> definitely not what should be granted around here!).
> 
> > We've just switched the stack,
> 
> I thought that came in switch_to() a few lines further down,
> but don't think it matters for this.

Ah, yes. Got my task and mm separation messed up.

> > so we're looing at next->mm when we switched away from current.
> > That might not exist anymore.
> 
> I fail to see how that can be.  Looking at the x86 switch_mm(),
> I can see it referencing (unsurprisingly!) both old and new mms
> at this point, and no reference to an mm is dropped before the
> ksm_switch().  oldmm (there called mm) is mmdropped later in
> finish_task_switch().

Well, see the above confusion about switch_mm vs switch_to :-/

So if this were switch_to(), we'd see next->mm as before the last
context switch. And since that switch fully happened, it would also
already have done the finish_task_switch() -> mmdrop().



[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-09-10  8:10 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-20 12:10 [PATCH v4 1/2] timer: provide an api for deferrable timeout Chintan Pandya
2014-08-20 12:10 ` Chintan Pandya
2014-08-20 12:10 ` [PATCH v4 2/2] ksm: provide support to use deferrable timers for scanner thread Chintan Pandya
2014-08-20 12:10   ` Chintan Pandya
2014-08-28  6:02   ` Hugh Dickins
2014-08-28  6:02     ` Hugh Dickins
2014-09-03  9:58     ` Peter Zijlstra
2014-09-03  9:58       ` Peter Zijlstra
2014-09-03 10:32       ` Thomas Gleixner
2014-09-03 10:32         ` Thomas Gleixner
2014-09-08  8:25       ` Hugh Dickins
2014-09-08  8:25         ` Hugh Dickins
2014-09-08  9:39         ` Peter Zijlstra
2014-09-09 14:52           ` Chintan Pandya
2014-09-09 14:52             ` Chintan Pandya
2014-09-09 20:37             ` Hugh Dickins
2014-09-09 20:37               ` Hugh Dickins
2014-09-09 20:14           ` Hugh Dickins
2014-09-09 20:14             ` Hugh Dickins
2014-09-10  8:10             ` Peter Zijlstra [this message]
2014-09-11 12:27               ` Hugh Dickins
2014-09-11 12:27                 ` Hugh Dickins
2014-09-10  8:27             ` Peter Zijlstra
2014-09-11 12:59               ` Hugh Dickins
2014-09-11 12:59                 ` Hugh Dickins
2014-09-11  8:01             ` Chintan Pandya
2014-09-11  8:01               ` Chintan Pandya
2014-09-11 13:25               ` Hugh Dickins
2014-09-11 13:25                 ` Hugh Dickins

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=20140910081000.GN6758@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=cpandya@codeaurora.org \
    --cc=fweisbec@gmail.com \
    --cc=hughd@google.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    /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.