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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C78CCD68E4 for ; Tue, 10 Oct 2023 03:46:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0081680041; Mon, 9 Oct 2023 23:46:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EDCCC80027; Mon, 9 Oct 2023 23:46:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D740780041; Mon, 9 Oct 2023 23:46:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C4A6880027 for ; Mon, 9 Oct 2023 23:46:22 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 94D01C0480 for ; Tue, 10 Oct 2023 03:46:22 +0000 (UTC) X-FDA: 81328164204.20.E4E27FA Received: from out-193.mta0.migadu.com (out-193.mta0.migadu.com [91.218.175.193]) by imf14.hostedemail.com (Postfix) with ESMTP id 978A210000C for ; Tue, 10 Oct 2023 03:46:20 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=RZopyhFg; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf14.hostedemail.com: domain of yajun.deng@linux.dev designates 91.218.175.193 as permitted sender) smtp.mailfrom=yajun.deng@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696909581; h=from:from:sender: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:dkim-signature; bh=hZJB97dQv1x5vY0R7LD94UsgnKYKd6vyN/0XXr9hYJc=; b=LTpXdosDUb1Svx0cCVZMotyhUdSb9pLx8ACygW075epyQGs6PklNQPuhnfIUcGftJF7w/i rhKfkH3IMkXMwrvUtyETOIUtIMUEj2juhfnUTaGIMap09JB6bUmtqlF5Ymo2WJXuvr6nOe mqxMLaz/dpZY3lV6lOkRJk1XLkgtBpw= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=RZopyhFg; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf14.hostedemail.com: domain of yajun.deng@linux.dev designates 91.218.175.193 as permitted sender) smtp.mailfrom=yajun.deng@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696909581; a=rsa-sha256; cv=none; b=1L6/hYKJf0OS5BYNY1IwTGFcOUvYg/2lfPkv+rz/xmuFgjvnEu3ebwpr+LotqHqXJq6bGD mSv/xO9KsK01i+RRjnt6KpEKD9Ndj2qFMjUyjtsLivUZmuALeYqNFSEccj2k63E1PW+H5u sUMhApljXrOaPeOEqfTx4UnQnfxgAH8= 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-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 978A210000C X-Stat-Signature: x4deik7qmq6s1qqfp4kzncnhnifphk54 X-HE-Tag: 1696909580-761833 X-HE-Meta: U2FsdGVkX19k/egpN7jmADbHlZFPyd6zH9eoaL0Wu/nYHG4zAo0HXbUwg6aQBU1sE63s3lp2ORXLn6tjrFVIDTmxmCPUdRtCpaT8ILK0RbnZizD0N+/pSRxiB+HR7p/JyOr+J0DYdXuqCo45ntMnuwk8qpMs/yX/V4Hcg2OIXmvtf0IAXhNYX3i4tdim0twjX5jNVliRKThl/Jl3eKb36Lvt6EtV1nt88ydif6rO4Lio6HeIemIDY+pncqlj7reXR3jA6B9hJy7xEM3SU2ha/danKfKwE7ZH7SEbbuhcIAJQupJxiqIacktWOTMUUfvdmtZH5WOttVRc8rjK1crvg6jELkTqAvcO83Hulo7ZtfCCIireU6G7eSdMrFpOyg/SYBBXDlfSsOGFh4lowICZddK2tQbEIaj5rfYhqcd13U0tkvxIjx86G3jtgXJTMRCGCHrEwWkE5ppa9dNo+OoEE8l0joiaRkFeQQCccK/tU1F4c2b+tGxkJPeXOkLmDdyz7rcsqElUJH2uZvJzGlxlyWJ4X4GMj1ZWzWWFJQ5i0XN1IyjQfqTkgmcLo00rUSYx5aj6UwcOktvM6U8VW2xygYjEIuUfHtzm42cQM6HlvwSmhZZewxpq2k5JvxT8W/D8adhGcaSSePyD5d0MSQDK4bIC5ZrXaR4heyDeR6eSGKwpJ84oeImZTPVcfpWgg39O1Tebeynp7o6Gclxpyj7H5OGbBdDbyNIyDPokoaea6AnKGG9xoXPTG1xBncmkjIJoJo1rOlN40xe9hO+LTdVnOklZ4B7N1yns/TSJVq4LMstOFJEgDrDey3jhDvDlx45f4sba5NacU0dyD4zqIAuOEMvyWCZQFMTHBsDR3Dm3CXSB9TeWABAI3CudcvxesjPIMXV2eIDiQUFi/tibEMDZbqm4B3IPvvI8EUQOGjx8cMgO8vSMeF3tyufqH7Knxx7esQFK5z8nbGyUeM3O1Uy TNS6vqZ5 CCPGvyIIvG2QuEnyOLK45t5beFepiEat72aRMuysSqB3FAIdXb6Oyp7jGC4KIOLBo8Q/R1xi1BzZao51FWgwEygHbPinR+AY15nwQ3h5DMElZTIciNL/sBDvGRMBsUo5LReFpbYPxYlv+b54= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000352, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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