unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: 'GNU C Library' <libc-alpha@sourceware.org>
Subject: Re: [PATCH] AArch64: Check kernel version for SVE ifuncs
Date: Thu, 14 Mar 2024 14:42:41 +0000	[thread overview]
Message-ID: <PAWPR08MB8982C2CAD157BCBC9BA9B5E083292@PAWPR08MB8982.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <878r2lnpx9.fsf@oldenburg.str.redhat.com>

Hi Florian,

> Given that the existing SVE users have not complained about this, is it
> really a good idea to disable SVE string functions for them?  Not
> everyone interleaves system calls and string functions in inner loops.

People have found significant regressions when trying the SVE memcpy [1],
the kernel commit mentions 70% overhead in microbenchmarks [2].

Also distros appear to use a wide range of kernel versions. I've seen the
same GLIBC version used with 5.11 kernel all the way up to 6.5 in the
same version of a distro - and these are all standard installations...

Hence we need some kind of workaround to deal with old kernels before
adding more uses of SVE (new SVE ifuncs or backports of existing ones).

> +/* Parse kernel version without calling any library functions.
> +   Allow 2 digits for kernel version and 3 digits for major version,
> +   separated by '.': "kk.mmm.".
> +   Return kernel version * 1000 + major version, or -1 on failure.  */

> I think you should parse the versions you exclude because you know their
> syntax.  We tried to predict the layout of future kernel version strings
> before and failed.

Yes that is a good idea. So we could just scan for "k.m." format and if it doesn't
match or if uname fails, treat it like a new kernel. It's not a correctness issue,
so if someone uses a different format or blocks uname() in a container then it's
fine to assume it is a new kernel and enable the SVE ifuncs.

Cheers,
Wilco


[1] https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1999551/comments/45
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm64/kernel/fpsimd.c?id=8c845e2731041f0fdf9287dea80b039b26332c9f

  reply	other threads:[~2024-03-14 14:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 14:31 [PATCH] AArch64: Check kernel version for SVE ifuncs Wilco Dijkstra
2024-03-13 18:12 ` Adhemerval Zanella Netto
2024-03-13 19:25   ` Szabolcs Nagy
2024-03-13 19:55     ` Adhemerval Zanella Netto
2024-03-14  8:35       ` Szabolcs Nagy
2024-03-14 13:47         ` Adhemerval Zanella Netto
2024-03-14 14:26           ` Szabolcs Nagy
2024-03-14 14:28             ` Adhemerval Zanella Netto
2024-03-14  9:02       ` Florian Weimer
2024-03-13 18:39 ` Szabolcs Nagy
2024-03-13 19:31 ` Andrew Pinski
2024-03-13 20:44   ` Wilco Dijkstra
2024-03-14  9:06 ` Florian Weimer
2024-03-14 14:42   ` Wilco Dijkstra [this message]
2024-03-14 14:55     ` Florian Weimer
2024-03-14 15:38       ` Wilco Dijkstra
2024-03-14 16:52         ` Florian Weimer
2024-03-18 11:46           ` Florian Weimer
2024-03-18 14:22             ` Wilco Dijkstra

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

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PAWPR08MB8982C2CAD157BCBC9BA9B5E083292@PAWPR08MB8982.eurprd08.prod.outlook.com \
    --to=wilco.dijkstra@arm.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).