Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2270881rdb; Mon, 9 Oct 2023 20:46:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkP07/GUJj8p3zFCdqb8eDw1t69VsDRHvs7Xr2WyMtvfCELmtt1FfuTKh2FikwVcuackH7 X-Received: by 2002:a25:db8e:0:b0:d9a:60c8:c5ff with SMTP id g136-20020a25db8e000000b00d9a60c8c5ffmr409607ybf.65.1696909595366; Mon, 09 Oct 2023 20:46:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696909595; cv=none; d=google.com; s=arc-20160816; b=RpL47VTQ0Rc4fsvXv41YX/0DOrYZ8aC/j8ogyAtAa8Jk88OVmE1SZ456WCl6jUChTC fyP52sj2oSE8yP17oni5E8FFcBhVcHtKWokhcG67l8+10LDtJ68GcPuEsW/M+ZZnDk8r bcAAUjNxzbDpM00WXcU/D7oYCuL83iOSN6nRNoKKJXFFbaW4yblabZ6WPKSTRD1ki1nA DAMWcYJ1mvwbpzg2sONr/yRwpf7HsVi8sxM43BABD2mu9wx0aDwXgUhKA+PkU7ja4fw7 P0KTV+y2yqhVH7ccgl4rCTWQHaFaPx/9gJ1KEL9LNr3rfmCoN0O1pBNt7dwxvhPTXkzZ xd5g== 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:mime-version:date :dkim-signature:message-id; bh=hZJB97dQv1x5vY0R7LD94UsgnKYKd6vyN/0XXr9hYJc=; fh=8lzf8lEuQ5C5XUSdPm+vTIE5kg4iIgwy9DJ35Tp+y0U=; b=X5EwapGtFMpyhCHf1C5wP2r3RMv++zVbQ1Xsco/uRONfFZ+IS2iEgC0lFhhOyKJDwP +6v2YHp2Jk0J37HQLCxDSsmrNLuaUoCa024/CPmpmGu8CCTTmNeoDfbz0NxeKvbTkg+V +MvjOEmC7ghFwRYvnXOOuRl8ntC5ggTdp7fOoYpeJuuYkdcBZwQnnCJU+x+AqFmPVB+S GJ4Qu4zrfXVG6xF0Py8pIsNx4GoEm3ZXiMq6BjUItGr6hXzGwaHy6zj++xQb92AB8Mst YNhWHF9SEU/kXMcEc3W68Ft/DzwxK1+m1r3yWaiRQHPqDywfIxfkdMcCNxoYWhrIC5TJ u2FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=RZopyhFg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id h190-20020a6383c7000000b00570a4303746si11214563pge.560.2023.10.09.20.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 20:46:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=RZopyhFg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id BC1FC8027F4E; Mon, 9 Oct 2023 20:46:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441993AbjJJDqX (ORCPT + 99 others); Mon, 9 Oct 2023 23:46:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378482AbjJJDqV (ORCPT ); Mon, 9 Oct 2023 23:46:21 -0400 Received: from out-210.mta0.migadu.com (out-210.mta0.migadu.com [91.218.175.210]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AF039D for ; Mon, 9 Oct 2023 20:46:20 -0700 (PDT) Message-ID: <7fbf47bf-c26c-8eeb-f803-b9f2bafa6364@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1696909578; 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=hZJB97dQv1x5vY0R7LD94UsgnKYKd6vyN/0XXr9hYJc=; b=RZopyhFg1RxT0Rdep5vYxJJ7xzF+Ws3zGcvSAn7BpQ/kou3o3Xdg7a/J7bbR/e/YZWTP8F hpn4l064//3J3Gekd3Vhg+rG6BE31qI51cfsDXgAxxYAnPl0bsJ/tALlQo/u4ixpubQP1V 3f1baHkeF1EewyEU73MsCO508ivMyJ0= Date: Tue, 10 Oct 2023 11:46:08 +0800 MIME-Version: 1.0 Subject: Re: [PATCH net-next v7] net/core: Introduce netdev_core_stats_inc() Content-Language: en-US To: Steven Rostedt Cc: Eric Dumazet , mhiramat@kernel.org, dennis@kernel.org, tj@kernel.org, cl@linux.com, mark.rutland@arm.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Lobakin , linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org References: <20231007050621.1706331-1-yajun.deng@linux.dev> <9f4fb613-d63f-9b86-fe92-11bf4dfb7275@linux.dev> <4a747fda-2bb9-4231-66d6-31306184eec2@linux.dev> <814b5598-5284-9558-8f56-12a6f7a67187@linux.dev> <508b33f7-3dc0-4536-21f6-4a5e7ade2b5c@linux.dev> <296ca17d-cff0-2d19-f620-eedab004ddde@linux.dev> <68eb65c5-1870-0776-0878-694a8b002a6d@linux.dev> <078f662d-a73f-766b-3a07-c82cd37026c5@linux.dev> <20231009102833.1b0d35e3@gandalf.local.home> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yajun Deng In-Reply-To: <20231009102833.1b0d35e3@gandalf.local.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 09 Oct 2023 20:46:32 -0700 (PDT) X-Spam-Level: ** On 2023/10/9 22:28, Steven Rostedt wrote: > On Mon, 9 Oct 2023 18:58:27 +0800 > Yajun Deng wrote: > >>> C compiler decides to inline or not, depending on various factors. >>> >>> The most efficient (and small) code is generated by this_cpu_inc() >>> version, allowing the compiler to inline it. >>> >>> If you copy/paste this_cpu_inc() twenty times, then the compiler >>> would not inline the function anymore. > Yes, if you want something to be visible by ftrace, it must not be inlined > (as inlined functions are not function calls by definition). And as Eric > stated, the compiler is perfectly allowed to inline something if it > believes it will be more efficient. i.e. There may be code around the function > call that could be more efficient if it wasn't change to parameters. If you > want to make sure a function stays out of line, you must explicitly tell > the compiler you want the function not to ever be inlined (hence the > "noinline" attribute). Thanks for the details. >> >> Got it. Thank you. > Great. > > -- Steve