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 1DB48C02194 for ; Tue, 4 Feb 2025 00:32:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 22C4F6B007B; Mon, 3 Feb 2025 19:32:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1DA466B0083; Mon, 3 Feb 2025 19:32:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C98C6B0085; Mon, 3 Feb 2025 19:32:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id E44436B007B for ; Mon, 3 Feb 2025 19:32:45 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8C1661605F4 for ; Tue, 4 Feb 2025 00:32:45 +0000 (UTC) X-FDA: 83080386690.15.39C607D Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) by imf28.hostedemail.com (Postfix) with ESMTP id B117AC0005 for ; Tue, 4 Feb 2025 00:32:43 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=rKKCGm4P; spf=pass (imf28.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.178 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1738629164; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xAZHlvn5+j4HmWUtVIumIb370QKvKcdO26YMFxguj4Q=; b=2L5B5Qryg3rJteqpX7GoR0zWOUtR+oITWfSjbjVitmPX2z9xFQilEYGUBdUri3NRpvjsYO gq3b3lZwyBJY1as6hmWVK7tOdFXrh0Pz1e9QX5ABZxttWluCg2c8MZq4C4HCaueKW7K96d BtK3yS86mYbIWqUeDBehlHpRrW4NhsY= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=rKKCGm4P; spf=pass (imf28.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.178 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1738629164; a=rsa-sha256; cv=none; b=bj2BGtjgcLDtCMbqw3BsLUUSBIlXklGobvTKB/t0e1uKNyhjq7tVO3nNjH2rnah/MxH5x3 R3luVezBcBVZFoMF5l81GRGTav2Yd6AfDntcNNimZwekZfVRoNr5FsDViu1PmCoz3Sn5rT vVdF4mbJRKp/rcYs1Cv6RA+vwX7mfb0= Date: Mon, 3 Feb 2025 16:32:31 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1738629161; 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: in-reply-to:in-reply-to:references:references; bh=xAZHlvn5+j4HmWUtVIumIb370QKvKcdO26YMFxguj4Q=; b=rKKCGm4Pc1brPRvQaQlpqY/yLSej/YMS49pezQnfR348MhvvwzPveBhGJs2d9WzjfhS8b+ w/r1iJxr8OO61l/IJTJbuSXFisSPUlz3gsHt1lwKCf1213IDXptLn3zsiD1VGe0fQkyRCj tV7HZaP/glGCTtp2C+AAU74XNFTvStw= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, kent.overstreet@linux.dev, vbabka@suse.cz, rostedt@goodmis.org, peterz@infradead.org, yuzhao@google.com, minchan@google.com, souravpanda@google.com, pasha.tatashin@soleen.com, 00107082@163.com, quic_zhenhuah@quicinc.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] alloc_tag: uninline code gated by mem_alloc_profiling_key in slab allocator Message-ID: References: <20250201231803.2661189-1-surenb@google.com> <20250201231803.2661189-2-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250201231803.2661189-2-surenb@google.com> X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: B117AC0005 X-Stat-Signature: dceu6qbqaxm41gbw3hnzwcrazobzyfcr X-Rspamd-Server: rspam08 X-Rspam-User: X-HE-Tag: 1738629163-712925 X-HE-Meta: U2FsdGVkX19b9GtMNEJOugGP9EVUkQl9yYbIQ4KQdnSfI47lh4n/mWepjTXHmLLV47vWTYYrd4K2LoW07Jwj3wDbOJ+cBAZdL0bi5KBAtn3DhkSNWAaroCPNOQyyB1fpP8e5aK14qPY7HpE5JEZQfkzdk8sRgIBQV1DyLTCMKMCFMLKnSjTLDVfrspy61a7UPNSkmFqDBhNDAfMmXLLNE0yCZ7bWqaQsYT3macLrYvgB9YKSPJteaoXlpOjRNnHacDQVuofs9jMKydq2VhbPQIF13GirlOdS04m/umCP4wiXk9hFKlk4FSmdhGLxJi1l1t3KoaMM63PCiEua889RHpqRsqRWTxWWiqelAxcC2AfCj4QqG8GeBvx7ZhhiNax1XIacyY1jeqCx0dHTAVr5xcV65lILsADWovMqiAP+E7jzoHAWBcyYisr+J+9eE4VQdjY8rY+ONAg4B3YcAsaZe8uiyjfUaK1E+291zPVMz+GQxu0HwRpng/p0vZgqLQhVovsUsKmXWkM0SCiWnG4LtsIIN0K1vUV24aVHHi6WnXJPpeKrDj40Q13nHArQptWuOCN9oKDc3w7XxB48gz+cNMuC/Bjcm83vnbkkMV2JmfMlzOt+626xJmv22nCrKj/KhK9eisUq1zyNp+lsvutf8BzDDQjYwWPJWa3hJUS9XnQO5KihEfkuHShWa5KiGBUo60RV44barKBBduRhjhZDcMaozbGGK26oNbLhRpRyikM1xlU3aF1+u5FXdrPNV2447ZYvqIUG/I/WVlu8v7Eli4aM0xLG10ES/Fr+tsmHpQIxvzZ5CzVCHqEWYt1/zjQnwUWHzBPbuD/nI5jQZC7+FL/7ijNq1b660QQFqZ78hnSG8GEVccssXfDpLePuyKuKxFpC+vmvv6wjU1WHstERlwMrFk/7J88jlNZyoe85WraE+PRiyboOzHfqsFwWt4vl2ZcLz0QTx5417MYcUGb 7d2FLzmK NTX3jailXv6r79hV4EtUj32pL3HMvmmlwTgvzp1wzX8GYGi7zm/t6QG9SWNplLqo0NTOIXgXbF8L7Yw2EjodN100/azBliVxyQIRSgjjYn2XyGh8lBO2zh792Qhjgn5hA21pgStKs+Y+GJ/VoguYEGy8wPy27f6j013ISV5DGUjolyOsk6ZDWdACL4j3afqB/KeMn4K+9XygA2ws53jrzQ69Du6bp8oEn3iGNZNplRQ6CC6quLramyfGz+3iWVOKw5h2hJTjW8zaLsMgdrDS9MA0Rkg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000007, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Sat, Feb 01, 2025 at 03:18:01PM -0800, Suren Baghdasaryan wrote: > When a sizable code section is protected by a disabled static key, that > code gets into the instruction cache even though it's not executed and > consumes the cache, increasing cache misses. This can be remedied by > moving such code into a separate uninlined function. > On a Pixel6 phone, slab allocation profiling overhead measured with > CONFIG_MEM_ALLOC_PROFILING=y and profiling disabled is: > > baseline modified > Big core 3.31% 0.17% > Medium core 3.79% 0.57% > Little core 6.68% 1.28% > > This improvement comes at the expense of the configuration when profiling > gets enabled, since there is now an additional function call. The overhead > from this additional call on Pixel6 is: > > Big core 0.66% > Middle core 1.23% > Little core 2.42% > > However this is negligible when compared with the overall overhead of the > memory allocation profiling when it is enabled. > On x86 this patch does not make noticeable difference because the overhead > with mem_alloc_profiling_key disabled is much lower (under 1%) to start > with, so any improvement is less visible and hard to distinguish from the > noise. The overhead from additional call when profiling is enabled is also > within noise levels. > > Signed-off-by: Suren Baghdasaryan Reviewed-by: Shakeel Butt