All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Steinar H. Gunderson" <sgunderson@bigfoot.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Slowdown due to threads bouncing between HT cores
Date: Sat, 4 Oct 2014 16:12:44 +0200	[thread overview]
Message-ID: <20141004141244.GB27832@sesse.net> (raw)
In-Reply-To: <87a95cq7es.fsf@tassilo.jf.intel.com>

On Sat, Oct 04, 2014 at 06:41:15AM -0700, Andi Kleen wrote:
> - something else gets scheduled on these logical CPUs, so
> the scheduler tries to balance to run queue lengths
> 
> You could check that with perf timechart or perf sched record/map
> or kernelshark.

I've never read any of these maps before, but perf sched map really doesn't
indicate to me that there's a lot of other stuff going on. It seems to mainly
show a lot of Stockfish processes bouncing around seemingly randomly with not
much understanding of hyperthread pairs. Of course, there's the odd other
job, including ksoftirq or an RCU process.

I can send you a copy of the map if you want to, but it is of course rather
large.

> - there is some IO or communication which causes wakeup affinity.

There's a fair amount of communication between the threads; I don't know the
architecture very deeply (multithreading in chess is rather nontrivial),
but as far as I know, the worker threads access shared data through shm,
sometimes using pthread mutexes to lock some of it.

This also means, by the way, that occasionally they will sleep. They're not
by default going to hog the CPU 100% of the time, more like 90%.

> You could try disabling WAKEUP_PREEMPTION or NEXT_BUDDY in 
> /sys/kernel/debug/sched_features

NO_NEXT_BUDDY was already set. (Changing it to NEXT_BUDDY didn't seem to help
anything.) I tried setting NO_WAKEUP_PREEMPTION, and it didn't make a
difference that I could see; they still bounce around a lot.

/* Steinar */
-- 
Homepage: http://www.sesse.net/

  reply	other threads:[~2014-10-04 14:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-03 19:44 Slowdown due to threads bouncing between HT cores Steinar H. Gunderson
2014-10-03 21:11 ` Marc Burkhardt
2014-10-03 21:14   ` Steinar H. Gunderson
2014-10-04  9:22     ` Marc Burkhardt
2014-10-04 13:41 ` Andi Kleen
2014-10-04 14:12   ` Steinar H. Gunderson [this message]
2014-10-04 14:50 ` Chuck Ebbert
2014-10-05 11:19   ` Steinar H. Gunderson
2014-10-08 15:37 ` bisected: futex regression >= 3.14 - was - " Mike Galbraith
2014-10-08 16:14   ` Thomas Gleixner
2014-10-08 16:45     ` Steinar H. Gunderson
2014-10-08 17:52       ` Mike Galbraith
2014-10-08 16:23   ` Steinar H. Gunderson
2014-10-08 17:04   ` Linus Torvalds
2014-10-08 17:05     ` Steinar H. Gunderson
2014-10-08 17:59     ` Mike Galbraith
2014-10-24 15:25       ` Thomas Gleixner
2014-10-24 16:38         ` Mike Galbraith
2014-10-26 10:39           ` Steinar H. Gunderson
2014-10-26 13:16             ` Mike Galbraith
2014-10-26 13:58               ` Mike Galbraith
2014-10-26 14:11                 ` Steinar H. Gunderson
2014-10-26 14:41                   ` Mike Galbraith
2014-10-27 10:05                   ` Mike Galbraith

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=20141004141244.GB27832@sesse.net \
    --to=sgunderson@bigfoot.com \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.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.