Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp289224pxu; Tue, 1 Dec 2020 11:17:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+diI7WKwb57T8iUpesHcTvJXaDfWVT1B0BKgpVl/UliSdxKAhRTLXuW3WWlBL7TYzs6Qv X-Received: by 2002:a17:906:4049:: with SMTP id y9mr4601913ejj.442.1606850242373; Tue, 01 Dec 2020 11:17:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606850242; cv=none; d=google.com; s=arc-20160816; b=TkSGFGRIvQMmkBeymzCMbXrOqYosBqeL+Vr4ebsmyLs5A3PlpjT6vob/rOPLeF/Xo+ hLFVN64C9s/WoCqV7VL3BkiiIWFmv3GieI72Kbk+wonxKI8k3iaosUl5pJROR2mCj43i jPOB4L9FrjmIzEfI0roa/SwShmoNaZ3eoOWbvS6pKu5PdN7BwFeoxw2aqbKHOPZA9c0U QYcy/45NUVphsE4pjdk4TOLjAWLJWYHPHU+ybhmkvLWUi6SmzhGe6JmJnwPqxZ2tzqd2 VakcSeuLShHr57ixZZ+QaqqqurQugPcyyX+5wI1odoNINrvvXwnferA2WoNruDD/LsTm J+FQ== 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=ntCr/pSg4JSjFrxMtHG6/5C4LU/dmq+6fzeMtN2uAWo=; b=sfdBaeuFqTJNiCjQKIRpSICD0K/qnzA8A/b+uD0T9+Gjw1JkVPMR6f1rISQxkvAvFG cbzLod9k3jyFsrrvvKlO+KvO+TVgPcWRXCPDYkRzKbx29dShQEDl/7VBXvdsji+0tdpI DaUsPIuEaDr4lz7+foa0vU2XQFjI5SLdnPYUbJxqZQzSYCg6kFsIHHwFWTTAbk7gvyUP N3tbX6yQR8NNmC0eboNfvR2TqT2zd/FlxcoeorU3nsLbPliFTTPOyj0oWSrjqgCrh5c+ 2Ha45L9DSOM00XRKtjEY73IoXefLDZucaPLhPaDjt5L10vkRFg7fpAX0AbbGlttEhdX7 9uBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=t0vLKiLJ; 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 a13si527557ejt.49.2020.12.01.11.16.59; Tue, 01 Dec 2020 11:17:22 -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=@joelfernandes.org header.s=google header.b=t0vLKiLJ; 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 S1731307AbgLATMP (ORCPT + 99 others); Tue, 1 Dec 2020 14:12:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730335AbgLATMP (ORCPT ); Tue, 1 Dec 2020 14:12:15 -0500 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35D44C0613CF for ; Tue, 1 Dec 2020 11:11:35 -0800 (PST) Received: by mail-qk1-x72e.google.com with SMTP id q22so2412668qkq.6 for ; Tue, 01 Dec 2020 11:11:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ntCr/pSg4JSjFrxMtHG6/5C4LU/dmq+6fzeMtN2uAWo=; b=t0vLKiLJRvy0c0Nnj8o1sPgoGSFAC+rf0FMNPceESjE/RnamnVgF2DX8hdpQEFofd5 qXUP1EhGMKMJBNp7SoJHwOkft/4/ztkAby1AQSO7Pl166Q1eIdtzUFezAyTQfIp8kQLU 4SHUbR3m24HO8N7hfA0bVDJBeyVbV/l8NVfwo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ntCr/pSg4JSjFrxMtHG6/5C4LU/dmq+6fzeMtN2uAWo=; b=THirxJfqgkZpoU39b5Ktxj0J9K2MLF5YsJevHUGgrHhPJF63iYZFPvmQ4TQNbD00g8 kMBgxzelchlRgypgLSAFEacNJY5a5O9YR2D/+FjoPVFn1zs0tql0S4yzp/1HqmkbFAFT Iots/64M6uQyPX+Y3hBQGLRxPmKlzgTKsL2e3AIYbpzn9S6DvYic/FH6TXrgfcKaMeL0 G4HHTwawwO5x6BNg7gR3XKiWLMECuC1fgq3PgF1YGcYcf1kBBflzSykzceFWpt81asMV PGJjAz8bviOXeXcoBoan3kQhhUFUqLkHqS80huXPz5FDLoDdeXHsoozvJ7buHsw8vm7m Uh1g== X-Gm-Message-State: AOAM530QiHP3/IiX5R7+qK3lac9IziGchmeVsB34ZbR4aVmc0hsmb8L2 cwM+gP1CLN8JGABKhJ8Poa46DA== X-Received: by 2002:a37:614b:: with SMTP id v72mr4470028qkb.355.1606849894348; Tue, 01 Dec 2020 11:11:34 -0800 (PST) Received: from localhost ([2620:15c:6:411:cad3:ffff:feb3:bd59]) by smtp.gmail.com with ESMTPSA id u20sm435358qtw.88.2020.12.01.11.11.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 11:11:33 -0800 (PST) Date: Tue, 1 Dec 2020 14:11:33 -0500 From: Joel Fernandes To: Peter Zijlstra 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: <20201201191133.GA221478@google.com> References: <20201117232003.3580179-1-joel@joelfernandes.org> <20201117232003.3580179-23-joel@joelfernandes.org> <20201125111541.GU2414@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201125111541.GU2414@hirez.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 25, 2020 at 12:15:41PM +0100, Peter Zijlstra wrote: > 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... I pulled this bit from your original patch. Are you concerned about the stop_machine? Sharing a core is a slow path for our usecases (and as far as I know, for everyone else's). We can probably do something different if that requirement changes.