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 3C9FCC54E94 for ; Thu, 26 Jan 2023 02:02:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9DDD56B0072; Wed, 25 Jan 2023 21:02:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 966666B0073; Wed, 25 Jan 2023 21:02:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 808326B0075; Wed, 25 Jan 2023 21:02:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 71F0D6B0072 for ; Wed, 25 Jan 2023 21:02:25 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id F14A7160EFE for ; Thu, 26 Jan 2023 02:02:24 +0000 (UTC) X-FDA: 80395300608.30.9DCAF70 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by imf04.hostedemail.com (Postfix) with ESMTP id 299C340018 for ; Thu, 26 Jan 2023 02:02:22 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=URqM1W+z; spf=pass (imf04.hostedemail.com: domain of roman.gushchin@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=roman.gushchin@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=1674698543; 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=dP/00qm2xtIoOgxZ59rfAfeMc8lp52RZ82HChbdOra0=; b=YLdwz4HDtD9bvk6zPkzN/i4YO6KtRdkB9Daa2q5odD3gXAf3i5qFxX25xZk8+Qm8TKJIFY WymJl0gdts13Yk5H4oy9j5mBGZzW+bBHmS+MAc3VZf0djaz6IUoZyyvebzmbdZ2Ub5WyYt +HFOCL7TQNIM1af8taG54CGLrAwVe4w= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=URqM1W+z; spf=pass (imf04.hostedemail.com: domain of roman.gushchin@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674698543; a=rsa-sha256; cv=none; b=FqvepAOUY0bp2s1SgJNHOLD1OnR3JzmvS6ETZLsZKboZjfyAtkkKCdtaZwxaj5lg0WPsTo /JtgWNjj+NdxE/uiB+jQFvyH3XyeCnI541vsemkgJh4XwnpQuQ8CZAzHb1ss9qljpHfPBW rPd7nuJggVrg4rpts9YfxFNzhzdVwaA= Date: Wed, 25 Jan 2023 18:02:04 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1674698541; 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=dP/00qm2xtIoOgxZ59rfAfeMc8lp52RZ82HChbdOra0=; b=URqM1W+zW3QAvh/0+OOEBnQl0aaQomsbz+tP9Q7hKsSBR1wJF0vbHtv9GWiWTzGBNPI/uI WJ/BHaI8tQ5gmHapNRBpgAC3ZakEA3pvi7+APpcy14mQCwPE+u78V2hlhXcUwqEGqnjsgJ X/M4KpCwZxGGxcTY8dzsJKgVCJssG/w= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Andrew Morton , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , Ingo Molnar , Johannes Weiner , Michal Hocko , Shakeel Butt , Muchun Song , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH mm-unstable] lib/Kconfig.debug: do not enable DEBUG_PREEMPT by default Message-ID: References: <20230121033942.350387-1-42.hyeyoo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230121033942.350387-1-42.hyeyoo@gmail.com> X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 299C340018 X-Stat-Signature: typbe7oqwpxzmcntxnz1yj7xhacq116j X-Rspam-User: X-HE-Tag: 1674698542-329554 X-HE-Meta: U2FsdGVkX1/aba6GIv5QglkChWnuDC/fJ8g9NLuuUCJBySanSl4Dn6gEoa+EYyREJgZEQmZQjjTjp1Mn46FFNt0+Lldd3E9xN0QQlEX/ts0/W3qdsuIfPy2YMAFStDADUdzNAt1ZEoPfCrCn3jZe+lO1gcpQCbMXTs2XxYT+QTSgtAjgvcW07/MDivnzYkH2vN6aGu/QA2e1kzVaEYQAL1A/4U/ScPMzOdfhJT/5d4wXq17xKsQQ0HCa0MNsZm7A3IRa9xVdDFsGY7oL9r5+LJ98069A5IDjYmjIyCmp78GAuJ8lUPyzlt+IVbbELLSA4lRdSRCZpenWRQcx9lL/w4sGJynLmFzwDtXwwIfIPIymPV/mXqMchqXGerOu8Boo+0oOwLed6uQvMahiZc/eO7j4qIh3rufSLbUoMkUSyEdwtimRSzyDwgleearzKAYvYY8xm0LkZ2mSja/w6O6UcsEKTGPhpvSor371vZkfagogODLcR06jAE00apZrChIQ4Sm4qmbka9stndoQdZzJatclsnUrKHkGOV9rrSMQ8MNn6/J8uRL4Ww+STjW5X15WkEUrfv4QiMvGE+laKyVwhZVyNSu9BAzChihGJb3ctSUXIbm3VwStSzEWoWIvaRAOoKc8Oh7WP/yDMAl/vQXcdsD8qTgzWk8cAA0Doch9Ahlw4GhmckW1ZmelM34Z0nO0W8i3wfbzyswlZMEn2M4v/NHPvc3WGfRHujCdAPWDmvb7Jj2dLIpSa8tGFUCfYWk+ns31d/Ai+SysQ/ltGQSuIr7xN6996ma4WcDV7wTyEKwhgvdUuOzpiBZ8FAL0+zLPwkGxQeYdD8NjgjK0YbiJQKdUQP3ZPKTfwu7g+EI7uLwZscNX4L9+xOqKOFHMzK8+H2LwKElt7cWwwK9GZZA4jq2+UNAs/ACxDQd/Ky/cajFf/RljPOZtp1a1PJqXVngQk/xlsiMy06fbpTlzfGX mH/MAdYM sZceKyK7UBZYUjriNUFfdfIj7buOs+N8VdGQsn0NkFJGOhlEq7FqOsxkDzUSdK4ZX6h37ZYahcS7zjE8ewMkq5LlcaOzWK3YK8v0CivdXqPMGvgrtQLZxXad+Vy+8TzhbB1sPlIXcQ8p3UETr6mX8lX9uA6oDTifmhNKLfddWh3bSjsh6tYpOSzQxwXfZsYkceljKHnmS0EGbUizB/YkFliEPt6TxkybCR+Js7SVqPBiI6RDFKVy4PE/Yuo3rAm2mkkyGEnbM+HXVjMpzxvnsuegqr2pUzWW5w1A8 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, Jan 21, 2023 at 12:39:42PM +0900, Hyeonggon Yoo wrote: > In workloads where this_cpu operations are frequently performed, > enabling DEBUG_PREEMPT may result in significant increase in > runtime overhead due to frequent invocation of > __this_cpu_preempt_check() function. > > This can be demonstrated through benchmarks such as hackbench where this > configuration results in a 10% reduction in performance, primarily due to > the added overhead within memcg charging path. > > Therefore, do not to enable DEBUG_PREEMPT by default and make users aware > of its potential impact on performance in some workloads. > > hackbench-process-sockets > debug_preempt no_debug_preempt > Amean 1 0.4743 ( 0.00%) 0.4295 * 9.45%* > Amean 4 1.4191 ( 0.00%) 1.2650 * 10.86%* > Amean 7 2.2677 ( 0.00%) 2.0094 * 11.39%* > Amean 12 3.6821 ( 0.00%) 3.2115 * 12.78%* > Amean 21 6.6752 ( 0.00%) 5.7956 * 13.18%* > Amean 30 9.6646 ( 0.00%) 8.5197 * 11.85%* > Amean 48 15.3363 ( 0.00%) 13.5559 * 11.61%* > Amean 79 24.8603 ( 0.00%) 22.0597 * 11.27%* > Amean 96 30.1240 ( 0.00%) 26.8073 * 11.01%* > > Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Nice! I checkout my very simple kmem performance test (1M allocations 8-bytes allocations) and it shows ~30% difference: 112319 us with vs 80836 us without. Probably not that big for real workloads, but still nice to have. Acked-by: Roman Gushchin Thank you!