All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Chen <tim.c.chen@linux.intel.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Ingo Molnar <mingo@elte.hu>, Juri Lelli <juri.lelli@redhat.com>
Cc: Tim Chen <tim.c.chen@linux.intel.com>,
	Yu Chen <yu.c.chen@intel.com>,
	Walter Mack <walter.mack@intel.com>, Mel Gorman <mgorman@suse.de>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] sched/fair: Fix starvation caused by task migration
Date: Fri, 25 Mar 2022 15:54:15 -0700	[thread overview]
Message-ID: <cover.1648228023.git.tim.c.chen@linux.intel.com> (raw)

Walter Mack noticed during stress testing on 2 socket Sapphire Rapids
system, there were anomalies where tasks were starved for more
than 70 secs before getting scheduled.

The stress test scenario is an extreme case where about 50 threads
per CPU are started on each core.  Then each thread hops from
one core to another continuously.

We discussed this issue with Peter Z., who narrowed
things down to problem with vruntime setting of a migrated
task being too out of sync with the tasks on the target run queue.

Peter suggested the following two patches that did fix
the starvation anomalies that Walter saw.

Yu Chen also kicked the patches into our 0-day test infrastructure to
check for regressions.  The performance changes of note are below:

5.15        Throughput    5.15+patchest  Test
	    Changes       
4634070      -7.5%        4285823        stress-ng.sigsuspend.ops_per_sec
  29934     +37.0%          41006        aim7.jobs-per-min

Stress-ng sigsuspend is the worst affected.  But for most workloads,
they are not negatively impacted.  In fact, we saw 37% improvement
in Aim7 due to these patches.

Tim

Peter Zijlstra (1):
  sched/fair: Don't rely on ->exec_start for migration

Peter Zijlstra (Intel) (1):
  sched/fair: Simple runqueue order on migrate

 include/linux/sched.h   |  1 +
 kernel/sched/fair.c     | 37 +++++++++++++++++++++++++++++++++----
 kernel/sched/features.h |  2 ++
 3 files changed, 36 insertions(+), 4 deletions(-)

-- 
2.32.0


             reply	other threads:[~2022-03-25 23:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 22:54 Tim Chen [this message]
2022-03-25 22:54 ` [PATCH 1/2] sched/fair: Don't rely on ->exec_start for migration Tim Chen
2022-03-25 22:54 ` [PATCH 2/2] sched/fair: Simple runqueue order on migrate Tim Chen
2022-03-29  9:03   ` Vincent Guittot
2022-03-31 11:47     ` Peter Zijlstra
2022-03-31 12:15       ` Vincent Guittot
2022-03-29 10:09   ` Abel Wu
2022-03-29 14:26     ` Tim Chen
2022-03-30  9:46   ` [sched/fair] ddb3b1126f: hackbench.throughput -25.9% regression kernel test robot
2022-03-30  9:46     ` kernel test robot
2022-03-30 23:48     ` Tim Chen
2022-03-30 23:48       ` Tim Chen
2022-04-01 18:04       ` Chen Yu
2022-04-01 18:04         ` Chen Yu

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=cover.1648228023.git.tim.c.chen@linux.intel.com \
    --to=tim.c.chen@linux.intel.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=vincent.guittot@linaro.org \
    --cc=walter.mack@intel.com \
    --cc=yu.c.chen@intel.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.