mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: linux-kernel@vger.kernel.org, Aaron Lu <aaron.lu@intel.com>
Subject: Re: [RFC PATCH] sched: Fix performance regression introduced by mm_cid
Date: Tue, 4 Apr 2023 11:21:48 +0200	[thread overview]
Message-ID: <20230404092148.GC284733@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20230403181342.210896-1-mathieu.desnoyers@efficios.com>

On Mon, Apr 03, 2023 at 02:13:42PM -0400, Mathieu Desnoyers wrote:
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 0d18c3969f90..775c7da6ec7f 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -2326,16 +2326,20 @@ static inline bool is_cpu_allowed(struct task_struct *p, int cpu)
>  static struct rq *move_queued_task(struct rq *rq, struct rq_flags *rf,
>  				   struct task_struct *p, int new_cpu)
>  {
> +	int cid;
> +
>  	lockdep_assert_rq_held(rq);
>  
>  	deactivate_task(rq, p, DEQUEUE_NOCLOCK);
>  	set_task_cpu(p, new_cpu);
> +	cid = sched_mm_cid_migrate_from(rq, p);
>  	rq_unlock(rq, rf);
>  
>  	rq = cpu_rq(new_cpu);
>  
>  	rq_lock(rq, rf);
>  	WARN_ON_ONCE(task_cpu(p) != new_cpu);
> +	sched_mm_cid_migrate_to(rq, p, cid);
>  	activate_task(rq, p, 0);
>  	check_preempt_curr(rq, p, 0);
>  

I can't find more uses? Yet there are a ton more ways to actually
migrate tasks.

      parent reply	other threads:[~2023-04-04  9:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03 18:13 Mathieu Desnoyers
2023-04-04  0:13 ` Mathieu Desnoyers
2023-04-04  1:59   ` Aaron Lu
2023-04-04  8:57 ` Peter Zijlstra
2023-04-04  9:10   ` Peter Zijlstra
2023-04-04 13:23     ` Mathieu Desnoyers
2023-04-04  9:05 ` Peter Zijlstra
2023-04-04 13:24   ` Mathieu Desnoyers
2023-04-04  9:21 ` Peter Zijlstra [this message]

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=20230404092148.GC284733@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=aaron.lu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.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

all inboxes | Powered by JetHome®