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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 4BD91C433ED for ; Wed, 28 Apr 2021 11:04:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13AF1613BD for ; Wed, 28 Apr 2021 11:04:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239012AbhD1LEv (ORCPT ); Wed, 28 Apr 2021 07:04:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230418AbhD1LEt (ORCPT ); Wed, 28 Apr 2021 07:04:49 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76FB5C061574 for ; Wed, 28 Apr 2021 04:04:04 -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=zxNgnu2M7GkuCzxbYYc67l1UTIAJJ8OaQJP7t4GsgZs=; b=YyMWUI9LhynBY1idJkAJ9coqw7 +YUlnKB8hm+9GVbxHZ1CS8lfc9i1WI6XYtY+dp+FNr6H9UskDXpIt+oamjie6Ai+ZVUS99fwFbQqQ Pp47Vjrn13G1RKR2dr7MtmhAnAQEW0S+hj9p+lF4E3blotJFxlTorVAxcIqpyjf8YnBipRG4sgwxi JPx2IRkxjBrbi8+iVT5kON/BBu01K0TX5sxjgsxEkAJ+jtPjYhmfuXV85UHFWDK7jMaYeir/NckpA 2T3JqSIeibtMGHLAmoMhJl/Z1MFkirPDaeVBq7Nf+uy2Wnax+Ltj6SmtpR9/VwfZ7jNa/cBng0tZa F5SGZ0Ww==; 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 1lbhye-008BnE-9N; Wed, 28 Apr 2021 11:03:35 +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 32152300091; Wed, 28 Apr 2021 13:03:29 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CF16D2CCF1F67; Wed, 28 Apr 2021 13:03:29 +0200 (CEST) Date: Wed, 28 Apr 2021 13:03:29 +0200 From: Peter Zijlstra To: Aubrey Li Cc: Josh Don , Joel Fernandes , "Hyser,Chris" , Ingo Molnar , Vincent Guittot , Valentin Schneider , Mel Gorman , linux-kernel , Thomas Gleixner , Don Hiatt , Paul McKenney Subject: Re: [PATCH 04/19] sched: Prepare for Core-wide rq->lock Message-ID: 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 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(). Anyway, just use sync_rcu().