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 X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97614C433B4 for ; Wed, 28 Apr 2021 14:18:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5150361424 for ; Wed, 28 Apr 2021 14:18:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240231AbhD1OTL (ORCPT ); Wed, 28 Apr 2021 10:19:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:51264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229959AbhD1OTK (ORCPT ); Wed, 28 Apr 2021 10:19:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 35540613FA; Wed, 28 Apr 2021 14:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619619505; bh=JTcNelOy4HAuItSK2ze/+Or0nI5YTpnu0GNDaGzLqls=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=Czi8oX52i7bBsEfkDWA2Y5ymTLuS7tVdJ58hp470mTFwrulxWWS1dBcAJiO6LHIbH EEy0sbbOKmMqR2A4FACOtp6AOV+LWrUoUX17bjaGoThRT+hkX0XyGKxxxKNle2FIWU rtd+Bf7r2JUU9vGK2z6UdWFy7nbcEirX0biCpRxzeCCywP+zFtXWzb+nJEizq6oAcA /iuB0KVzWqNT9+tkKLOdNJcEAcgMXHlOyrOQ/Im0QxJVzAlgTwaJjMPfraO0T6uL9T 9Xx5JS9cN/LJQeGVqP8nMzJ4IaSBK87/9xIv92IOcNg49s0shk3/njm7TJHNmaQY00 RdIWeZWm2iGLw== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id B0EBA5C0163; Wed, 28 Apr 2021 07:18:24 -0700 (PDT) Date: Wed, 28 Apr 2021 07:18:24 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Aubrey Li , Josh Don , Joel Fernandes , "Hyser,Chris" , Ingo Molnar , Vincent Guittot , Valentin Schneider , Mel Gorman , linux-kernel , Thomas Gleixner , Don Hiatt Subject: Re: [PATCH 04/19] sched: Prepare for Core-wide rq->lock Message-ID: <20210428141824.GO975577@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20210422120459.447350175@infradead.org> <20210422123308.196692074@infradead.org> 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 Wed, Apr 28, 2021 at 01:03:29PM +0200, Peter Zijlstra wrote: > On Wed, Apr 28, 2021 at 06:35:36PM +0800, Aubrey Li wrote: > > On Wed, Apr 28, 2021 at 5:14 PM Peter Zijlstra wrote: > > > > Ah, indeed so.. rq_lockp() could do with an assertion, not sure how to > > > sanely do that. Anyway, double_rq_unlock() is simple enough to fix, we > > > can simply flip the unlock()s. > > > > > > ( I'm suffering a cold and am really quite slow atm ) > > > > > > How's this then? > > > > > > --- > > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > > > index f732642e3e09..3a534c0c1c46 100644 > > > --- a/kernel/sched/core.c > > > +++ b/kernel/sched/core.c > > > @@ -290,6 +290,10 @@ static void sched_core_assert_empty(void) > > > static void __sched_core_enable(void) > > > { > > > static_branch_enable(&__sched_core_enabled); > > > + /* > > > + * Ensure raw_spin_rq_*lock*() have completed before flipping. > > > + */ > > > + synchronize_sched(); > > > > synchronize_sched() seems no longer exist... > > Bah.. Paul, why did that go away? I realize RCU merged in the sched and > bh flavours, but I still find it expressive to use sync_sched() vs > preempt_disable(). I could have made synchronize_sched() a synonym for synchronize_rcu(), but that would be more likely to mislead than to help. > Anyway, just use sync_rcu(). And yes, just use synchronize_rcu(). Thanx, Paul