mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, Michael Matz <matz@suse.de>
Subject: Re: [PATCH] x86/cpu: Add support for modern x86-64-v* march
Date: Fri, 7 Jul 2023 14:05:00 +0200	[thread overview]
Message-ID: <20230707120500.GDZKf/bDf8wIQmpixs@fat_crate.local> (raw)
In-Reply-To: <CADWks+Y7yRfQgd3iKM=qg8-HnQc51QLFNOsWXmR7Rfdn29SSkw@mail.gmail.com>

+ Matz

On Fri, Jul 07, 2023 at 12:46:50PM +0100, Dimitri John Ledkov wrote:
> On Fri, 7 Jul 2023 at 12:28, Borislav Petkov <bp@alien8.de> wrote:
> >
> > On Fri, Jul 07, 2023 at 11:56:00AM +0100, Dimitri John Ledkov wrote:
> > > Add support for setting march to x86-64-v2, x86-64-v3, x86-64-v4 with
> > > tuning set to an early family of CPUs that support such instruction
> > > levels. By default gcc sets generic tuning for x86-64-v*, which is
> > > suboptimal for all brands of CPUs with such instruction set support.
> >
> > Prove that it is suboptimal for the kernel. Numbers please.
> 
> It's not suboptimal for the kernel as is, it is suboptimal for
> march=x86-64-v* as documented in gcc - probably gcc should actually
> prohibit mtune=generic with march=x86-64-v* settings.

I can't parse that. You probably need to explain in greater detail:
these are the current GENERIC_CPU options, the problem is <bla>, the fix
is <foo> and so on.

> > And even if it shows on *some* uarch:
> >
> > * we need a *single* setting for distro kernels - i.e.,
> > CONFIG_GENERIC_CPU and compilers do make sure that -mtune=generic does
> > the most optimal code generation for all uarches
> >
> > * our Kconfig option set is abysmal so don't need any more if useless.
> >
> > Yeah, a patch like that keeps popping up on a regular basis but no,
> > thanks.
> 
> The biggest issue is that march & mtune is always set, and there is no
> option to use the compiler configured builtin default, or pass in an
> arbitrary string.

Why would you want to use the compiler configured builtin default?

> Would it be acceptable to change GENERIC_CPU to not set neither march
> nor mtune and thus use the compiler configured default? If not, would
> it be acceptable to have a new option GENERIC_NONE which does not set
> any march/mtune and thus uses a compiler configured default? Or for
> example, allow a new freeform string for march and mtune?

You're asking me all those questions but you're not giving any reasoning
*why*. You need to sell it to me and explain why it should be in the
kernel. What's the use case that the majority of users out there will
profit from and so on and so on.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

      reply	other threads:[~2023-07-07 12:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-07 10:56 Dimitri John Ledkov
2023-07-07 11:28 ` Borislav Petkov
2023-07-07 11:46   ` Dimitri John Ledkov
2023-07-07 12:05     ` Borislav Petkov [this message]

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=20230707120500.GDZKf/bDf8wIQmpixs@fat_crate.local \
    --to=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dimitri.ledkov@canonical.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matz@suse.de \
    --cc=mingo@redhat.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 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®