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 C435EC05027 for ; Mon, 23 Jan 2023 14:01:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 158D86B0072; Mon, 23 Jan 2023 09:01:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 107B56B0073; Mon, 23 Jan 2023 09:01:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F11976B0074; Mon, 23 Jan 2023 09:01:41 -0500 (EST) 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 E4A1D6B0072 for ; Mon, 23 Jan 2023 09:01:41 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B96541A0A7F for ; Mon, 23 Jan 2023 14:01:41 +0000 (UTC) X-FDA: 80386226802.01.11E39BB Received: from outbound-smtp03.blacknight.com (outbound-smtp03.blacknight.com [81.17.249.16]) by imf18.hostedemail.com (Postfix) with ESMTP id 1C36D1C002C for ; Mon, 23 Jan 2023 14:01:26 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of mgorman@techsingularity.net designates 81.17.249.16 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674482487; 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; bh=pBHd9kJDBPr8UcYUiWsMRn8A4tJTtNLgELjTTUvhHP0=; b=x1Z/5OsNJ5hxWWUkSL3x2OFyv1vVxCD3x7YS2fyKj4bvo3vTtrc+VSb8RbuAYFalApr+Of eMW84PvZEl3SszWAjCmIbRZXhpe8Zunhkqu2SFg3qCV7fLdA8wo/n8iopMU1fhes+RDOdr gk1DAonL357IjLb7ePGcdWE/0ssogHM= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of mgorman@techsingularity.net designates 81.17.249.16 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674482487; a=rsa-sha256; cv=none; b=YmxRYVIL4G6+UaZ0buAhU4ep4odsvuKlM+X90fQS6rngdqaDQpc/exgwqpXQqo2116TQQh +lq8+77m2tROgLTzcoIc24jARDTKLMSRBotbxs0Cb0dixqRSLbLwz6KVTNQfh4Jl/cwe1M AtEzhV9Rz/RnEWCj2cgAWC2gA37UfqI= Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp03.blacknight.com (Postfix) with ESMTPS id 4105AC0B16 for ; Mon, 23 Jan 2023 14:01:25 +0000 (GMT) Received: (qmail 13299 invoked from network); 23 Jan 2023 14:01:24 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.198.246]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 23 Jan 2023 14:01:24 -0000 Date: Mon, 23 Jan 2023 14:01:22 +0000 From: Mel Gorman To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Andrew Morton , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , Roman Gushchin , Ingo Molnar , Johannes Weiner , Michal Hocko , Shakeel Butt , Muchun Song , Peter Zijlstra , 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: <20230123140122.gxg3dqvqsz62qks7@techsingularity.net> References: <20230121033942.350387-1-42.hyeyoo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20230121033942.350387-1-42.hyeyoo@gmail.com> X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 1C36D1C002C X-Stat-Signature: 3anwxwr7zys844h7f8fewhqnmx59jdnb X-HE-Tag: 1674482486-877755 X-HE-Meta: U2FsdGVkX1/gYHWBVXovneaIVBb5D+8W5c3BYTNoeqGyCuLzmIvHV5iVg3ShB0sZFibW2t5oBiB1Ds5/BXp5x1EOh4VTTVEsh/HHXkXLkTjUXEtoB2PdgFwrz54vohyqKVgbxmuZm47ojlFNZ8SScUro5yZCChTWED5+DtfQZuz9Kzi50Yp8v4xop8MdfaBVCOTM8ZTaktSB/cnWrGodslcaBw4AGzE7gNY/8Nui/oKrKmpmDZJvur9FwNc/suVzYqsJP92dgd5la/yBdc3Bm3nLrC8iOlUijJ2jYFJnpbdz+I5a8V7UIubs43AGfGQInqK2qQM4zsdBInH6bjOTWoN/f1+7xW75b/GbPczW4c4yfCmnPk1Jmj/8sZFG2Y1zc7KIyn7YgbUzet6LVc+X63Kw4J1uTXwmO3u0EEO3zP+jiua6aIFZI5F1FhoARWk5vjblUtDEm5VnfOcZBv6PtjQFpwiJq9SuM0V6b3/cNz5N4MzkZOMR/t+MSeGua8crRkdd/lAxk9NwkxGnKspChWdwu4yt1zECPUk4h1gzt66i/2Z6frkt4uhkWpYH1mIwhlL0GWz/Lv5LiCaqixlyx88jvF5iL6wO8Zwf+YLBKYPAj3vYbPsJpLawB4gttYNp927CW/bEzR1uoWV8bLynKnqiMPVJ2llIBkKeM45Yjwx9h4CDYrn1iBXMB8VXnPYfh++75gQCoM9/eoE4IuKLipt5/hgaCL0qwxyGQJeRMyEyDALbNFyASMlbwRShhVsTxrYLWgdtfF0vr+pyFcDNaOxK3TzFrmXNB5TsaI4/U/dFk2y9yI44qbIhf4vUdlCjHHQNZfq4+e+zfB6nGv1cjO5iBxMQnT/LHEX6O84gxiD/vwQBuMB17DxLLihitDOqXj2Q3yEzsOMWuf8cih90s9+2mQsEfjAhZdJaIOT25CHFqjF3U97pUxs+aCmthrYjrnMYEz/lukrquadcdiw gqM+lfMO jqSHAZJlWq6097WABRkT/ZxdkzEXr/IMXUxBaklIpcxb52gXyJfSNqb0Rx1odWUYYjmGJ5txHG4mQ5rqna4eWrweei++XbePxe/rRarKBkoT7HWDYWdPWOYPSOK2sMszlP70Z5UcVwbPsVqbar6eEps5QE5S7ZwRxT1FfcrdWSFZlDDZGefGWmYB/rFhO/xvY51ap7MQZKaQVSGH55kK463jJ3INbkW4ZiaT2ErBd3SABrbYbqXSDp0MT+CM3bmlqh21S0f2jDwvajwM6pJ8Bqz/CNd08ipP9UOeWR8O+29hNyRMyyG5I6m6K9CUtASPInafM4lboy509gfYYsRBNrq/XhfZBAIumgT6qcUyfKcyZW2hAAJj2WMWB1/UszIqg4N0U 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: Adding Peter to the cc as this should go via the tip tree even though Ingo is cc'd already. Leaving full context and responding inline. 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> Acked-by: Mel Gorman This has been default y since very early on in the development of the BKL removal. It was probably selected by default because it was expected there would be a bunch of new SMP-related bugs. These days, there is no real reason to enable it by default except when debugging a preempt-related issue or during development. It's not like CONFIG_SCHED_DEBUG which gets enabled in a lot of distros as it has some features which are useful in production (which is unfortunate but splitting CONFIG_SCHED_DEBUG is a completely separate topic). > --- > lib/Kconfig.debug | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug > index ddbfac2adf9c..f6f845a4b9ec 100644 > --- a/lib/Kconfig.debug > +++ b/lib/Kconfig.debug > @@ -1176,13 +1176,16 @@ config DEBUG_TIMEKEEPING > config DEBUG_PREEMPT > bool "Debug preemptible kernel" > depends on DEBUG_KERNEL && PREEMPTION && TRACE_IRQFLAGS_SUPPORT > - default y > help > If you say Y here then the kernel will use a debug variant of the > commonly used smp_processor_id() function and will print warnings > if kernel code uses it in a preemption-unsafe way. Also, the kernel > will detect preemption count underflows. > > + This option has potential to introduce high runtime overhead, > + depending on workload as it triggers debugging routines for each > + this_cpu operation. It should only be used for debugging purposes. > + > menu "Lock Debugging (spinlocks, mutexes, etc...)" > > config LOCK_DEBUGGING_SUPPORT > -- > 2.34.1 > > -- Mel Gorman SUSE Labs