Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp290096pxu; Wed, 25 Nov 2020 03:19:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDqqPrsSsnugCKAG9m4ZArUrtVUks8TSmScmToVFIlILE7I5BT08lPIPNooLDMP7M8lS6x X-Received: by 2002:a17:906:7698:: with SMTP id o24mr2643242ejm.447.1606303147195; Wed, 25 Nov 2020 03:19:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606303147; cv=none; d=google.com; s=arc-20160816; b=broe5puqRX1CzGSlYA3aiGBV+FS+q4bPCqXz7CaOjUb51ygMFWS2z3FNMsWKxbQPeX fIu8RQ56+GsUWoyfpLFOi2Vi14MDVo0z5V+Bi2dt3/HiLnIFIJ1wzFFQNW2n5AfT9PE/ P53DbvRg276ci0fNB6JXgJF2adqFxFWK5CMmgGwLmQ/MpJXGJMhrlCBXsd7nSVAYAFOM tc8rffRyEyjYjfLCT1gqlbcVju7OFF5UAoIPBJb+Y4uET0x6vSo360NfR+3s+Pb3BvUM KOFGXt/5C8XP2NTJkbJO4VBqOVore7cHtGF9yA43EXbFYWSANYEroyDtcCa20bkqZlWV iIGA== 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=Vmrifzl4A3f/O40RO24t+8RGzkr1gyx9UcKYuOhWMqw=; b=l2uouBCqfBz5eZo1xnmU9tQx3M+djFDrrouEf47ihkDYKIPOZx7c+2EyJG8VnOLpw9 jodsALwjEgt+dRjHpZ88H8865yN/3BDJ7+r+G/vUDsdTmRyqY2ULTj+mzYGwggnCCBz6 xLldx/oOVU5pPyxKGGF5kk885IS2Hk29AX9mCtw05Rc5z2rNdNy+B1LACWrEIVD5CVnK q4rIbkY9oE6jz5N4yHF2sucYZgJpK/CFB+nje4sUdnEbCEnVFsI3e0jqFyb5spMk3SqD /bwm2rXSRvX9QF7uwbTGUsuQXM3Vj8hP7OwUK77g124v7qyN/U141G9ynuRy1kJCsIH8 VfPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b="NY//4ROA"; 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 91si1319005edy.541.2020.11.25.03.18.37; Wed, 25 Nov 2020 03:19:07 -0800 (PST) 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=merlin.20170209 header.b="NY//4ROA"; 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 S1726316AbgKYLQg (ORCPT + 99 others); Wed, 25 Nov 2020 06:16:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725616AbgKYLQf (ORCPT ); Wed, 25 Nov 2020 06:16:35 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87EDBC0613D4 for ; Wed, 25 Nov 2020 03:16:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=Vmrifzl4A3f/O40RO24t+8RGzkr1gyx9UcKYuOhWMqw=; b=NY//4ROA+aA4lQ1yEmbzIwqumZ al27EHrv9pFO8m/tiWtPKw4ZXxB1+nG9pg10on9A6QcwFuKDiUoPkPHbJOSKdWhg/cRmjCgODMWhw 8y/a6bZUYgEUALBE5NL2RBocD0aL6UMatin6OSXmjMWgmG1Bfkmk3fyK56cB6qZjy9P9Nx9j+QST3 G2uWFKSscez3KHbzdP7suBuzH3jFLNneXU9Rr6bsCGd5Gr+zLQFpRIYKTHvw+FjijTyFRlLL4rFsE WvoNJjpjp/3ix9jEY6xyoXzim3uznoKLjvy1oJXcIyQ/I1hjO5evoJoAVOeU/Ps2w5hX5sS/RaKna uORrs24w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1khslz-0008Dl-K9; Wed, 25 Nov 2020 11:15:43 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 6B09D300DAE; Wed, 25 Nov 2020 12:15:41 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5213F20D6FE74; Wed, 25 Nov 2020 12:15:41 +0100 (CET) Date: Wed, 25 Nov 2020 12:15:41 +0100 From: Peter Zijlstra To: "Joel Fernandes (Google)" Cc: Nishanth Aravamudan , Julien Desfossez , Tim Chen , Vineeth Pillai , Aaron Lu , Aubrey Li , tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org, torvalds@linux-foundation.org, fweisbec@gmail.com, keescook@chromium.org, kerrnel@google.com, Phil Auld , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini , vineeth@bitbyteword.org, Chen Yu , Christian Brauner , Agata Gruza , Antonio Gomez Iglesias , graf@amazon.com, konrad.wilk@oracle.com, dfaggioli@suse.com, pjt@google.com, rostedt@goodmis.org, derkling@google.com, benbjiang@tencent.com, Alexandre Chartre , James.Bottomley@hansenpartnership.com, OWeisse@umich.edu, Dhaval Giani , Junaid Shahid , jsbarnes@google.com, chris.hyser@oracle.com, Ben Segall , Josh Don , Hao Luo , Tom Lendacky , Aubrey Li , "Paul E. McKenney" , Tim Chen Subject: Re: [PATCH -tip 22/32] sched: Split the cookie and setup per-task cookie on fork Message-ID: <20201125111541.GU2414@hirez.programming.kicks-ass.net> References: <20201117232003.3580179-1-joel@joelfernandes.org> <20201117232003.3580179-23-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201117232003.3580179-23-joel@joelfernandes.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 17, 2020 at 06:19:52PM -0500, Joel Fernandes (Google) wrote: > +/* > + * Ensure that the task has been requeued. The stopper ensures that the task cannot > + * be migrated to a different CPU while its core scheduler queue state is being updated. > + * It also makes sure to requeue a task if it was running actively on another CPU. > + */ > +static int sched_core_task_join_stopper(void *data) > +{ > + struct sched_core_task_write_tag *tag = (struct sched_core_task_write_tag *)data; > + int i; > + > + for (i = 0; i < 2; i++) > + sched_core_tag_requeue(tag->tasks[i], tag->cookies[i], false /* !group */); > + > + return 0; > +} > + > +static int sched_core_share_tasks(struct task_struct *t1, struct task_struct *t2) > +{ > + stop_machine(sched_core_task_join_stopper, (void *)&wr, NULL); > +} This is *REALLY* terrible...