All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Rik van Riel <riel@surriel.com>
Cc: Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com,
	Dave Hansen <dave.hansen@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andy Lutomirski <luto@kernel.org>
Subject: Re: [PATCH v3] x86,mm: print likely CPU at segfault time
Date: Sat, 6 Aug 2022 10:59:03 +0200	[thread overview]
Message-ID: <Yu4tV9FmEQmbB4AU@gmail.com> (raw)
In-Reply-To: <Yu4qja8L2ulHaqVt@gmail.com>


* Ingo Molnar <mingo@kernel.org> wrote:

> >  	instrumentation_begin();
> > -	handle_page_fault(regs, error_code, address);
> > +	handle_page_fault(regs, error_code, address, cpu);
> 
> Not convinced that this is a good change: this will bloat all the 
> affected code by a couple of dozen instructions - for no good reason in 
> the context of this patch.
> 
> Boris, why should we do this? Extracting a parameter at higher levels and 
> passing it down to lower levels is almost always a bad idea from a code 
> generation POV, unless the majority of lower levels needs this 
> information anyway (which isn't the case here).

Oh, I just got to this series in my mbox:

  [RFC PATCH 0/5] Print CPU at segfault time
  ...
  [RFC PATCH 5/5] x86/entry: Store CPU info on exception entry

With that basis, printing the segfault CPU becomes a 'free' feature.

At the cost of putting ~2 new instructions into the hotpath of every 
exception though. :-/

Thanks,

	Ingo

  reply	other threads:[~2022-08-06  8:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-05 14:16 [PATCH v3] x86,mm: print likely CPU at segfault time Rik van Riel
2022-08-05 14:27 ` Borislav Petkov
2022-08-05 14:40   ` Rik van Riel
2022-08-06  8:47     ` Ingo Molnar
2022-08-06  8:59       ` Ingo Molnar [this message]
2022-08-05 17:09   ` Ira Weiny
2022-08-24 11:03 ` [tip: x86/cpu] x86/mm: Print " tip-bot2 for 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=Yu4tV9FmEQmbB4AU@gmail.com \
    --to=mingo@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=riel@surriel.com \
    --cc=tglx@linutronix.de \
    --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 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.