From patchwork Wed Sep 30 04:27:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Nakryiko X-Patchwork-Id: 11807841 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 65609139A for ; Wed, 30 Sep 2020 04:28:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 49BD620872 for ; Wed, 30 Sep 2020 04:28:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="aO7Ljzad" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725385AbgI3E2T (ORCPT ); Wed, 30 Sep 2020 00:28:19 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:40034 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725801AbgI3E2T (ORCPT ); Wed, 30 Sep 2020 00:28:19 -0400 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08U4QZ05001869 for ; Tue, 29 Sep 2020 21:28:18 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=facebook; bh=mX9KE6mb3xhDNfI80kVyZe5AkD9OP3wbxlF8NxUF65U=; b=aO7Ljzadv3RaiyG6iBYB9AHX/xt15X1qc2hUE4JvIgLjchYoq6vycL2UH/v5Y0wmI0hK mn+2DErQGAJnwJyCy1+H4I8KJBEi8ibPJVE7IHAvnWkQv/Hhr+UjmcROHse4vpcKuIjo g+a7EJHI7hWSY2RJGOyyzCPlqAPOpmoXw3M= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 33v3vtvjhy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 29 Sep 2020 21:28:18 -0700 Received: from intmgw002.08.frc2.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::e) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 29 Sep 2020 21:28:17 -0700 Received: by devbig012.ftw2.facebook.com (Postfix, from userid 137359) id 8E66A2EC77F1; Tue, 29 Sep 2020 21:28:11 -0700 (PDT) From: Andrii Nakryiko To: CC: , Andrii Nakryiko Subject: [PATCH dwarves 09/11] dwarf_loader: increase the size of lookup hash map Date: Tue, 29 Sep 2020 21:27:40 -0700 Message-ID: <20200930042742.2525310-10-andriin@fb.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200930042742.2525310-1-andriin@fb.com> References: <20200930042742.2525310-1-andriin@fb.com> MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-09-30_01:2020-09-29,2020-09-30 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 lowpriorityscore=0 suspectscore=13 phishscore=0 mlxlogscore=629 clxscore=1015 bulkscore=0 impostorscore=0 adultscore=0 priorityscore=1501 spamscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009300032 X-FB-Internal: deliver Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org One of the primary use cases for using pahole is BTF deduplication during Linux kernel build. That means that DWARF contains more than 5 million types is loaded. So using a hash map with a small number of buckets is quite expensive due to hash collisions. This patch bumps the size of the hash map and reduces overhead of this part of the DWARF loading process. This shaves off about 1 second out of about 20 seconds total for Linux BTF dedup. Signed-off-by: Andrii Nakryiko --- dwarf_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dwarf_loader.c b/dwarf_loader.c index 63988011978f..05c96bef09e3 100644 --- a/dwarf_loader.c +++ b/dwarf_loader.c @@ -89,7 +89,7 @@ static void dwarf_tag__set_spec(struct dwarf_tag *dtag, dwarf_off_ref spec) *(dwarf_off_ref *)(dtag + 1) = spec; } -#define HASHTAGS__BITS 8 +#define HASHTAGS__BITS 15 #define HASHTAGS__SIZE (1UL << HASHTAGS__BITS) #define obstack_chunk_alloc malloc