Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1843078pxm; Thu, 24 Feb 2022 10:22:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/B7Kr4IWlGZYFsAR+wm2YaZ/ojqMboNhfMd5d4VmPRP+n5HUx8TfGZNvudM2/gorlL2Np X-Received: by 2002:a17:906:af57:b0:6cf:7f1d:ddd7 with SMTP id ly23-20020a170906af5700b006cf7f1dddd7mr3214272ejb.453.1645726934223; Thu, 24 Feb 2022 10:22:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645726934; cv=none; d=google.com; s=arc-20160816; b=LhbZIb3J6eevZD4WsUilsihhBndfgTvbZgSAiSuY7dV7KsX4Poi03tTu3sKYghbk5i aVCrMD3KV4+lMJQ8gM6FRV3b6UrREmIHgJw4sE+8Q1+VbPkOhr+K8nUyyjDAnYXyplpx zKYonut3Erhx7CP1VOODf+8w1fWPVhBGUiHp1geYvi275Iq2DEdxiVFWDs9b/W+Xewsn 9WUb4Mkac4wsT53wOki7ippOz/1mJl0kDr9B3Gc9vI9wHZ5QS8K0H3/lF6nxX3P+mq/O 0Hr61dEMeXPrktCh4XG0LxGh+uz//6do1f0UBBhzoXaTBPD8M5V0UoM8kUAdjPDB0GhQ yOTQ== 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; bh=jeGCsvgLf6lDIaUf9nSWr2xBU0ddXBX+76rMpizQ4kk=; b=asY2k2G85w0Oxy4QIXP4FiXpe8dilP6Kcpvq9ZzjoqUhSFRMbL9gZrM6gEpjU2t8X6 qvgHskSJDT4SK1/1QgXAXRbZi3AtPvB8HmWeZsI24pj/cT6F9D+xff9p1AhzKVWVowZt HAN/zrEHZI14eg0KQ3KuCBXxGTWtDzR3LUnY7exgm3KwanB3L186UrF3AuGZCfpcLLga BOw9g2WezjJwW9wQK7p028i0cMTRyWnGGqWzfMP3fE5ATfhA11t3yXkCLlnZcBzvviMj PDq4qWachnNBx5VfP3WsqduO1QkHOqCzl2EhgWXvahP1bUfPHozFq9CbhkgvlTd/FPaK 0xPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n16-20020a17090625d000b006d03c1c80d9si135887ejb.115.2022.02.24.10.21.50; Thu, 24 Feb 2022 10:22:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232440AbiBXSNx (ORCPT + 99 others); Thu, 24 Feb 2022 13:13:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbiBXSNt (ORCPT ); Thu, 24 Feb 2022 13:13:49 -0500 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D79A2223108; Thu, 24 Feb 2022 10:13:18 -0800 (PST) Received: by mail-lf1-f41.google.com with SMTP id d23so5250046lfv.13; Thu, 24 Feb 2022 10:13:18 -0800 (PST) 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=jeGCsvgLf6lDIaUf9nSWr2xBU0ddXBX+76rMpizQ4kk=; b=ZKLa4bhzoK0aYAb1rCwPdNTMAlrjQ+ciN6pMoz90knLrCWRTkQSSGBL6plkkDH8Ckd sCBAE8OdOERBn/AN89CsQmGtt1cO95KkPxILz14d+LEW2Los4ufrFP0/OjRt/OknXts8 B14IWeD09kWTOqxEYqhmpUpVTj7dyezWy8yMdsr3VW69xIOsnyvLBhoNSCSdl4dbMwgM o57xoNSD2x9XE4+MksNDFMLGSfXlFywxGmF9hRWRvrOFj+Kv2XVUyZ36U5rj6UzfssVA GbU+b6TItkmFT1VwTuYmRnqcABu9QmYXSBK5ekkLvrKxlLhIksB8Oe68cpWLhQTa19m9 4a/g== X-Gm-Message-State: AOAM532+uZLKhnyofrM068Rjc5n83kamvHxJQda1kE7FF+bjMW1neSoF +QP6sLQUzXBgkgcoLArH+4CmXSb+L95HI5l95bEnDs+I X-Received: by 2002:ac2:5f90:0:b0:42f:b094:d72f with SMTP id r16-20020ac25f90000000b0042fb094d72fmr2436044lfe.586.1645726396659; Thu, 24 Feb 2022 10:13:16 -0800 (PST) MIME-Version: 1.0 References: <20220224000531.1265030-1-haoluo@google.com> In-Reply-To: From: Namhyung Kim Date: Thu, 24 Feb 2022 10:13:05 -0800 Message-ID: Subject: Re: [PATCH bpf-next v2] bpf: Cache the last valid build_id. To: Song Liu Cc: Hao Luo , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Song Liu , Blake Jones , bpf , open list , Greg Thelen Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Wed, Feb 23, 2022 at 6:31 PM Song Liu wrote: > > On Wed, Feb 23, 2022 at 4:05 PM Hao Luo wrote: > > > > For binaries that are statically linked, consecutive stack frames are > > likely to be in the same VMA and therefore have the same build id. > > As an optimization for this case, we can cache the previous frame's > > VMA, if the new frame has the same VMA as the previous one, reuse the > > previous one's build id. We are holding the MM locks as reader across > > the entire loop, so we don't need to worry about VMA going away. > > > > Tested through "stacktrace_build_id" and "stacktrace_build_id_nmi" in > > test_progs. > > > > Suggested-by: Greg Thelen > > Signed-off-by: Hao Luo Acked-by: Namhyung Kim Thanks, Namhyung