Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Feb 2018 09:32:03 -0800
From:      Mark Millard <marklmi26-fbsd@yahoo.com>
To:        Konstantin Belousov <kib@freebsd.org>
Cc:        Stefan Blachmann <sblachmann@gmail.com>, Eitan Adler <lists@eitanadler.com>, "Conrad E. Meyer" <cem@freebsd.org>, FreeBSD Standards <freebsd-standards@freebsd.org>, FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Marking select(2) as restrict
Message-ID:  <0C8DEA21-0F27-4D8D-8E30-42378B166FBF@yahoo.com>
In-Reply-To: <20180225135111.GO94212@kib.kiev.ua>
References:  <20180221185920.GA94212@kib.kiev.ua> <23181.50488.186767.579361@khavrinen.csail.mit.edu> <20180221201002.GC94212@kib.kiev.ua> <23181.54825.511195.393054@khavrinen.csail.mit.edu> <20180222212746.GB58772@stack.nl> <CAF6rxgkW=Fgh4%2B1-aJG=VUCYso9gcKnER17UOiBy8GtTMsJNYQ@mail.gmail.com> <CAF6rxg=-nBz8caa1Wn1Labn3DydpEO6B8W9PaLhNKYFwGvuZxw@mail.gmail.com> <CAG6CVpV-YBfGsh5zDRuB7N43N4FW5X69BDyi_XF21fs7tOr5JQ@mail.gmail.com> <CAF6rxgnOEegTYc0_Yi-wA7KR4wEjQAAuWAppdsKF6eQXEC4bew@mail.gmail.com> <CACc-My3hXAoA6YyJeGV-tQ7%2BFW_ct3k_6gyA1db5=jz7ST5c=g@mail.gmail.com> <20180225135111.GO94212@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2018-Feb-25, at 5:51 AM, Konstantin Belousov <kib at freebsd.org> =
wrote:

> On Sun, Feb 25, 2018 at 06:52:55AM +0100, Stefan Blachmann wrote:
>> The Linux manual pages do not mention restrict for select().
>> glibc select() itself returns just ENOSYS(), if there is no alias for =
select().
>>=20
>> So I guess what actually gets called is this:
>> https://github.com/udp/freebsd-libc/blob/master/sys/select.c#L48
>> Which in turn appears to call __sys_select:
>> =
https://github.com/udp/freebsd-libc/blob/master/include/libc_private.h#L34=
6
>> See also:
>> =
https://lists.freebsd.org/pipermail/freebsd-questions/2007-August/154906.h=
tml
>>=20
>> If I understand correctly, the *only* place that defines the
>> optimizations actually being done is the static functions itself:
>> =
https://github.com/freebsd/freebsd/blob/master/lib/libthr/thread/thr_sysca=
lls.c#L487
> No, you do not understand this correctly. Select(2) implementation is
> in kernel and cannot be affected by the userspace prototype change. It
> is the caller of select(2) which might be optimized unexpectedly when
> select claims that its arguments cannot be aliased.
>=20
> The use of restrict in the glibc prototype would be a good argument if
> clang on glibc were not a rare combination.

I'm only noting where some evidence might be available . . .

My understanding is that there is (at least) one desktop Linux
distribution that is clang based: OpenMadriva Lx. It may be a
source of information. Checking a little into its status . . .

=46rom https://en.wikipedia.org/wiki/OpenMandriva_Lx :

"A beta release of OpenMandriva Lx 3.0 was released in June 2016.[19]
This new release came with significant changes to the core system
- among other things, it was the first desktop Linux distribution
that was built completely with the Clang compiler instead of GCC."

https://wiki.openmandriva.org/en/3.03/Release_Notes#LLVM.2Fclang
reports:

"OpenMandriva provides LLVM/clang 5.0.0 as the default compiler,
GCC is also available. Over 90% of packages in our main repository
are now built with LLVM/clang."

=
https://www.openmandriva.org/en/news/article/openmandriva-lx-3-03-get-it-w=
hile-it-s-hot
reports:

"Everything with this release, including the new Firefox Quantum
57, is compiled with LLVM/clang 5.0.0"

Looking quickly, there is glibc source involved:

https://github.com/OpenMandrivaAssociation/glibc/tree/master

(There are other branches, such a 3.0 branch.) I have not
analyzed the patches that they use.

For reference for V3.03:
( =
https://www.openmandriva.org/en/news/article/openmandriva-lx-3-03-get-it-w=
hile-it-s-hot )

"At the hardware level there is an up-to-date kernel at 4.13.12
release and systemd 234 and for your graphics stack mesa 17.2.3
with a S3TC support enabled and xorg 1.19.5."

"Our main desktop environment KDE Plasma is updated to 5.10.5
and Frameworks are at 5.39."



=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( markmi at dsl-only.net is
going away in 2018-Feb, late)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0C8DEA21-0F27-4D8D-8E30-42378B166FBF>