Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1088614pxm; Wed, 23 Feb 2022 17:50:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+D0DVoEIBu37QIpJXokbCyPQWPBQngWQq7dAA1d1MMLYhHmKPTpXtKzgxro2wbNioZebd X-Received: by 2002:a17:90a:a594:b0:1bc:5def:a652 with SMTP id b20-20020a17090aa59400b001bc5defa652mr407946pjq.167.1645667423658; Wed, 23 Feb 2022 17:50:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645667423; cv=none; d=google.com; s=arc-20160816; b=TnKCLpP6qHt7fj3bN1QjXrsta0LyWnPPGDQLeQXRpAxC05UxHcFu3mvW2Qi9k0/NZ4 sTw0Y52AHOGF/uso5o/zmZYyEwGqvdZXjGu3f2x6t0liCRz2UxyjpP5sXgAThzExeiGX ZZTCWk1cTJvS9NN2VUGzD8g+I3Kc7KBvskqFOh0gD7tTl+oPudGrywU6KVAaiYVkBNC7 z3+bQdI9M5u3JE9NwhetwrmuyVSmGf7OTObaGqnib8L+qsAvU2m3W/Vi845I3xkaslSx Q5I/GlgdqSGn1xT1ztX73V+vDty9K7nl7KKBIpLVhm6BcyXNqzseo8/8Y+DXvGWGv+Ox f8sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=CESrRoy9BdwzH7JJF6s4JyS7FHvpssnFdmkEU9LaGng=; b=TFyKEZfFuD4KoJysxv8S3Y2YhSXi6nmRjg6/YyIETh3sdRhFmaeg+Ri7BRzr7Wneol Qv5UJdZOvqwI3EkQ3tvaTtaLeEFMDQcUEfgGYpSlFktRDzk91ab2pjluaRyLPYd1TFnF FTd6LE8M+A9a0mPkBX1n6D9Auqlqx5EiIdm3d6VF2K+h3wqfoqo/ZXKMFTZ0kQYENTmS 2FRObGCYBlOZAnAhcLi0xPIs4bSHovOuKMggdd1+lnrPIxlzGchwNv+HvYIcEFmV6yHI VL2LLOS+Jg4OUeMNAFKOSQ+J+pdndwDMqHhH/fCZzLAFDIqeWTtdvs4a5/2cZhayoRcU w7Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Nyd1OHJQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j17si1303041pfj.322.2022.02.23.17.50.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 17:50:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Nyd1OHJQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C0FA41B0C7B; Wed, 23 Feb 2022 17:22:33 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245012AbiBWXlW (ORCPT + 99 others); Wed, 23 Feb 2022 18:41:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245001AbiBWXlO (ORCPT ); Wed, 23 Feb 2022 18:41:14 -0500 Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C729D5FF3C for ; Wed, 23 Feb 2022 15:40:28 -0800 (PST) Received: by mail-qv1-xf30.google.com with SMTP id g23so952114qvb.4 for ; Wed, 23 Feb 2022 15:40:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CESrRoy9BdwzH7JJF6s4JyS7FHvpssnFdmkEU9LaGng=; b=Nyd1OHJQg+vWRzBSlkdXEVZNzWPjcgTqw7n5BzDUAdnwNYCQ8LoyAh1+UF3bMnj7P6 7ET2tqC40l1m7UflEYd0J3sor3102ZzaENiQj+x0ygCPAr6uh9T8Ll4ieh2Kc8wDPDjt uvYEY16wchls1F1bSKcFMOc9vo/+3U8QsKh3ktMD3na7hS+ay2vJ+obzkQOIKh9mhtKC sWPfuu3K/ZC6zsey7UtoahL32q4Q5FVRsoc+dzrS0QnnBpocYaHqgoA1c5RIyZq0DzB2 a3ZNfwslGS/wBDh1pTpvAIqWVHAvBRTWr0Snwq/z/3I1nzFG0KgwcZh6BoGVteBoggWY YlhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CESrRoy9BdwzH7JJF6s4JyS7FHvpssnFdmkEU9LaGng=; b=BPHxY07yYtlttFN31a//DkIEKisA3rfa9LXzKnvhCfBtOiBkeYs1/qlDYwRzREoAUK RytI7xzIgLtVFYprqY7qq8wDDzqTZ6X4JfKQKpICuygUpWhbxKoSI2F/8v87n1ZVqjY8 GAXgQdahwKXlBTrC/XgEX32vkof9n6fGmo0SFMLlF3YZ8tHDWN8KVaKuAWFxsbT75A/I POGbPBPxxrt9a9LzbF3LgF6ZXHELhwFPh9A+D6htD4usYvKgas+FpczppRvCjxfYhioC TazT9ZbGGIjSPARJwr6dcd5v0aXxVkCbV+SP5x+KK9oQVX444e6Ldyp908GGcCf1N6L6 dG8Q== X-Gm-Message-State: AOAM530Qsuu7PyPCUPDMgl6F5m2RM4cLGNG+VCzZYER/Phq4c/58v+ID /dzklAbsb3A6XiSF4kxWqhbqBrxQwKwbjNWGqARWSg== X-Received: by 2002:ac8:58d5:0:b0:2de:2dfc:77d3 with SMTP id u21-20020ac858d5000000b002de2dfc77d3mr174413qta.168.1645659627725; Wed, 23 Feb 2022 15:40:27 -0800 (PST) MIME-Version: 1.0 References: <20220223222002.1085114-1-haoluo@google.com> In-Reply-To: From: Hao Luo Date: Wed, 23 Feb 2022 15:40:16 -0800 Message-ID: Subject: Re: [PATCH bpf-next] bpf: Cache the last valid build_id. To: Greg Thelen Cc: Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Song Liu , Namhyung Kim , Blake Jones , bpf , open list Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 23, 2022 at 3:16 PM Greg Thelen wrote: > > Andrii Nakryiko wrote: > > > > > as a further optimization, shouldn't we first check if ips[i] is > > within prev_vma and avoid rbtree walk altogether? Would this work: > > > > if (prev_vma && range_in_vma(prev_vma, ips[i])) { > > /* reuse build_id */ > > } > > vma = find_vma(current->mm, ips[i]); > > > > > > ? > > Yes, that's a nice addition. Good idea. Yes, great point! I noticed range_in_vma() already has a check on the null-ness of prev_vma. I am going to send a v2.