From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78092C32793 for ; Wed, 18 Jan 2023 14:26:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231178AbjARO0p (ORCPT ); Wed, 18 Jan 2023 09:26:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231239AbjARO02 (ORCPT ); Wed, 18 Jan 2023 09:26:28 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CD2F302A8; Wed, 18 Jan 2023 06:10:35 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id BD0193EF47; Wed, 18 Jan 2023 14:10:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1674051033; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GGYhHqk9lAfnC0oeawDzo48jNfxg1s75ZFbKqNg+POw=; b=OVjneds/B14mHveueZZ//I+0ccc7E/FG+o+Z/xavu7kdORWyymsAQ4k5ZRUMlTdzqy9Gtd Ck4aM3Jh/AQmgwjPBpNTMVJQj3rJNEmf/3S/7zBfWZZwkjwMjDbafT8s8Y5bNHmltmG0hv 1rusI+rrQ37oKvcuNeAaJEq/XblG+oQ= Received: from suse.cz (unknown [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 032772C141; Wed, 18 Jan 2023 14:10:33 +0000 (UTC) Date: Wed, 18 Jan 2023 15:10:32 +0100 From: Petr Mladek To: Jiri Olsa Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Zhen Lei , bpf@vger.kernel.org, live-patching@vger.kernel.org, linux-modules@vger.kernel.org, Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Joe Lawrence , Steven Rostedt , Masami Hiramatsu , Mark Rutland , Luis Chamberlain Subject: Re: [PATCHv3 bpf-next 3/3] bpf: Change modules resolving for kprobe multi link Message-ID: References: <20230116101009.23694-1-jolsa@kernel.org> <20230116101009.23694-4-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230116101009.23694-4-jolsa@kernel.org> Precedence: bulk List-ID: X-Mailing-List: live-patching@vger.kernel.org On Mon 2023-01-16 11:10:09, Jiri Olsa wrote: > We currently use module_kallsyms_on_each_symbol that iterates all > modules/symbols and we try to lookup each such address in user > provided symbols/addresses to get list of used modules. > > This fix instead only iterates provided kprobe addresses and calls > __module_address on each to get list of used modules. This turned > out ot be simpler and also bit faster. > > On my setup with workload (executed 10 times): > > # test_progs -t kprobe_multi_bench_attach/modules > > Current code: > > Performance counter stats for './test.sh' (5 runs): > > 76,081,161,596 cycles:k ( +- 0.47% ) > > 18.3867 +- 0.0992 seconds time elapsed ( +- 0.54% ) > > With the fix: > > Performance counter stats for './test.sh' (5 runs): > > 74,079,889,063 cycles:k ( +- 0.04% ) > > 17.8514 +- 0.0218 seconds time elapsed ( +- 0.12% ) > > Signed-off-by: Jiri Olsa The change looks good to me: Reviewed-by: Petr Mladek Best Regards, Petr