From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by sourceware.org (Postfix) with ESMTPS id F062A381DCF6 for ; Wed, 18 Mar 2020 11:37:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F062A381DCF6 Received: by mail-wr1-x442.google.com with SMTP id y2so14410605wrn.11 for ; Wed, 18 Mar 2020 04:37:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KWCBNeVe3zO4STfrFYQxLI88gRPch7YfPtGosXw2rrc=; b=b28c/SHV5ZCq7SAzr+Y6gDADO5BOlQNzY1zOEAqlm0cCQTnHuqSoR1FxuHNX5vxb4t RY9qxWkGOm0VuHTNXvC3Oxg1azLJkmLPkvoDb1m0CFejLFhZXIahEeboru1JQv03eC/i I5rxkGT1derNyr8h2tMFilkdjvl48KHOwziZYCLNO2GRpmbZTEJI353/a5qV7pBlCfXc Oi8S4y+zs1aA9OfNy9ePe0s1V6TnDhL17ZaL/VYHmbra4wL/eA2pm3JyZ7iUnoT3G/qy cZYpsHVlvrr1BvoMRJFV5Q2vToBabTK+HeGY8YoniEZkxBpr5GpBMFdjPS5hpBYmCvpY p+JQ== X-Gm-Message-State: ANhLgQ0n/d10PsFCayLGHULJ4riJSrkvITU/fqOT1V8etmqbgJ5ZXLng ISsqK6u4nTZHu+fgHATTFnrpog== X-Google-Smtp-Source: ADFU+vud0MGDeeTAnG+xLKxum5oOotpyKuJ4DGlB494KvJnYUtS/i7GoL8k0w0adCVvkpQnOztSbvg== X-Received: by 2002:a05:6000:d0:: with SMTP id q16mr5429976wrx.71.1584531475461; Wed, 18 Mar 2020 04:37:55 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:e8f7:125b:61e9:733d]) by smtp.gmail.com with ESMTPSA id y189sm3759688wmb.26.2020.03.18.04.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2020 04:37:54 -0700 (PDT) Date: Wed, 18 Mar 2020 12:37:54 +0100 From: Matthias Maennich To: Giuliano Procida Cc: libabigail@sourceware.org, dodji@seketeli.org, kernel-team@android.com Subject: Re: [PATCH] dwarf-reader: Use high bits of Bloom filter words. Message-ID: <20200318113754.GI211970@google.com> References: <20200318102055.109824-1-gprocida@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200318102055.109824-1-gprocida@google.com> User-Agent: Mutt/1.12.2 (2019-09-21) X-Spam-Status: No, score=-40.2 required=5.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, FSL_HELO_FAKE, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libabigail mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2020 11:37:58 -0000 Hi! On Wed, Mar 18, 2020 at 10:20:55AM +0000, Android Kernel Team wrote: >Most of the bit values used for GNU hash ELF section Bloom filtering >were being ignored due to integer narrowing, reducing missing symbol >filtering efficiency considerably. Nice! Maybe add the analysis result from the other mail thread to point out the improvement made here (and the justification for this change). > >This patch fixes this. > > * src/abg-dwarf-reader.cc (lookup_symbol_from_gnu_hash_tab): > Don't narrow calculated Bloom word to 8 bits before using it > to mask the fetched Bloom word. Please sign off your work. Reviewed-by: Matthias Maennich Cheers, Matthias >--- > src/abg-dwarf-reader.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc >index 3454fcf5..5556bde5 100644 >--- a/src/abg-dwarf-reader.cc >+++ b/src/abg-dwarf-reader.cc >@@ -2025,7 +2025,7 @@ lookup_symbol_from_gnu_hash_tab(const environment* env, > // filter, in bits. > int c = get_elf_class_size_in_bytes(elf_handle) * 8; > int n = (h1 / c) % ht.bf_nwords; >- unsigned char bitmask = (1ul << (h1 % c)) | (1ul << (h2 % c)); >+ GElf_Word bitmask = (1ul << (h1 % c)) | (1ul << (h2 % c)); > > // Test if the symbol is *NOT* present in this ELF file. > if ((bloom_word_at(elf_handle, ht.bloom_filter, n) & bitmask) != bitmask) >-- >2.25.1.481.gfbce0eb801-goog > >