Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp51244lfv; Tue, 12 Apr 2022 16:55:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7cokHpJiPOIP/rIf71+iwSLKytSIa8fZ2Jv9Gruyt1MPvIXuK6Jp3xrrSFmEJlnn17lsV X-Received: by 2002:a17:90b:124c:b0:1bc:369b:7db5 with SMTP id gx12-20020a17090b124c00b001bc369b7db5mr7646640pjb.179.1649807733240; Tue, 12 Apr 2022 16:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649807733; cv=none; d=google.com; s=arc-20160816; b=SWz3TQVOCSYkXVhJKiDzRWDO6K2617kvu7ZeG3Nxbkmk+rFWQ8+v4cy15+3k5vAr6l FCyIKFtNI/xs8SuX0XtxvQ1dDJ5NrwsgvZKHXXmucS5Vmui6h5fhjhopZL2mEKXzThSx Y3tpPZ/NSIPXki23aHtrDT8oB7Vs2+jBJmZPVpYaoMk5IbaXzD14K1EXwnxOgAQfoxxe 3O8Wd/Ozf26ifL3jTNDI0LHjXcwDg9mwc3FnGtYOFwNwictmMACZLjWoTUrQ1D5S8wqL YjSjN9RlWRJU6/e4HpoohVC4nUwX8m5wH90ZKAjiQAuDHdK/MfKoScoFZtqqk2g1uE97 ojEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gwZ9CHvYhZZ9147CrVLA+yjNadbJUhOCmSfrIzjUHWg=; b=c+ENpCRQ8vqlAzap6YB2uX+ZQZouSHhGAvWPTlDZdrV19EOXN2CA3RAHUHxhgmoBXy p03HvjFF/DKvvHqLn+HDiAPl5G4aXDya2VZO2LSQDpLIfz0OKwqA8swT+23GWkn4/Do3 hCFkKfufPzA0Wri84O6N6f98/uUSUE514DMA/MFEhDFRhcfDCpuKRso4zRW+1gNdq/li 8BZ2cXPHQ4ggvPE72LzQEZu49Mjm623XG7ARLIX/Rq/PlVkjmc4RPCoIscdfAy7ex/Wa f4uEm1k7QKp6dBgN9ZYTunR6UCrTMzKWJwmNVWFuwapRli22ozJ56gCWIIolwHdliurJ 9wLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=P+vpgkwx; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f16-20020a056a0022d000b004fa3a8dfff8si7977268pfj.175.2022.04.12.16.55.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 16:55:33 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=P+vpgkwx; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7CF581F7607; Tue, 12 Apr 2022 14:50:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357283AbiDLPtP (ORCPT + 99 others); Tue, 12 Apr 2022 11:49:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235507AbiDLPtM (ORCPT ); Tue, 12 Apr 2022 11:49:12 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 142C95FF23; Tue, 12 Apr 2022 08:46:54 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id bh17so38149044ejb.8; Tue, 12 Apr 2022 08:46:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gwZ9CHvYhZZ9147CrVLA+yjNadbJUhOCmSfrIzjUHWg=; b=P+vpgkwx8MjQx+ycKCwc6BgaPi7uKHrw/x7OkuGiydyZW8GRegFWgWZSktFmeoBJHl y+XpOHd0TvosGRU4ZnFkTGFcBmh+NoISJ6JkQxso/rBSxn+3A/uBJ6rwxHCD/sS/jcCU V/MOKfTg6mg4jZKkI3fObyPuXVaFZyRRRBEormnhQIJyM6SpwLoktBhfVkPFcwl2kdSQ lVZ16fap4LpHCqNGCzRpLJJ71IBEQWfqdN5T0C+bu1q97QhmnkekHEQzPXcVXzZwoe8s Q6Xm9UGV6eWFo5EXc5fHt7AyvMQ8VpGosW/MIjaFK7Gb5nSyp6Qrx1wzhMsgf8wn3XJk Q/qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gwZ9CHvYhZZ9147CrVLA+yjNadbJUhOCmSfrIzjUHWg=; b=WkYucC9JGgbHucWxvG93IsLEOMIz3vTrSINBkKis3O+6KmtCNy1hh0lUytuVNzmrtE 14dN/JLcJvJd5pQ/bLvf9GAr2K5eOJF7e/hvYuCvfZopQoabuea0k0Z0vI9Wj+rfzEJv hIKUffmQumMu47R3YyJ0P6ppLH6DyJAnV+DU16vLdJwbI2sphP41kMaTYFxVtlLNb/Jq AQazSEP7oyl9FOshdjRoIDxVuMExALMFwcCiryXd4sUhajIF6nQX3FlbxedXuXwNdJGr Ugir7gKl7ZCYMfwdyAI29Mf87g/GxeoQKW773G+6aW6jFZoGXIlSxo4tTwjSHOxea46X GVfQ== X-Gm-Message-State: AOAM532Bf/3Va7SkP7V2tfTiecyVuBY7Z7QxK7aejftrc0p6nLzIXUdU cwvsvcXU2/TB0yCct1LypEw= X-Received: by 2002:a17:907:160b:b0:6e8:58c1:8850 with SMTP id hb11-20020a170907160b00b006e858c18850mr15415064ejc.284.1649778412502; Tue, 12 Apr 2022 08:46:52 -0700 (PDT) Received: from krava ([83.240.62.142]) by smtp.gmail.com with ESMTPSA id s11-20020a170906284b00b006e108693850sm13214817ejc.28.2022.04.12.08.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 08:46:52 -0700 (PDT) Date: Tue, 12 Apr 2022 17:46:49 +0200 From: Jiri Olsa To: Andrii Nakryiko Cc: Alexei Starovoitov , Jiri Olsa , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Masami Hiramatsu , Networking , bpf , lkml , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh Subject: Re: [RFC bpf-next 0/4] bpf: Speed up symbol resolving in kprobe multi link Message-ID: References: <20220407125224.310255-1-jolsa@kernel.org> <20220408232922.mz2vi2oaxf2fvnvt@MBP-98dd607d3435.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 Mon, Apr 11, 2022 at 03:21:49PM -0700, Andrii Nakryiko wrote: > On Mon, Apr 11, 2022 at 3:18 PM Alexei Starovoitov > wrote: > > > > On Mon, Apr 11, 2022 at 10:15 PM Andrii Nakryiko > > wrote: > > > > > > On Sat, Apr 9, 2022 at 1:24 PM Jiri Olsa wrote: > > > > > > > > On Fri, Apr 08, 2022 at 04:29:22PM -0700, Alexei Starovoitov wrote: > > > > > On Thu, Apr 07, 2022 at 02:52:20PM +0200, Jiri Olsa wrote: > > > > > > hi, > > > > > > sending additional fix for symbol resolving in kprobe multi link > > > > > > requested by Alexei and Andrii [1]. > > > > > > > > > > > > This speeds up bpftrace kprobe attachment, when using pure symbols > > > > > > (3344 symbols) to attach: > > > > > > > > > > > > Before: > > > > > > > > > > > > # perf stat -r 5 -e cycles ./src/bpftrace -e 'kprobe:x* { } i:ms:1 { exit(); }' > > > > > > ... > > > > > > 6.5681 +- 0.0225 seconds time elapsed ( +- 0.34% ) > > > > > > > > > > > > After: > > > > > > > > > > > > # perf stat -r 5 -e cycles ./src/bpftrace -e 'kprobe:x* { } i:ms:1 { exit(); }' > > > > > > ... > > > > > > 0.5661 +- 0.0275 seconds time elapsed ( +- 4.85% ) > > > > > > > > > > > > > > > > > > There are 2 reasons I'm sending this as RFC though.. > > > > > > > > > > > > - I added test that meassures attachment speed on all possible functions > > > > > > from available_filter_functions, which is 48712 functions on my setup. > > > > > > The attach/detach speed for that is under 2 seconds and the test will > > > > > > fail if it's bigger than that.. which might fail on different setups > > > > > > or loaded machine.. I'm not sure what's the best solution yet, separate > > > > > > bench application perhaps? > > > > > > > > > > are you saying there is a bug in the code that you're still debugging? > > > > > or just worried about time? > > > > > > > > just the time, I can make the test fail (cross the 2 seconds limit) > > > > when the machine is loaded, like with running kernel build > > > > > > > > but I couldn't reproduce this with just paralel test_progs run > > > > > > > > > > > > > > I think it's better for it to be a part of selftest. > > > > > CI will take extra 2 seconds to run. > > > > > That's fine. It's a good stress test. > > > > > > I agree it's a good stress test, but I disagree on adding it as a > > > selftests. The speed will depend on actual host machine. In VMs it > > > will be slower, on busier machines it will be slower, etc. Generally, > > > depending on some specific timing just causes unnecessary maintenance > > > headaches. We can have this as a benchmark, if someone things it's > > > very important. I'm impartial to having this regularly executed as > > > it's extremely unlikely that we'll accidentally regress from NlogN > > > back to N^2. And if there is some X% slowdown such selftest is > > > unlikely to alarm us anyways. Sporadic failures will annoy us way > > > before that to the point of blacklisting this selftests in CI at the > > > very least. > > > > Such selftest shouldn't be measuring the speed, of course. > > The selftest will be about: > > 1. not crashing > > 2. succeeding to attach and getting some meaningful data back. > > Yeah, that's totally fine with me. My biggest beef is using time as a > measure of test success, which will be flaky. Just a slow-ish test > doing a lot of work sounds totally fine. ok, I'll remove the 2 seconds check thanks, jirka