From nobody Mon Jul 19 14:33:03 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2B5943EE2D2 for ; Mon, 19 Jul 2021 14:33:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4GT4886Hxbz3LGF; Mon, 19 Jul 2021 14:33:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 16JEX3X3007066 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 19 Jul 2021 17:33:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 16JEX3X3007066 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 16JEX3jN007065; Mon, 19 Jul 2021 17:33:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 19 Jul 2021 17:33:03 +0300 From: Konstantin Belousov To: Warner Losh Cc: Dmitry Chagin , FreeBSD Hackers Subject: Re: pondering pi futexes Message-ID: References: List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4GT4886Hxbz3LGF X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Mon, Jul 19, 2021 at 08:08:02AM -0600, Warner Losh wrote: > On Mon, Jul 19, 2021, 3:35 AM Konstantin Belousov > wrote: > > > On Mon, Jul 19, 2021 at 11:01:17AM +0300, Dmitry Chagin wrote: > > > Hi, thanks for the reply, I mostly finished, > > > the new futex impl is fully based on the umtx code, one question before > > review. > > > some umtx API, which is needed for futexes, inlined, like > > > umtxq_busy/unbusy, umtxq_lock/unlock, umtx_pi_alloc/pi_free, etc.. > > > For now I moved such API to the umtx header, but as far as I understand > > > compilers are smart enough now to optimize code without suggestions. > > > Maybe it's time to drop inline hint? > > > > > May be. It is impossible to provide a justified answer without looking > > at the generated code, with/without inline. But usually yes, inline does > > not make a difference for not too large static functions. > > > > Even in header files? There I thought it was one of the few places it > mattered due to semantic differences... has that changed? It does not matter where the static function defined. After the preprocessing stage, compiler parses the compilation unit as the whole. This is formally described in C17 STD 5.1.1.2 Translation phases. Preprocessing occurs in phase 4, while translation proper starts at phase 7 (and finished in 8).