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 C594AC636D3 for ; Sat, 4 Feb 2023 06:06:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232611AbjBDGGn (ORCPT ); Sat, 4 Feb 2023 01:06:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjBDGGm (ORCPT ); Sat, 4 Feb 2023 01:06:42 -0500 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A20985D92C for ; Fri, 3 Feb 2023 22:06:41 -0800 (PST) Message-ID: <4da7e8dc-25cf-1c4a-bac0-1965df74b645@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1675490799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cu5Wz0uoepKW11ULQP5ZT7Q5lxy/8AHtK4afKm071yA=; b=J90adppd24nW1A3eHsYRuwk4kNxEerppNyQ4fSpLQ5bwiasDqUI6XA/vQLpaDfPcXedosa Wri7GRvl1ftokXLNF7HjsgzqTqLDpzo95vagGobWxz0TCgtSBF4HiTnf4M1Osq8v9uNrE+ fxkryNuthdzAhv7Q5meYgH1e3GK7Dio= Date: Fri, 3 Feb 2023 22:06:29 -0800 MIME-Version: 1.0 Subject: Re: [bpf-next v1] bpf: introduce stats update helper Content-Language: en-US To: tong@infragraf.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Hou Tao , bpf@vger.kernel.org, John Fastabend References: <20230203133220.48919-1-tong@infragraf.org> <63ddd56327756_6bb1520881@john.notmuch> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: <63ddd56327756_6bb1520881@john.notmuch> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On 2/3/23 7:47 PM, John Fastabend wrote: > tong@ wrote: >> From: Tonghao Zhang >> >> This patch introduce a stats update helper to simplify codes. >> >> Signed-off-by: Tonghao Zhang >> Cc: Alexei Starovoitov >> Cc: Daniel Borkmann >> Cc: Andrii Nakryiko >> Cc: Martin KaFai Lau >> Cc: Song Liu >> Cc: Yonghong Song >> Cc: John Fastabend >> Cc: KP Singh >> Cc: Stanislav Fomichev >> Cc: Hao Luo >> Cc: Jiri Olsa >> Cc: Hou Tao >> --- >> include/linux/filter.h | 22 +++++++++++++++------- >> kernel/bpf/trampoline.c | 10 +--------- >> 2 files changed, 16 insertions(+), 16 deletions(-) > > Seems fine but I'm not sure it makes much difference. I also don't think it is needed. There are only two places. Also, it is not encouraged to collect more stats. Refactoring it is not going to help in the future.