From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 7FB6A385801D for ; Mon, 22 Feb 2021 17:01:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7FB6A385801D Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-273-tHI3inVoNuKB34GJlxjEDg-1; Mon, 22 Feb 2021 12:01:26 -0500 X-MC-Unique: tHI3inVoNuKB34GJlxjEDg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5325E6D4F0; Mon, 22 Feb 2021 17:01:25 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-131.ams2.redhat.com [10.36.113.131]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77F1060C47; Mon, 22 Feb 2021 17:01:24 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 6/6] nptl: Move elision implementations into libc References: <2bfbf479cfc97fac04d1e07c6934afefafbf6b56.1613582255.git.fweimer@redhat.com> <6d274cde-bfed-49fb-5cda-cf438e18ad93@linaro.org> Date: Mon, 22 Feb 2021 18:02:06 +0100 In-Reply-To: <6d274cde-bfed-49fb-5cda-cf438e18ad93@linaro.org> (Adhemerval Zanella's message of "Mon, 22 Feb 2021 13:53:25 -0300") Message-ID: <874ki43uk1.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Feb 2021 17:01:30 -0000 * Adhemerval Zanella: >> +/* Automatically enable elision for existing user lock kinds. */ >> +# define FORCE_ELISION(m, s) \ >> + if (__pthread_force_elision) \ >> + { \ >> + if ((mutex_kind & PTHREAD_MUTEX_ELISION_NP) != 0) \ >> + { \ >> + s; \ >> + } \ >> + } > > Maybe since you are refactoring it, to use a static inline instead of macro > here? That's not possible due to the way the s parameter is used. >> diff --git a/sysdeps/unix/sysv/linux/powerpc/pthread_mutex_timedlock.c b/sysdeps/pthread/elision-conf.h >> similarity index 64% >> rename from sysdeps/unix/sysv/linux/powerpc/pthread_mutex_timedlock.c >> rename to sysdeps/pthread/elision-conf.h >> index 6f8b06d459..6635a7c56f 100644 >> +/* No elision support by default. */ >> +#define HAVE_ELISION 0 > > Maybe prepend the define with a string related to code it relates to, > like 'ELISION_CONF_'? This links the define more directly to the > implementation, since HAVE_* is usually defined by config.h. Like ENABLE_ELISION_SUPPORT instead of HAVE_ELISION? Fine. I just reused what was there. The elision-conf.h file name is also not 100% appropriate given those two defines. Thanks for the review. Florian