mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Vikas Shivappa <vikas.shivappa@intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	x86@kernel.org, Stephane Eranian <eranian@google.com>,
	Matt Fleming <matt@codeblueprint.co.uk>
Subject: Re: [PATCH] x86/perf/intel/cqm: Get rid of the silly for_each_cpu lookups
Date: Thu, 18 Feb 2016 21:15:05 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.11.1602182106140.2477@nanos> (raw)
In-Reply-To: <alpine.DEB.2.11.1602172002450.19512@nanos>

On Wed, 17 Feb 2016, Thomas Gleixner wrote:
> On Wed, 17 Feb 2016, Vikas Shivappa wrote:
> 
> Please stop top posting, finally!
> 
> > But we have an extra static - static to avoid having it in the stack..
> 
> It's not about the cpu mask on the stack. The reason was that with cpumask off
> stack cpumask_and_mask() requires an allocation, which then can't be used in
> the starting/dying callbacks.
>  
> Darn, you are right to remind me.
> 
> Now, the proper solution for this stuff is to provide a library function as we
> need that for several drivers. No point to duplicate that functionality. I'll
> cook something up and repost the uncore/cqm set tomorrow.

Second thoughts on that.

cpumask_any_but() is fine as is, if we feed it topology_core_cpumask(cpu). The
worst case search is two bitmap_find_next() if the first search returned cpu.

Now cpumask_any_and() does a search as well, but the number of
bitmap_find_next() invocations is limited to the number of sockets if we feed
the cqm_cpu_mask as first argument. So for 4 or 8 sockets that's still a
reasonable limit. If the people with insane large machines care, we can
revisit that topic. It's still faster than for_each_online_cpu() :)

Thanks,

	tglx

  reply	other threads:[~2016-02-18 20:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 15:47 Thomas Gleixner
2016-02-17 16:08 ` Thomas Gleixner
2016-02-17 16:28   ` Matt Fleming
2016-02-17 18:27   ` Vikas Shivappa
2016-02-17 18:31     ` Thomas Gleixner
2016-02-17 18:35       ` Thomas Gleixner
2016-02-17 18:48       ` Vikas Shivappa
2016-02-17 19:09         ` Thomas Gleixner
2016-02-18 20:15           ` Thomas Gleixner [this message]
2016-02-18 23:12             ` Vikas Shivappa

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=alpine.DEB.2.11.1602182106140.2477@nanos \
    --to=tglx@linutronix.de \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=peterz@infradead.org \
    --cc=vikas.shivappa@intel.com \
    --cc=x86@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 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®