LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Waiman Long <longman@redhat.com>, Ingo Molnar <mingo@redhat.com>,
	Will Deacon <will.deacon@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com>,
	Linux List Kernel Mailing <linux-kernel@vger.kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Tim Chen <tim.c.chen@linux.intel.com>,
	huang ying <huang.ying.caritas@gmail.com>
Subject: Re: [PATCH v4] locking/lock_events: Use this_cpu_add() when necessary
Date: Tue, 28 May 2019 10:22:53 +0200	[thread overview]
Message-ID: <20190528082253.GK2623@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAHk-=wgr-2kxGU=AXFbW=00qOHCA0eb_Ky0Bq9aeBKOegaFxNg@mail.gmail.com>

On Mon, May 27, 2019 at 12:33:56PM -0700, Linus Torvalds wrote:
> On Mon, May 27, 2019 at 1:23 AM Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > That's disguisting... I see Linus already applied it, but yuck. That's
> > what we have raw_cpu_*() for.
> 
> Ahh, I tried to look for that, but there was enough indirection and
> confusion that I wasn't sure they were generically available.
> 
> And the "raw_cpu_*()" functions are rare enough that I'd never
> encountered them enough to really be aware of them. In fact, we seem
> to have exactly _one_ user of "raw_cpu_add()" in the whole kernel, and
> a handful of "raw_cpu_inc()".

Yeah, not having many is good. From a correctness PoV they're basically
always the wrong thing to use, except for this one usecase where we
prefer speed over correctness.

> But ack on your patch, and a heartfelt "yeah, that's the right thing". Thanks,

Thanks, I'll go write me a Changelog then ;-)

  reply	other threads:[~2019-05-28  8:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-24 19:42 Waiman Long
2019-05-24 21:24 ` Linus Torvalds
2019-05-27  8:23 ` Peter Zijlstra
2019-05-27 19:33   ` Linus Torvalds
2019-05-28  8:22     ` Peter Zijlstra [this message]
2019-06-03 13:33   ` [tip:locking/core] locking/lock_events: Use raw_cpu_{add,inc}() for stats tip-bot for Peter Zijlstra

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=20190528082253.GK2623@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bp@alien8.de \
    --cc=dave@stgolabs.net \
    --cc=hpa@zytor.com \
    --cc=huang.ying.caritas@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=will.deacon@arm.com \
    --cc=x86@kernel.org \
    --subject='Re: [PATCH v4] locking/lock_events: Use this_cpu_add() when necessary' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).