From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from elephant.ash.relay.mailchannels.net (elephant.ash.relay.mailchannels.net [23.83.222.57]) by sourceware.org (Postfix) with ESMTPS id EDB923858D28 for ; Sun, 15 May 2022 00:58:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EDB923858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 1A0C5121D42; Sun, 15 May 2022 00:58:45 +0000 (UTC) Received: from pdx1-sub0-mail-a304.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 82DDD121D98; Sun, 15 May 2022 00:58:44 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1652576324; a=rsa-sha256; cv=none; b=Ydg+K3IM28OVWr9thP2No5/lVDZRmcWySaclKFBURQSRlKVSCMrAMJfkrg7fjfI5etrOUo sM3xzLWPEFGUpgYyFgsE0zthbdV0In7I7CGIbx0xxAaXH1PsJ12Xij2ng+hoPRs4y3Y2h/ EMmNAuNddTm4HsYaMImBeVEXbeh2dgcAnZNjyAb1QVrZXUuy8h9Ckfck4wBR569MzfoIfm Op7SmxUBvxqXeb+OLlfT300O8aJuzD9X8Jg/62UqsGMygejhTu4ozIGmJm5gfbhLDvBKpN RopZyoQ/bpfDzPTFBcnUjic1F16P0IQSy9vCDb0FYiNsQEZAR5+aWsmVg2lORQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1652576324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sGid9F1QOxaHbUT2v9O2HEKci3nipPSPViAByvJ0CEA=; b=oDbRKZ1PyA6Lcpj8E5gzAPLHiheZK8SeIQLgeN8e+oh4Hx5wGM8JCR0oJ99rjTg1Dla3+Y pLhdvd1teJksHumCAnaKoRY65Rx0UJ8hOstLq/YRWkO3DUPc9mVZlcU++591VETxQQQ7Ug qbYgsnFSQ/HtUM+YGBtpYGouW1bxvElM87IFc1uPMdlUhvWVzs+e2xOTgBBpjtP+G5uRVZ X2kS6VmW5e2Em1XSbt6yeOdIFgOfOlEtWGzrjMtp8WsnoFIPqxk4uokv/NnwWv+xNly5nU 2mJv0Sc/dwYoxm70y0hQAfQarJWWNQCEdXJsJJ9LjQJ+DFWMOm+jTtfHRAt9DA== ARC-Authentication-Results: i=1; rspamd-6fcfc4d76-j5hmm; auth=pass smtp.auth=dreamhost smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Illustrious-Chemical: 0c16a4ec0928b0c0_1652576324759_2274303078 X-MC-Loop-Signature: 1652576324759:666085846 X-MC-Ingress-Time: 1652576324759 Received: from pdx1-sub0-mail-a304.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.112.55.199 (trex/6.7.1); Sun, 15 May 2022 00:58:44 +0000 Received: from [192.168.86.152] (unknown [103.199.173.7]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a304.dreamhost.com (Postfix) with ESMTPSA id 4L13st4Tb3zlR; Sat, 14 May 2022 17:58:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gotplt.org; s=dreamhost; t=1652576324; bh=sGid9F1QOxaHbUT2v9O2HEKci3nipPSPViAByvJ0CEA=; h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding; b=EF3bCGrXVxED0X7jAvdxDnPc9G1sbT2uoqQWF9hZGr9LLfS/NeZ/JYcxoI4wKXmCY x5gXi3zNr3Ho+3OLY8BCQ6Am0Iv88g0yYHJHNQQzgGu7nvqFiO3NB3blsAr6JUml7s qI0oQrCfyshV7eM++VCeud6MYdGdTMpjtuKaZcFrrk5ml/gItHx10imEUqtY3a/yi/ BZSUjW4Zl+45mVhVyI+hTw7D/6GKdL8OQDQEtb/r18g5Sm2TZenHwYh/ry0lsFu0lN egF89y8LARv1Novdok5pdIJdoPRfX0+KxaUhPwtaRoXpUFcQAM6CpT94ozUX3/JmCy vFOCEXGGJZ7aw== Message-ID: Date: Sun, 15 May 2022 06:28:35 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v3] elf: Rewrite long RESOLVE_MAP macro to a debug friendly function Content-Language: en-US To: Fangrui Song , Nicholas Guriev Cc: libc-alpha@sourceware.org References: <20220514224849.d7isxwcxnxoo3jhc@google.com> From: Siddhesh Poyarekar In-Reply-To: <20220514224849.d7isxwcxnxoo3jhc@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3030.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Sun, 15 May 2022 00:58:51 -0000 On 15/05/2022 04:18, Fangrui Song wrote: > On 2022-05-14, Nicholas Guriev wrote: >> On Пн, 2022-05-09 at 19:08 +0530, Siddhesh Poyarekar wrote: >>> Please use __always_inline instead, which adds the inline keyword as >>> well as __attribute__ ((inline)).  That way gcc ensures that the >>> function is *always* inlined. >> >> That is not necessary. My original intention was to improve the >> debugging experience at this point. And the standard `inline` keyword >> allows one to control optimizations with the -O flag. You can't build glibc with anything less than -O2, so that's a moot point. If you don't use __always_inline here then you're not only changing the debugging experience, but also potentially adding a performance overhead. gdb can do well enough in most cases of inlined functions, so __always_inlined should not hamper that. > Looks good to me, I think the always_inline here does not affect > performance, as shown in my testing with a large PIE with many > R_*_RELATIVE (function call overhead is larger with a non-R_*_RELATIVE). If you want to make a decision based on this then please quantify it more precisely with a microbenchmark added to benchtests. Otherwise just add __always_inline because it is a more minimal change. TBH I'd prefer the former because it then adds a new microbenchmark that we can measure dynamic linker changes in future but I can live with the latter. Thanks, Siddhesh