linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Huang Rui <ray.huang@amd.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	spg_linux_kernel@amd.com, X86 ML <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] x86/delay: Do not use cpu_tss in preemptible ctxt in delay_mwaitx()
Date: Wed, 9 Mar 2016 19:10:03 +0100	[thread overview]
Message-ID: <20160309181003.GF6564@pd.tnic> (raw)
In-Reply-To: <CALCETrVGaPASf=r7Z3aSQ1aM7EmHfT1y5QBK6Gss-M=++D+wUw@mail.gmail.com>

On Wed, Mar 09, 2016 at 09:56:39AM -0800, Andy Lutomirski wrote:
> On Mar 9, 2016 3:38 AM, "Borislav Petkov" <bp@alien8.de> wrote:
> >
> > From: Borislav Petkov <bp@suse.de>
> >
> > So Andy had a good idea about using a cacheline-aligned, seldomly used
> > per-cpu var as the MONITORX target but we can't use it in preemptible
> > context. The first simple idea I have is to disable preemption around us
> > dereffing it.
> 
> What's the actual problem?  Is it the preempt warnings and, if so,
> would raw_cpu_ptr fix it?

Yeah, it is the warning:

[    1.565876] BUG: using smp_processor_id() in preemptible [00000000] code: udevd/312
[    1.566123] caller is delay_mwaitx+0x40/0xa0

and yes, I think so. I don't think we care about being in preemptible
context since we're going idle anyway and doesn't matter which cpu_tss
we touch.

Yeah, I'll use raw_cpu_ptr...

> It may pay to move it into the loop, though.

... and won't need to do that.

Thanks for the idea.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

  reply	other threads:[~2016-03-09 18:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 11:37 [RFC PATCH] x86/delay: Do not use cpu_tss in preemptible ctxt in delay_mwaitx() Borislav Petkov
2016-03-09 17:56 ` Andy Lutomirski
2016-03-09 18:10   ` Borislav Petkov [this message]
2016-03-09 20:56     ` [PATCH] x86/delay: Avoid preemptible context checks " Borislav Petkov
2016-03-10 11:07       ` [tip:x86/urgent] " tip-bot for Borislav Petkov

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=20160309181003.GF6564@pd.tnic \
    --to=bp@alien8.de \
    --cc=a.p.zijlstra@chello.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=ray.huang@amd.com \
    --cc=spg_linux_kernel@amd.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;
as well as URLs for NNTP newsgroup(s).