mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rik van Riel <riel@surriel.com>
To: kernel test robot <oliver.sang@intel.com>
Cc: oe-lkp@lists.linux.dev, lkp@intel.com,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra	 <peterz@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [linus:master] [x86/mm/tlb]  7e33001b8b: will-it-scale.per_thread_ops 20.7% improvement
Date: Sat, 30 Nov 2024 12:28:42 -0500	[thread overview]
Message-ID: <069d686ab958d973563cfad52373ec6c8aad72ca.camel@surriel.com> (raw)
In-Reply-To: <202411301528.342383d8-lkp@intel.com>

On Sat, 2024-11-30 at 16:07 +0800, kernel test robot wrote:
> 
> 
> Hello,
> 
> in this test, we don't have CONFIG_DEBUG_VM.
> # CONFIG_DEBUG_VM is not set
> 
> below report is just FYI.
> 
> 
> kernel test robot noticed a 20.7% improvement of will-it-
> scale.per_thread_ops on:
> 
> 
> commit: 7e33001b8b9a78062679e0fdf5b0842a49063135 ("x86/mm/tlb: Put
> cpumask_test_cpu() check in switch_mm_irqs_off() under
> CONFIG_DEBUG_VM")
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git maste
> r

It's good to get this confirmation that the mm_cpumask
really is that expensive.

I guess we could experiment with something like the following:

1) Stop using the mm_cpumask altogether on x86
2) Instead, at context switch time just update
   per_cpu variables like cpu_tlbstate.loaded_mm
   and friends
3) At (much rarer) TLB flush time:
   - Iterate over all CPUs
   - Use cpustate.loaded_mm and .is_lazy to  build a 
     (per-CPU?) cpumask.
   - Pass that cpumask to functions like flush_tlb_multi
     and on_each_cpu_mask

Does that make sense as something we could try to
further reduce context switch overhead, and the
TLB flush thundering herd on the mm_cpumask triggered
by the main loop in will-it-scale's tlb_flush2 test?

https://github.com/antonblanchard/will-it-scale/blob/master/tests/tlb_flush2.c


-- 
All Rights Reversed.

  reply	other threads:[~2024-11-30 17:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-30  8:07 kernel test robot
2024-11-30 17:28 ` Rik van Riel [this message]
2024-11-30 17:54   ` Linus Torvalds
2024-11-30 19:56     ` Rik van Riel

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=069d686ab958d973563cfad52373ec6c8aad72ca.camel@surriel.com \
    --to=riel@surriel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=oe-lkp@lists.linux.dev \
    --cc=oliver.sang@intel.com \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.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 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®