Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp149101pxj; Thu, 13 May 2021 01:21:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZv1954H3Xka5NWm6T7tWK3EAshFza8KLfcdGinT9IisFSGWbucT2NAs/lACoeUZ7dqvld X-Received: by 2002:a5d:948e:: with SMTP id v14mr29163294ioj.92.1620894091300; Thu, 13 May 2021 01:21:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620894091; cv=none; d=google.com; s=arc-20160816; b=bQqysPTmxA3GtXlP9MDQFL+2LNINL10CP2bRM4VfJZ1lr3d7NoFKDC95Yc3JozVSSb FjLFgvfW72W7rF/YCai00SOBzR7aPBmpczZAoqyTS8yTDeCSoNMU5557NucOXUrlnLjB KOpt2n5NZ3IiL+c0DbCuI5q1Nlfku1Ayk4dfMbXRdAaC4N5EFiky0lJNBwhl99U6nIyz yvv/E40P5obwmuvNeocVnj+Ix9BJDQOSfhtgW0oHFhj3Fo+fYiMJkb5tk6SRHrxdAotC 2ztyhrwcPzcKAnZ56dS05Rn7pDdh5N4tJzkcNGbe6Fx/+xfHEzUhk3dy/ZcVvHUTawNo lCZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=U3AtK357XhQlF95ANJynYFxOAFG/7/0spRwmZLPK/sk=; b=Qm5FrU7ZtXSf1CCEhDg7DnEr5lhsYwt0eh0OxqelZMklSvuwBgrsKUYaMjDLPUFVrq FhLtp5jrDlGq3XItIcMZhDELnH60KeZFI9tEpa5UPbDhrDNzU1yf3S0b8+3H2ncoAVZ2 IEaYh/C3+q6QJfxI/DL07zC6qKTjczAS3fY0i4xaVhnUZ/NQxUeNsQtVJAh9TcBg+9oh MIFBP8vavXJ8F1kcgdVTYmnYF3HIr0bb5J+vVpWah/JSugm1OdWd+rlQ5+aDTTQKm9xF DfjN7LRmUuRv9ORB0CnuMvZwfDVP78IWqrqbWTQ6+TMRiqF/HIpgq5eLkZRFvRMXPdgC D3pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Fg92kioq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l3si3309944jad.55.2021.05.13.01.21.15; Thu, 13 May 2021 01:21:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Fg92kioq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231678AbhEMIVv (ORCPT + 99 others); Thu, 13 May 2021 04:21:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231149AbhEMIVo (ORCPT ); Thu, 13 May 2021 04:21:44 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0633CC061574 for ; Thu, 13 May 2021 01:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=U3AtK357XhQlF95ANJynYFxOAFG/7/0spRwmZLPK/sk=; b=Fg92kioqpMDqSIMchG0+GGR1wY bM9mIR1c0wLY7gmewlqRLSrwW7DkBd5YT9oPfofKB58sYv+Plp3vcaUloFMg4DWbyvEAxoCRNAwuN bfF2r051/LjmOLAihpHzkgLnLS6PmcJBmNneOn/OPWnANPY4BLM+piF96WAybj5zlzRLbyIznBAn3 KgyLLyqtWxV8YibzLzeRvkPqJm0Xr3o4ITtQjmZgoihN9ydf9BN2SBuDWHKluaTzxlg9shRi/bwTv lrjI+iUPiFJIlCHg+hPyBnAPAjhdKSLqVMwVBGRb3uQtJD81ofVaSE5C3UNWIDczGrWVRCoJiUh80 IHopR7eA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lh6Z1-009GSP-ET; Thu, 13 May 2021 08:19:42 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0C65130001C; Thu, 13 May 2021 10:19:21 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A15692C2FC6F9; Thu, 13 May 2021 10:19:21 +0200 (CEST) Date: Thu, 13 May 2021 10:19:21 +0200 From: Peter Zijlstra To: kernel test robot Cc: Frederic Weisbecker , Ingo Molnar , LKML , lkp@lists.01.org, lkp@intel.com, ying.huang@intel.com, feng.tang@intel.com, zhengjun.xing@intel.com, Paul McKenney Subject: Re: [entry] 47b8ff194c: will-it-scale.per_process_ops -3.0% regression Message-ID: References: <20210428071653.GC13086@xsang-OptiPlex-9020> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210428071653.GC13086@xsang-OptiPlex-9020> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 28, 2021 at 03:16:53PM +0800, kernel test robot wrote: > > > Greeting, > > FYI, we noticed a -3.0% regression of will-it-scale.per_process_ops due to commit: > > > commit: 47b8ff194c1fd73d58dc339b597d466fe48c8958 ("entry: Explicitly flush pending rcuog wakeup before last rescheduling point") So the RCU bits are in rcu_user_enter(), which is called from __context_tracking_enter() aka user_enter(), which is under context_tracking_enabled(). But the new code in entry is not; we now unconditionally call rcu_nocb_flush_deferred_wakeup(). Did that want to be under context_tracking_enabled() as well? Frederic, Paul? --- diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 9455476c5ba2..f4df001410fc 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -114,7 +114,12 @@ static inline void rcu_user_exit(void) { } void rcu_init_nohz(void); int rcu_nocb_cpu_offload(int cpu); int rcu_nocb_cpu_deoffload(int cpu); -void rcu_nocb_flush_deferred_wakeup(void); +void __rcu_nocb_flush_deferred_wakeup(void); +static inline void rcu_nocb_flush_deferred_wakeup(void) +{ + if (context_tracking_enabled()) + __rcu_nocb_flush_deferred_wakeup(); +} #else /* #ifdef CONFIG_RCU_NOCB_CPU */ static inline void rcu_init_nohz(void) { } static inline int rcu_nocb_cpu_offload(int cpu) { return -EINVAL; } diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index ad0156b86937..3cdbbf7fba01 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -2378,7 +2378,7 @@ static bool do_nocb_deferred_wakeup(struct rcu_data *rdp) return false; } -void rcu_nocb_flush_deferred_wakeup(void) +void __rcu_nocb_flush_deferred_wakeup(void) { do_nocb_deferred_wakeup(this_cpu_ptr(&rcu_data)); }