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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D52AC54EAA for ; Fri, 27 Jan 2023 12:33:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232838AbjA0Mdn (ORCPT ); Fri, 27 Jan 2023 07:33:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbjA0Mdl (ORCPT ); Fri, 27 Jan 2023 07:33:41 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F153D1284D for ; Fri, 27 Jan 2023 04:33:38 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9D88321F05; Fri, 27 Jan 2023 12:33:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1674822817; h=from:from:reply-to: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=MwVWF0Ry0ov8OgZpSO78XYhT3LnmS6xjwoTJM/YHanE=; b=mZBL1tfC342Fb2x7n49SKap6LN+3fdMIxeMXr/1CJivK0PqVzskxEI46ywEseLyK8yAvbr AIYgz20vdrkdRZlwd85e94dlt2HiPW5NNuCOltSQynm3M+qBo/dDK+8ncB4xryzaC2jbYs DPO4eoPXjTks+pOtcyNLOQ6rmKltPmE= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 615911336F; Fri, 27 Jan 2023 12:33:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ZDK8F6HE02NvBAAAMHmgww (envelope-from ); Fri, 27 Jan 2023 12:33:37 +0000 Date: Fri, 27 Jan 2023 13:33:36 +0100 From: Michal Hocko To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Vlastimil Babka , Andrew Morton , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Roman Gushchin , Ingo Molnar , Johannes Weiner , 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 27-01-23 20:43:20, Hyeonggon Yoo wrote: > On Wed, Jan 25, 2023 at 10:51:05AM +0100, Michal Hocko wrote: > > On Thu 26-01-23 00:41:15, Hyeonggon Yoo wrote: > > [...] > > > > Do you happen to have any perf data collected during those runs? I > > > > would be interested in the memcg side of things. Maybe we can do > > > > something better there. > > > > > > Yes, below is performance data I've collected. > > > > > > 6.1.8-debug-preempt-dirty > > > ========================= > > > Overhead Command Shared Object Symbol > > > + 9.14% hackbench [kernel.vmlinux] [k] check_preemption_disabled > > > > Thanks! Could you just add callers that are showing in the profile for > > this call please? > > - 14.56% 9.14% hackbench [kernel.vmlinux] [k] check_preemption_disabled > - 6.37% check_preemption_disabled > + 3.48% mod_objcg_state > + 1.10% obj_cgroup_charge > 1.02% refill_obj_stock > 0.67% memcg_slab_post_alloc_hook > 0.58% mod_objcg_state > > According to perf, many memcg functions call this function > and that's because __this_cpu_xxxx checks if preemption is disabled. OK, I see. Thanks! I was thinking whether we can optimize for that bu IIUC __this_cpu* is already an optimized form. mod_objcg_state is already called with local_lock so raw_cpu* could be used in that path but I guess this is not really worth just to optimize for a debug compile option to benefit. -- Michal Hocko SUSE Labs