From patchwork Sat Jan 21 03:39:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyeonggon Yoo <42.hyeyoo@gmail.com> X-Patchwork-Id: 13110825 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 6D7CDC38141 for ; Sat, 21 Jan 2023 03:40:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DE2D86B0074; Fri, 20 Jan 2023 22:40:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D93376B0075; Fri, 20 Jan 2023 22:40:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C33986B0078; Fri, 20 Jan 2023 22:40:16 -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 B15736B0074 for ; Fri, 20 Jan 2023 22:40:16 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 8462E80146 for ; Sat, 21 Jan 2023 03:40:16 +0000 (UTC) X-FDA: 80377403232.29.E62F42E Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by imf13.hostedemail.com (Postfix) with ESMTP id C1EE120002 for ; Sat, 21 Jan 2023 03:40:06 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=g9O69hSP; spf=pass (imf13.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.214.181 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674272406; a=rsa-sha256; cv=none; b=GT7mbkRjwDxuhLdhSV2gDPS9VQ0m1700na4EQgzYVVuSwQuX+jgvAuHajISGkkWbzQdA2o oLrCsZIrMyunMZyOGMVrsPYD952NX2DLBRsYPoLxvWs4XhejHSZHGtoojo4PY/IzyC4/KB /75YIKVH1dts3+T8oE6AvzFz55RgPFE= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=g9O69hSP; spf=pass (imf13.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.214.181 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674272406; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=E0GuYQ0G2pHZ2CbzhRDvaQYe3yXi7QgsYoJRG+c3IfY=; b=ryjo1NKxNLs+CN6u8yp5nB/mA9P4/Gd0K+A67o9LRfk+th1VYQQ9D7o5+fVfMCiZe1nQGh v+WA2XWcPspDsl2gA6V874hRAtNqxsr/nNRTIjjTZccnOgaDH4/qm5INtPkd9Y3djBmL7U uJA5Ei7ZOF8mLON/LKiQCj++XbVs9PI= Received: by mail-pl1-f181.google.com with SMTP id b17so6934255pld.7 for ; Fri, 20 Jan 2023 19:40:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=E0GuYQ0G2pHZ2CbzhRDvaQYe3yXi7QgsYoJRG+c3IfY=; b=g9O69hSPUUH1UI04WY8Oj4LiUrVyYZZaB3AkX1QEvzudVMNV8FREOyJGsxcCuLPen/ W/VHgHR2CBfmWJQntj4arjevp2CYtiWY39sK7cVpyfztIxwxT81UC6ptUqM61bJmOkGc RrvcLK+J43ektIPvssT5ULhHensowUmVBpUJoQLAteUtqe6OPGYEiWQbpFPUdFPTP1Hb t4/hNh+hy6AdYMPlZrglexXDxnahHY3ax5P/EllOLmR/7hlcQKIoPa30NZFRNoLFz9KQ rTtvoCWgnwCm2L93z3ckefpycnNyqn2kXHho795lyWFuFUEur+PH7vCbKx+Xe/B7Y8ok H2mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=E0GuYQ0G2pHZ2CbzhRDvaQYe3yXi7QgsYoJRG+c3IfY=; b=f4HX6bO/80NGxDIN/1I800O/bSs94RnzmNKwvvzUmhfxGgd+UO7SvNF0H4lthw2pCv FFVIJPwQjOIjjo49vNBPcQ1BtAFmM0Dkx1criP3Z2DeKH6gktCcPAmJtsw7u6trjwTUu WqtZKSuj+OFOOZeaIN5WfElHQlH/2kwUi1WKXTHqB2ZWBU9Ul4FKD5etxtg+deavB9pp D9MIt6FJZOc/gAAYX1nkb9khbHrCwslIVp8wHR+11yIGqHwq4kVvWFrWZFV51eNimUIa A5fh1qW/Vn/FI7VNM+zGQMIxtuR8Yw4lAS5XP3nhz8oDvTQkXGPijrPRuObIiacLlIZN mVRw== X-Gm-Message-State: AFqh2ko1h1OlRhE0WLSWUOuTNag5PhFEx0RszouusA/ild+3v5Y3HFnQ Zgg0CtHR7jZGVz7zCr1I2K0= X-Google-Smtp-Source: AMrXdXvpGvfhQcKB1wwwgU3bg1uNVCaA2QiVeitPKOeP9jLqAhmC7DZISdyx3ps5i+MZ2i/ETs59vA== X-Received: by 2002:a17:902:f2ca:b0:193:2303:c9e5 with SMTP id h10-20020a170902f2ca00b001932303c9e5mr15667506plc.20.1674272405501; Fri, 20 Jan 2023 19:40:05 -0800 (PST) Received: from hyeyoo.. ([114.29.91.56]) by smtp.gmail.com with ESMTPSA id s7-20020a170902b18700b0019335832ee9sm23331274plr.179.2023.01.20.19.40.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 19:40:04 -0800 (PST) From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Andrew Morton , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , Roman Gushchin Cc: Ingo Molnar , Johannes Weiner , Michal Hocko , Shakeel Butt , Muchun Song , Matthew Wilcox , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH mm-unstable] lib/Kconfig.debug: do not enable DEBUG_PREEMPT by default Date: Sat, 21 Jan 2023 12:39:42 +0900 Message-Id: <20230121033942.350387-1-42.hyeyoo@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: C1EE120002 X-Rspamd-Server: rspam01 X-Stat-Signature: pozqoj86pqoncjq38g1fj8ixc18rot93 X-HE-Tag: 1674272406-122157 X-HE-Meta: U2FsdGVkX19oFJFLJsxppWxmjNzGz3Bs18hFAC8Un3WMgJ8wNzEhBvTNa4MMTUdJhzrkuWtD98e4ApehgDqWvHB/+FKCGVs27FKgR9QkyogI1m1YCPvvBiPaLKPpv6NHdDCitJ9zfpv4tggNFvV1gBBwVzyedIdunSwXCVcULCBZVZIIeRlgqxehraBiGBlsLYjAGJ9I2YE86IG9qQH5k2SMooLYmudHCE0KMKaNXwUMlgWupR+c7Agm4E/h9Vho0wkliLPB9uYgfHmAr86VzZM43SJzgINltvKeNkvzp2CcEatYT54EF9Laq9jldMEMByXG6jzEzJN3b5F4gKCCbDKDWPevEJ1DHa9Y2DnYZd/5ghpkemRreaiHul5NwVkWkhqGGQU3hIkfNvjW9J0tFIwL+cuBGyR68hAWKUzxLeghMc18Kjbj2vwybA7iS3H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WDIe5mVfTCCC8pUxnng0VaBzh8cTIZh/JzrJ6b0xftT3yPAD8lhG0x0oi9lNBXv/6c8Jo/XRCvxo8zLfUHLfW2qxFPevMCNQ7GAKADF8Lt17mlxCULkbqMMGxU6CwtgWph4oLZJqRvM34BF25hClkoa8RYhP66Pxa4CgNNlzEvLD2CzQpR8zBwy/r4/OUcKQ6oMD9ztfT1R3vNrx63F5SXPTeTpsfuPwbGHdjcuyYrKH 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: 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 Acked-by: Roman Gushchin Acked-by: Davidlohr Bueso --- 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