Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp734587pxm; Fri, 25 Feb 2022 18:41:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMNwVuG6VYyid0/xUX4awp3zZWvbm9hI1RopsP2y/8EIrpOtqArkFmQuqnDuGZAFFxMKP9 X-Received: by 2002:a05:6a00:1a56:b0:4c6:fe0c:2e27 with SMTP id h22-20020a056a001a5600b004c6fe0c2e27mr10578630pfv.65.1645843309023; Fri, 25 Feb 2022 18:41:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645843309; cv=none; d=google.com; s=arc-20160816; b=0xsCjvrkM2WFkK30c6KfNDmutwza/A+FSEshGmp8rl7Te5S4RcehMIQrf69kT0zYXn mwSn3qmPEKn/LhjJCMImXi/qgavrH+HupOQWMxbccDhhA2rPVLMbBvQG8jRMruq9zm0+ JdyHCLyp1IhxY9iG2CbcwbITqSEAE2SaoshHbHhRFQKfD0f6VCuPomWUlQZNEQi5BcMM CapF3S/mYKTTYz9OHeNyV2ZutqBpN8rleWJ8OVgeIOScakDZ+6myOb1uB+qGkrB55ZO3 1lxiHknSwgH8OSH7Mh+axbKmsD8vnaMSgvm4wPKB6j1MCz1714DA+ir+SwRvL24nEVt7 31ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=0sTP7GDwptY8bNx87CNOI5Rdq6AzguIA/W9Y/8oT6f8=; b=avXN9iF5W4qoojgsY0Lt6/myJ6UYcmu6BMYaDequGDT9t3Dy0AbhdIb4tzl5PWZJjW AlUmYL5k6oK1uCst7euer1B/I8WQnQBdomXX02Ub0bcKfLYx1kH5KHTMGDjTmBYEKf7u xIsV/YVk01SK9KWcb621WZlgLThDRX/k4mJYkr09jXqBAmfOtBjGkvp+fMGAti0vEx9D DfGVE5Xzp5B69c7q2z20k1BgZnh5PyTfMm3QfX1eUk0tc8HGohdzfw/QRBAU6Xvzblf0 eKpB9/FVq2e+b1Y/iISD5dk4sjN8Bycwg7Bu+hpHk8O5q/3d6cz3eJZ6+/e1+PlYMebf o5XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=MFoC5VBm; 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f13-20020a63f10d000000b0037435dad296si3250609pgi.224.2022.02.25.18.41.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 18:41:49 -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=@soleen.com header.s=google header.b=MFoC5VBm; 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9DFCD310A42; Fri, 25 Feb 2022 18:05:57 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236849AbiBYUoH (ORCPT + 99 others); Fri, 25 Feb 2022 15:44:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbiBYUoF (ORCPT ); Fri, 25 Feb 2022 15:44:05 -0500 Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3DCE154D12 for ; Fri, 25 Feb 2022 12:43:32 -0800 (PST) Received: by mail-qt1-x835.google.com with SMTP id z15so3583944qtx.13 for ; Fri, 25 Feb 2022 12:43:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=0sTP7GDwptY8bNx87CNOI5Rdq6AzguIA/W9Y/8oT6f8=; b=MFoC5VBmZ3jGwG60wzsi/T6z2BtuS+rvj2L1jxRcPe/3E5zsMeT9bjEakVZp9Jnsxd tg4kSqlPzGlA0iyUQrY3CElDO+rbis9VxcDUHxSeSsFW3TRa388paIs3qbtKuCXgkx5+ 7xECK5DaXmFD3LY1+sOvgivI+qff76NvPyshWHmNHnvvVdsqYBnpczFZLz3yFzP+Orfa ZNSrBwGn88hdyaNa7CvOfyfQoyQCH9Oj0LnAlb5mHIuruh4MSpFq/799rPMISTacNcYV ivt9ctgA35LgvVvZUTZVi6hufVwiRD/K+kx4igZsyJnYNaOjNt0J677oY6ITiFClSdq6 hm3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=0sTP7GDwptY8bNx87CNOI5Rdq6AzguIA/W9Y/8oT6f8=; b=lf90LAdtG56vB5taIeARATbfZdbCUGOgFyywzUF8AwbwGmaAZkmZ6ZU3yQj3lbpoOu pgfSHm5AX/tiLdthNkn1cvOj2CbkgNRVqbunU7774dXxgA2rLellta+SigT1PtUVdx2T HPVbCjgqrua3hsRt837x84xE/ZAycusZBYYT1cfFVNpjKEd4bVX2xyxDEeCPRqKQydGw y7Ci3fUTFt1uPguoSC8y/4Kqxtlsf75l0VKCOWVp6CAEXLdIJ9h7Xg8LjENyBzvsRsRM 9Rx1+l/0RizlXJPzNtuX9hGRTZIs4T4aXHeXy8toP6bqJYco9plRtijNPHsUgF7Jbbg/ Q5qA== X-Gm-Message-State: AOAM5310/EfJxftNMh/RxyypAgmX0CLapROw8BpGVejU1Mym3DRgY84i TqTt76H0RhEMbsW+HOt0AMm9cw== X-Received: by 2002:a05:622a:1a81:b0:2ce:7959:d9a2 with SMTP id s1-20020a05622a1a8100b002ce7959d9a2mr8351037qtc.135.1645821811716; Fri, 25 Feb 2022 12:43:31 -0800 (PST) Received: from [100.115.92.195] ([98.217.233.229]) by smtp.gmail.com with ESMTPSA id o13-20020ac87c4d000000b002dd2647f223sm2150705qtv.42.2022.02.25.12.43.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Feb 2022 12:43:31 -0800 (PST) Message-ID: Date: Fri, 25 Feb 2022 15:43:29 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH bpf-next v2] bpf: Cache the last valid build_id. Content-Language: en-US To: Hao Luo , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: Song Liu , Namhyung Kim , Blake Jones , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Thelen References: <20220224000531.1265030-1-haoluo@google.com> From: Pasha Tatashin In-Reply-To: <20220224000531.1265030-1-haoluo@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, 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 On 2/23/22 19:05, 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 Reviewed-by: Pasha Tatashin Thanks, Pasha