From patchwork Tue Sep 12 09:35:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 22837 Received: (qmail 10501 invoked by alias); 12 Sep 2017 09:36:00 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 10487 invoked by uid 89); 12 Sep 2017 09:35:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=H*MI:4326, H*MI:db01, optin, opt-in X-HELO: mx0a-001b2d01.pphosted.com Subject: Re: [RFC][PATCH] tunables: Add elision tunable To: libc-alpha@sourceware.org References: <83765281-100b-a041-405e-d36b97581095@linux.vnet.ibm.com> From: Stefan Liebler Date: Tue, 12 Sep 2017 11:35:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <83765281-100b-a041-405e-d36b97581095@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17091209-0016-0000-0000-000004EC4C32 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17091209-0017-0000-0000-00002826620C Message-Id: <27740ddf-7a0e-4326-db01-44e5b30fcafb@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-09-12_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1709120133 On 09/11/2017 03:25 PM, rcardoso wrote: > Hello, > > Attached to this mail I have a patch which add elision to tunables > framework. This is a rebase of Paul Murphy's patch [1]. Also there's a > RFC related to this [2]. > > [1] https://patchwork.sourceware.org/patch/10342/ > [2] https://patchwork.sourceware.org/patch/20407/ Hi Rogerio, Thanks for working on this topic. In addition to Paul's patches, here is a link to a newer patch from Carlos: "RFC: Always-on elision with per-process opt-in using tunables." https://www.sourceware.org/ml/libc-alpha/2017-05/msg00335.html He also removes the --enable-lock-elision configure flag. Is this also required for your patch? I've applied your patch to test it on s390x. Some changes are needed in order to get it work: Note: I haven't tested it on power or x86. With these mentioned changes and the comments below, I could build glibc and the testsuite runs without regressions. I've also used a small s390 specific test program to check wether a mutex was elided or not: ./prog Lock was a normal lock! GLIBC_TUNABLES=glibc.elision.enable=0 ./prog Lock was a normal lock! GLIBC_TUNABLES=glibc.elision.enable=1 ./prog Lock was elided via a transaction! (nesting-depth=1) GLIBC_TUNABLES=glibc.elision.enable=1 ./prog_secure Lock was a normal lock! GLIBC_TUNABLES=glibc.elision.enable=2 ./prog Lock was a normal lock! GLIBC_TUNABLES=glibc.elision.enable=yes ./prog Lock was a normal lock! Note: I haven't tested setting the other variables. Thanks, Stefan diff --git a/manual/tunables.texi b/manual/tunables.texi index 166624c..fb845b1 100644 --- a/manual/tunables.texi +++ b/manual/tunables.texi @@ -211,6 +211,7 @@ bounded, the user may set this tunable to limit the number of chunks that are scanned from the unsorted list while searching for chunks to pre-fill the per-thread cache with. The default, or when set to zero, is no limit. +@end deftp @node Elision Tunables @section Elision Tunables diff --git a/sysdeps/unix/sysv/linux/s390/elision-conf.c b/sysdeps/unix/sysv/linux/s390/elision-conf.c index 5f9c6d1..3dcf580 100644 --- a/sysdeps/unix/sysv/linux/s390/elision-conf.c +++ b/sysdeps/unix/sysv/linux/s390/elision-conf.c @@ -21,9 +21,9 @@ #include #include #include -#ifdef HAVE_TUNABLES -# include +#if HAVE_TUNABLES # define TUNABLE_NAMESPACE elision +# include #endif /* Reasonable initial tuning values, may be revised in the future. @@ -57,7 +57,7 @@ struct elision_config __elision_aconf = int __pthread_force_elision attribute_hidden = 0; -#ifdef HAVE_TUNABLES +#if HAVE_TUNABLES static inline void __always_inline do_set_elision_enable (int32_t elision_enable) @@ -106,7 +106,7 @@ elision_init (int argc __attribute__ ((unused)), char **argv __attribute__ ((unused)), char **environ) { -#ifdef HAVE_TUNABLES +#if HAVE_TUNABLES /* Elision depends on tunables and must be explicitly turned on by setting the appropriate tunable on a supported platform. */