From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11296 invoked by alias); 27 Jun 2013 10:52:33 -0000 Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org Received: (qmail 11277 invoked by uid 89); 27 Jun 2013 10:52:32 -0000 X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=no version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 27 Jun 2013 10:52:30 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Us9oS-0002fW-My from Maciej_Rozycki@mentor.com ; Thu, 27 Jun 2013 03:52:28 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 27 Jun 2013 03:52:28 -0700 Received: from [172.30.64.155] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Thu, 27 Jun 2013 11:52:25 +0100 Date: Thu, 27 Jun 2013 10:52:00 -0000 From: "Maciej W. Rozycki" To: Roland McGrath CC: "H.J. Lu" , GNU C Library , Subject: Re: [PATCH 1/5][v2][BZ #15022] Avoid repeated calls to DL_STATIC_INIT In-Reply-To: <20130621181119.DACD52C09F@topped-with-meat.com> Message-ID: References: <20130116215545.7A37A2C0B0@topped-with-meat.com> <20130531200059.C94C02C077@topped-with-meat.com> <20130619233103.A913F2C0A6@topped-with-meat.com> <20130620204740.69A5E2C135@topped-with-meat.com> <20130621181119.DACD52C09F@topped-with-meat.com> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2013-06/txt/msg00059.txt.bz2 On Fri, 21 Jun 2013, Roland McGrath wrote: > I concur with your analysis. (I was considering the relationship of the > two locks when responding to HJ earlier, but failed to be clear about it.) > I think it's wise to make the removal of the extraneous lock a separate > follow-up change, just for paranoia's sake (i.e. ease of reversion if > needed for some unforeseen reason). Thanks for confirming. I have applied this change now, and the change below to remove the lock (no regressions in testing). > The issue of the internal lock held while calling user initializers is > entirely separate. It has concerned me before when I've noticed it in > passing, but I never dawdled long enough to bring it up for discussion. I > think you should file a bug about that one and we'll consider it separately > later. But that will clearly have to be after the impending freeze. BZ #15686 now. 2013-06-27 Maciej W. Rozycki ports/ChangeLog.ia64 * sysdeps/unix/sysv/linux/ia64/dl-static.c: Do not include . (_dl_static_lock): Remove variable. (_dl_static_init): Remove _dl_static_lock locking. ports/ChangeLog.mips * sysdeps/unix/sysv/linux/mips/dl-static.c: Do not include . (_dl_static_lock): Remove variable. (_dl_static_init): Remove _dl_static_lock locking. Maciej glibc-static-dl-init-lock.diff Index: glibc-fsf-trunk-quilt/ports/sysdeps/unix/sysv/linux/ia64/dl-static.c =================================================================== --- glibc-fsf-trunk-quilt.orig/ports/sysdeps/unix/sysv/linux/ia64/dl-static.c 2013-06-18 01:05:31.000000000 +0100 +++ glibc-fsf-trunk-quilt/ports/sysdeps/unix/sysv/linux/ia64/dl-static.c 2013-06-21 19:54:31.852772816 +0100 @@ -35,9 +35,6 @@ _dl_var_init (void *array[]) } #else -#include - -__libc_lock_define_initialized_recursive (static, _dl_static_lock) static void *variables[] = { @@ -52,8 +49,6 @@ _dl_static_init (struct link_map *map) lookup_t loadbase; void (*f) (void *[]); - __libc_lock_lock_recursive (_dl_static_lock); - loadbase = _dl_lookup_symbol_x ("_dl_var_init", map, &ref, map->l_local_scope, NULL, 0, 1, NULL); if (ref != NULL) @@ -61,8 +56,6 @@ _dl_static_init (struct link_map *map) f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref); f (variables); } - - __libc_lock_unlock_recursive (_dl_static_lock); } #endif Index: glibc-fsf-trunk-quilt/ports/sysdeps/unix/sysv/linux/mips/dl-static.c =================================================================== --- glibc-fsf-trunk-quilt.orig/ports/sysdeps/unix/sysv/linux/mips/dl-static.c 2013-06-18 01:05:31.000000000 +0100 +++ glibc-fsf-trunk-quilt/ports/sysdeps/unix/sysv/linux/mips/dl-static.c 2013-06-21 19:54:51.852817334 +0100 @@ -33,9 +33,6 @@ _dl_var_init (void *array[]) } #else -#include - -__libc_lock_define_initialized_recursive (static, _dl_static_lock) static void *variables[] = { @@ -64,8 +61,6 @@ _dl_static_init (struct link_map *l) void (*f) (void *[]); size_t i; - __libc_lock_lock_recursive (_dl_static_lock); - loadbase = _dl_lookup_symbol_x ("_dl_var_init", l, &ref, l->l_local_scope, NULL, 0, 1, NULL); @@ -84,8 +79,6 @@ _dl_static_init (struct link_map *l) f (variables); _dl_protect_relro (rtld_map); } - - __libc_lock_unlock_recursive (_dl_static_lock); } #endif