From owner-freebsd-hackers@freebsd.org Sun Feb 25 17:42:18 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96BACF03A72 for ; Sun, 25 Feb 2018 17:42:18 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic307-9.consmr.mail.gq1.yahoo.com (sonic307-9.consmr.mail.gq1.yahoo.com [98.137.64.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F54368CC6 for ; Sun, 25 Feb 2018 17:42:17 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: j.1WblMVM1k6TvUCt_SeQvg09_WKkQkhu6IaP98pLJwinQ.ag62IcfE3f.Zk8v7 lKYzmsWBT7q873AK8AQOWv9GbCVPq0CTssphe2l4O2n8UyY5QIY_1kCrt2BDLasnO.LqUzA2Nulj edXDub5AFq4FMH3I9oyiHJeMCAL_Y6p.kUzeSPZQ0KHzLMpoI3s8awgperhRVoYtUTPqwsN49D0v x7lGHEbesAN3I4_vZwinKgf4A2_PSuj1qD1oqau5HKI7Uaib38qPZGRHnfk2DU0qdyqHv8qtv9QQ 6Hiv4PRiZ.ou6FbuTDlMf8p.cCvW4HM4wBe9RYjOTsV4uIhQM8kunjUPmc0XbqTN61kfTevRHdpB .eJLsTtZOOLCg6nxyu.pChyIk8OUpprKRKO.IH9Q04GjzQa3.TakMXfb5eW7KlXhUUhid9dCajeG wdomriT0bUAHDayQAQS2B2SHO8wIJvfVMOWDjOqWMWpmtD6db_7YxGO50uZrkS8lBQ.OAfBQ- Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.gq1.yahoo.com with HTTP; Sun, 25 Feb 2018 17:42:16 +0000 Received: from smtp105.rhel.mail.gq1.yahoo.com (EHLO [192.168.1.25]) ([68.180.227.8]) by smtp413.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 151b169aca54fce9868b612577f67de5; Sun, 25 Feb 2018 17:32:04 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: Marking select(2) as restrict From: Mark Millard In-Reply-To: <20180225135111.GO94212@kib.kiev.ua> Date: Sun, 25 Feb 2018 09:32:03 -0800 Cc: Stefan Blachmann , Eitan Adler , "Conrad E. Meyer" , FreeBSD Standards , FreeBSD Hackers Content-Transfer-Encoding: quoted-printable Message-Id: <0C8DEA21-0F27-4D8D-8E30-42378B166FBF@yahoo.com> 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> <20180225135111.GO94212@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3445.5.20) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 17:42:18 -0000 On 2018-Feb-25, at 5:51 AM, Konstantin Belousov = 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)