Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp20785pxb; Tue, 12 Apr 2022 15:38:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYs4+VpuqTkq9n9OR3TorO/Od2+9JiRjHNmp4jhMYvE6TtGeWQxYEJgYiCUwCd8JmuhZJG X-Received: by 2002:a63:fd53:0:b0:386:66d:b40c with SMTP id m19-20020a63fd53000000b00386066db40cmr32265186pgj.266.1649803091419; Tue, 12 Apr 2022 15:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649803091; cv=none; d=google.com; s=arc-20160816; b=Z62mY2dQLmGSw68CDL8/kilZUcN4YMD5fprJv5DIddZYFtRubcLYScT7NKVgXUVeLA DmUWR2+986Z8homWhkATzZeH3A9EQXM0UaCNV1b0IquaDkE1vq5iK8algG8b7FOpzTnc vp5/T7axw0vGbMQ37Ozig86cgV8zr9FAwE9ya22oSHitvmu0BzUJ7DKGL9QzYkC7haUW Ia5Fb89Z0ilQpkuFa/v0+4CHTj7Mp39+s6JHR7hPPVLkHcUs1RmWfG7bdimo1l3ai9A/ FAurt/2DncN/LKo0feBzc5T2tBLtBuQPaMEKFjs4vuhTGaeqW2OtISs9++kQjlmU4oMY IYRA== 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=ueaAEaieoV6TCFUSXh5Ey9ZYNc68Ex0m47u4PqQnpMo=; b=YxM53mupSh06/9r+0qUkNoUIv+Ybdaea+dXnLB/7O4U5VekS1g5nLA4kIis3N5xpnp nfV/pTzNTrUxvMMiz+CsT5Zqk4p4I5MyOR976XAT8ZIsvI+qoPB9R7ISc3HEMgB6UEO+ P4v5Ez1Ncr7FidIPgZ0t0QpVoT6TMeefGq/ACQNOtObevHstFi+s1c4R6eP+2IwnFIkC l4fGpvkdaPFoh1CBQMhUWub6KBnix3npwG20j0P9sdtSAR6/IXaDnb6LZbxqJaQHDU4r oyuF7DLfb9Sk05kUaHtn5bfSjvs33NSPNpoVnrdbAesgOMjkvv2HsyHOSgPEmZ1vPKNn Xb8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pbceoNHN; 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 32-20020a630e60000000b003992202943fsi3880872pgo.364.2022.04.12.15.38.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 15:38:11 -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=pbceoNHN; 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 5F9F31A2A07; Tue, 12 Apr 2022 14:15:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231951AbiDIU0k (ORCPT + 99 others); Sat, 9 Apr 2022 16:26:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229619AbiDIU0g (ORCPT ); Sat, 9 Apr 2022 16:26:36 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06C7D5F258; Sat, 9 Apr 2022 13:24:27 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id z1so17618854wrg.4; Sat, 09 Apr 2022 13:24:26 -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=ueaAEaieoV6TCFUSXh5Ey9ZYNc68Ex0m47u4PqQnpMo=; b=pbceoNHNbkBt4CX00dQ/kkxqrgKFmmsaDUZs5LNSqRaOyWQGlQKBDk9i8hNuvIMZhI Y8zgMjLJJVBzNr3VAZ3hVSIpNPpxuUVYvE/7ZSoRcB2pvie8+5Om0cT3whMGRTAza/zh 5MiIu6YgGpEkSUDVKSJAuvS8gxAeWB7pA4fQfZj718iB1k0cMtaqOgyQRI4bW3B6HX/4 w4OS9u3U0nJs+nsOT1ysIMhLTgqli0P/dMqhacOng+AedtUzSLLlnTc1Ab9upByhVBtT JM8jRQVirMP7+AsJxjucFk+P6CZgwUnIu+n/Nqr5aaPQnmlqQkl57WaAhPOIiCXPS4Ro ekOg== 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=ueaAEaieoV6TCFUSXh5Ey9ZYNc68Ex0m47u4PqQnpMo=; b=6TTe8f6D8QVgJnkj+W3S1wRcT3QYiIX+/b1NKiQjSyfnJqW6b1cNL1nQ84ETsNqgIK Na6p+gFZTIc0X7tvnAYD6VWsnMvivZK26E+ruYyirG6XsbwoWFUVPuYpsnEHV3utLMKu 884hld8QnBlOWw1m7nVX3tEhzmYVJkqsBsfZTATVZtGCih6Xe+I2bNGweNcExtVlp2Q7 4bxQl1A36qf25C62K7dgBaEBVrRxN6BrVnkdV8vVl2rAhwHasZXyJOOLYKbfJoW7FSdo fwR6XyVoOQOqN9z99S2k42QheAzpb+iYqfD3wpziXX6bAgc+9K+cEBMRl5xhP2qRz9oy O79g== X-Gm-Message-State: AOAM53216RiTC4qixLZYoTNwNFaeAwI8U5PD+0mZNF7D/KtZjYW2c2hC dpTZKV9g9GKw+wVoRF721Ac= X-Received: by 2002:adf:82c1:0:b0:207:9d8b:dd6c with SMTP id 59-20020adf82c1000000b002079d8bdd6cmr3658275wrc.4.1649535865471; Sat, 09 Apr 2022 13:24:25 -0700 (PDT) Received: from krava (94.113.247.30.static.b2b.upcbusiness.cz. [94.113.247.30]) by smtp.gmail.com with ESMTPSA id f66-20020a1c3845000000b0038eb64a52b5sm973257wma.43.2022.04.09.13.24.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Apr 2022 13:24:25 -0700 (PDT) Date: Sat, 9 Apr 2022 22:24:22 +0200 From: Jiri Olsa To: Alexei Starovoitov Cc: Jiri Olsa , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Masami Hiramatsu , netdev@vger.kernel.org, bpf@vger.kernel.org, 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: <20220408232922.mz2vi2oaxf2fvnvt@MBP-98dd607d3435.dhcp.thefacebook.com> 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 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. ok, great thanks, jirka > > > - copy_user_syms function potentially allocates lot of memory (~6MB in my > > tests with attaching ~48k functions). I haven't seen this to fail yet, > > but it might need to be changed to allocate memory gradually if needed, > > do we care? ;-) > > replied in the other email. > > Thanks for working on this!