Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1471069ybt; Thu, 2 Jul 2020 06:24:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6Ez854G0W/1jJVrhN3YpOdQvcaNyQ2wBPJT5123vE/58gp5ss/lSKq/pml4s/4NXMQIEG X-Received: by 2002:a17:906:538e:: with SMTP id g14mr27307578ejo.300.1593696287963; Thu, 02 Jul 2020 06:24:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593696287; cv=none; d=google.com; s=arc-20160816; b=jpCW5TOnplcCM+zW6TM9JSoRGwOYBeuOIh/MrF9PqrKcYHGScPSLcCf+BlqkGw19FR WXSH5okEBpLWf4A4y5aaGa7ELdROYdj6neCnNiLfCUIe0IdBBxbnurMdHtDw0/lDSv4n 1QngD8s9AusFgjCtudJxNOqzAK/K+Z6Uex5rMAS2TXrZUXk9se8al13cT9ZjKOsY1z9d puuMRl3xYY4cBXiRncDqzw2E3mNTDmX0NTX5AspJk53u3Bgo8GYx81C9QFdj8/+0EYNk puIDu9kZ+Opl8ebE8TpRMIj28Vnjypq7GLbF8P3WVPEKoq2VGQFPTlQEdUcNOlZQ7Oj5 a+BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=tQQycwGEKzdKxcoNoWPFauxOAQvh7OvU0dyuaE5A+6I=; b=eXXi6mAQ7ES+TpkaqUAeOWWoaD1SPGNks5WevAG+JfoObdsvrVD+StHfkhC3462efV JxxrOU+EiywXIgCfR28HX54p8WBIhwRfs+MWpDnnMyTxfb+8ucYke1paej1xh1QcTA6o J+wjuIxglvlQdWnixeRS2SGsQXaS65mtMJXt801YOD4ksKUygBFW/xWXuHn/D52NskPZ mIzo+KQbq1DghidOE0n476f5S7HAm0RN3gi50KAVH6SHTZrsehqOgZ4TJzM9hEPHv2YR XZViqg957z0dpQBzES0GhFb7B/zkNGWfIxK2/h7gX6tR7KqMzXQd8ACzR4C7SrVLMGmj evzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=MOdEZaH1; 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 p19si6005792ejw.369.2020.07.02.06.24.24; Thu, 02 Jul 2020 06:24:47 -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=@joelfernandes.org header.s=google header.b=MOdEZaH1; 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 S1729278AbgGBNX1 (ORCPT + 99 others); Thu, 2 Jul 2020 09:23:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729067AbgGBNX0 (ORCPT ); Thu, 2 Jul 2020 09:23:26 -0400 Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3244DC08C5C1 for ; Thu, 2 Jul 2020 06:23:26 -0700 (PDT) Received: by mail-qt1-x842.google.com with SMTP id h23so21218121qtr.0 for ; Thu, 02 Jul 2020 06:23:26 -0700 (PDT) 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=tQQycwGEKzdKxcoNoWPFauxOAQvh7OvU0dyuaE5A+6I=; b=MOdEZaH1q3CM9K5QJ5rNQe+0b02f+Gb3AdYcq8JjheThCfW7YCBE4XN5Wzq3fXpAs9 cE1yb5GpwbZoNui7bGwgX738mAqWU14NTCrnH2KpL5aIAryjZNkpmKOQbKybAQVya2qI fZqYV8R0xz3dPNpT9uA2BDrmHtIeN2g4/HK5k= 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=tQQycwGEKzdKxcoNoWPFauxOAQvh7OvU0dyuaE5A+6I=; b=bhQ1YvwS8rH6i8vrVCtJGO4jZxxocX4XJvE7c2Dc5DTKo7ShoexC3Gh5XJFaPoq5nE l2D46vWaLH2rrxiPk07ex5kAUuBX6xQXzg6b2wPvDA5L7PRrzaiqXIwbciao38SC9x0H 2aUT57Jc3qjZTyEoeynJLMNxAVuvCBzaG33FUvZut/eYjHQdOVvhu1hcTtQCJDoZ48bO dzRU8d4CW9ZJmUSDzomJ/Vqqtnt5caNwSXcXKE5vnNhuJj6WKVgkPlEmlgbI1EuZIJdY arvS2KlhmBeA7EncRDrdxvBvzLcBJsRHYKKlWEtkPtOWr7gfMwfzVgRqOkk2gb2TUH/7 i4nQ== X-Gm-Message-State: AOAM532hRk2NpuBeFTSfJ32ZdDrOVxKlcAYcLqqupt3ILwmrkblrTj5I /SAf7iCrjKawB6sxVX7DhZlBLw== X-Received: by 2002:ac8:2928:: with SMTP id y37mr31690803qty.245.1593696205384; Thu, 02 Jul 2020 06:23:25 -0700 (PDT) Received: from localhost ([2620:15c:6:12:cad3:ffff:feb3:bd59]) by smtp.gmail.com with ESMTPSA id 21sm8386266qkj.56.2020.07.02.06.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2020 06:23:24 -0700 (PDT) Date: Thu, 2 Jul 2020 09:23:24 -0400 From: Joel Fernandes To: Tim Chen Cc: Vineeth Remanan Pillai , Peter Zijlstra , Nishanth Aravamudan , Julien Desfossez , tglx@linutronix.de, pjt@google.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, subhra.mazumdar@oracle.com, mingo@kernel.org, fweisbec@gmail.com, keescook@chromium.org, kerrnel@google.com, Phil Auld , Aaron Lu , Aubrey Li , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini , vineethrp@gmail.com, Chen Yu , Christian Brauner , Aaron Lu , paulmck@kernel.org Subject: Re: [RFC PATCH 06/16] sched: Add core wide task selection and scheduling. Message-ID: <20200702132324.GA643048@google.com> References: <20200701232847.GA439212@google.com> <200c81ef-c961-dcd5-1221-84897c459b05@linux.intel.com> <20200702125757.GB439212@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200702125757.GB439212@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 02, 2020 at 08:57:57AM -0400, Joel Fernandes wrote: [...] > > > unconstrained pick, then rq->core_pick is set. The next time task selection > > > logic runs when stopper needs to switch to idle, the current CPU is not in > > > the smt_mask. This causes the previous ->core_pick to be picked again which > > > happens to be the unconstrained task! so the stopper keeps getting selected > > > forever. > > > > > > That and there are a few more safe guards and checks around checking/setting > > > rq->core_pick. To test it, I ran rcutorture and made it tag all torture > > > threads. Then ran it in hotplug mode (hotplugging every 200ms) and it hit the > > > issue. Now it runs for an hour or so without issue. (Torture testing debug > > > changes: https://bit.ly/38htfqK ). > > > > > > Various fixes were tried causing varying degrees of crashes. Finally I found > > > that it is easiest to just add current CPU to the smt_mask's copy always. > > > This is so that task selection logic always runs on the current CPU which > > > called schedule(). > > > > > > It looks good to me. > > Thank you for your review! Could I add your Reviewed-by tag to the patch? Julien and Vineeth, here is by coresched tree updated with this patch for when you are sending the next series: git://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git (branch coresched) There are some trivial fixups to the debug patch, due to this commit. So pulling from the above branch may save you some time. thanks, - Joel