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 0A4BCC004D4 for ; Sat, 21 Jan 2023 11:54:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9B1216B0072; Sat, 21 Jan 2023 06:54:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 988D96B0073; Sat, 21 Jan 2023 06:54:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8516A6B0074; Sat, 21 Jan 2023 06:54:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 770A66B0072 for ; Sat, 21 Jan 2023 06:54:28 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 54A961C6266 for ; Sat, 21 Jan 2023 11:54:28 +0000 (UTC) X-FDA: 80378648616.04.D44CC27 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by imf29.hostedemail.com (Postfix) with ESMTP id 7AE9112000A for ; Sat, 21 Jan 2023 11:54:26 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Y+ojwA3y; spf=pass (imf29.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.214.182 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=1674302066; 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=yu0JPWDS2jb23DVOgU0pvAgdD67chS/bHtClPy/cVdY=; b=GPXgDisJPB0T4iVHuQnPAQnj9TMx6xf5V8ezTl3+5CziXlcx0WIUzoVpjIzIkACoWGfoKD E3tplswJlvIUFzD2UyBaffty9+4qwORyHi7FpDBjm331nQFKXV0w1qQhecyquvDNQZOkom fhfytW4Te7sF2aLAzC4XJmFetrtgC/Q= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Y+ojwA3y; spf=pass (imf29.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.214.182 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=1674302066; a=rsa-sha256; cv=none; b=GB3aJpFor4MvM4BZ98Dr7GAyqhjKtRi6Gl10veectWikQ2SzcZjTAhKSByoa4rxWsK5M7C 5760ST9IuQO+TDeyokHnSZBZ1c3bUamk6pW9I3lVF+p9ofXVxzzj0hff/j/1nwLCP7I434 fMD7mqCuBy7YlODUckAzUB3d14qBNY4= Received: by mail-pl1-f182.google.com with SMTP id g23so7453979plq.12 for ; Sat, 21 Jan 2023 03:54:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=yu0JPWDS2jb23DVOgU0pvAgdD67chS/bHtClPy/cVdY=; b=Y+ojwA3yG7jNh3yHgGAEjga11q5J9UiCKdXivgHUY6+lqZRjpJraZ/6q8MbePlEfoS mnjuXBpcaMHfrKWSiwte9bNte66lEiif4eMw4cHdLbdqKRI1qE1wUFYrr37L8GOOzr5u /jWF0At9Q0PxWOhXDGuvYHEXgHiVapxq15Ezfj0nooZ2xbODU/B2iLhbGRPZBXTrzfJU i94kAuf6DVkM8nEeXeVH5rtr+b3b9B10AOAt3skKUa1GqX4fYXTBBPEDI4cLTchqZBqf yyORNtUcWwElqfB+ZrtuO1x+8eaHvqfeOCchYdhvaNf9JqbQRrivQ8sI5OgFY1jDJcou 7Liw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=yu0JPWDS2jb23DVOgU0pvAgdD67chS/bHtClPy/cVdY=; b=JvvEWGIv68k8oy5wculsqMc9jWFEIjEbr343nRY8rjtJg3VzGyw64OskZ3zL0UlxNf IeI9Ir/h3cspqD1tDXXOZnNzPqzp86/+8KQnfT4D4UYxluYVbh107tnbZ0mfP7P0o2/4 fxAeHENySOxC++TUeRb8x9XoYJVbZlNLNX5kGB43PtTAuHX5kwZMAwtcqrMC5tFW40sP oajsFLL3h6W5aozXt5stHT6QIolf4xe9hBiXtkXZ0EAU+t7gMo2/fxFWIRvFFit0X1+X IN7kAPThO8wxboclfRcLk7oaTV08ThXv4uc7mvp99cQn2yg0S+PVrsXy3Kz3O85pRJoi TmPg== X-Gm-Message-State: AFqh2krt4ZMUeb2xwyq6TDGRtPwyAeeriNEG2WIeS1/etjJg4LjzIQPR Q+6qhYn3MjM7B97mTQUX4Lg= X-Google-Smtp-Source: AMrXdXvN26yYUni73PvR56Lw1IhZEyMtGrLsO2ZJ10XnqbeNXxQ7zNkSljk+zQXAtYd6+AnybdBtPw== X-Received: by 2002:a17:903:2446:b0:195:e8f9:7e84 with SMTP id l6-20020a170903244600b00195e8f97e84mr6279036pls.1.1674302065245; Sat, 21 Jan 2023 03:54:25 -0800 (PST) Received: from hyeyoo ([114.29.91.56]) by smtp.gmail.com with ESMTPSA id e8-20020a170902784800b00192fb119eb2sm17937760pln.54.2023.01.21.03.54.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Jan 2023 03:54:24 -0800 (PST) Date: Sat, 21 Jan 2023 20:54:15 +0900 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Vlastimil Babka Cc: Andrew Morton , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Roman Gushchin , Ingo Molnar , Johannes Weiner , Michal Hocko , Shakeel Butt , Muchun Song , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Dennis Zhou , Tejun Heo 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> <86e68d3b-b029-5e82-5bbc-e0ccc2ae1d36@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86e68d3b-b029-5e82-5bbc-e0ccc2ae1d36@suse.cz> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 7AE9112000A X-Stat-Signature: 41hphyzzohaww1mah7wqcpakkjq7ycxj X-Rspam-User: X-HE-Tag: 1674302066-525018 X-HE-Meta: U2FsdGVkX18iSw4wiFqc+p2Tz986ihI1d6D+yL8Ghm2RubZAWVZxW1Wk/7ueh+cX4QNWzyMsW24zuboMUZYhvdt8iEi5i3J7TG52hIUhbG0XJWUtnJe+dCulGnv3nHZyyVe+b+gIQX43rFwd55PpReHXgR1R4c5Hrn6Gs6yGHs+jbGmYUlTmxz+B83cVAtY9z1/c6zaqMXukNhqD5DqoYsl5V2Vz5WeP2CuNwv3htx3RmTnb3JyFWB3zdnes5y0QOsZpUkzV54nkkwyZWgmsWZhi3ft+c9JYIz4vNKb2se+EEmrhBocr1w3YGJhJBVNY4eudrL00tByPuExW3j6UMkBtL/C5ACSSKu7/dNGZECNkI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cLRFnzvKxzyRHU+Fg8am5WK63w9D05CV4CxlKINa/24KBsUfkFUbPTaZ+kzp7nhowz37bwDycSjd9uRacMYtAsyP4nrzf25MYvo= 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:29:44PM +0100, Vlastimil Babka wrote: > On 1/21/23 04:39, 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> > > Looks like it's there since the beginning of preempt and pre-git. But > probably should be something for scheduler maintainers rather than mm/slab, > even if the impact manifests there. You did Cc Ingo (the original author) so > let me Cc the rest here. Whew, I still get confused about who to Cc, thanks for adding them. and I also didn't include the percpu memory allocator maintainers, who may have opinion. let's add them too. > > > --- > > 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 > -- Thanks, Hyeonggon