Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp437213ybz; Fri, 17 Apr 2020 04:01:36 -0700 (PDT) X-Google-Smtp-Source: APiQypKHUEwz4iVAM1VlRSJJ06Suh7n4QTcv1YYZan6Ygwws/cebgRk1pukFPbmguKKkxNIf7WJh X-Received: by 2002:a17:906:3502:: with SMTP id r2mr2319166eja.67.1587121296512; Fri, 17 Apr 2020 04:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587121296; cv=none; d=google.com; s=arc-20160816; b=li46Vw+ajgbDJcRA6jRCwxwsZUp+fcw5dbVVlTabpB+3Oy064BLVQD8kH7uN60tdoI VewZ3rPr5kCzPhRuvQGqb9dIGZ9GSqfmcGAZ8kaJt3xR1Ekx+mvl6yj74sF57goR4OLz PQ5nvwlCo7li8XlMBUcbDbsEmqIQUa6J5GQfAXWKJPkozTSoA5MdnOYcQfK7Sj2SI0VI MSpE1R6D11JM4vT7xlcC8IXVKiwvyo9svt80POe3Rd2qFtPJS+pCPU82yMpYnLMagZkX xqb9F5cFfI02oZ3DdSiYrzq3auy/9Q0R+jJZj+XIDzrVl+oEiZcvl1AV+8s5CMMq6ZiZ Jt1g== 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=z/2YlwCzJRJlnoyEyjEn/iO2aTqhf18fTLsV6UABgCs=; b=hEy9zZngAPeWhN6UuSD1anyOwJcl/ub3LK1ZvTTTqL8Wjb30M7me67t5I9j7/qnEoC fit0gscO3Lj8d2RDu2DfWNyL6nwN7DKC3Cm/oPngQqn8QO2nrQumQi4zxnY4HHgexxrb nzbd8XFiVR2Jx3Cg4S01GIYdajdWf9LGjRvJSJoYNDN+DXgAtki2YK32im52xOq3nm9g 6SEb6r63g8i+jJhvxvK45OBXLtexExg82JqQFpOIDwJEwezVtWfTJuHlaWr8ZQJbxNE8 Gq4amvvEYtXCr+O181+Prrf+FkhXv5KZKEbVupdIT5kZzYbAGoGGCwidD6YY60cl2gAq 08jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=YwLKqxpJ; 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 x4si14572866edc.458.2020.04.17.04.01.13; Fri, 17 Apr 2020 04:01:36 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=YwLKqxpJ; 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 S1729707AbgDQK6L (ORCPT + 99 others); Fri, 17 Apr 2020 06:58:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729558AbgDQK6K (ORCPT ); Fri, 17 Apr 2020 06:58:10 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B857C061A0C for ; Fri, 17 Apr 2020 03:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=z/2YlwCzJRJlnoyEyjEn/iO2aTqhf18fTLsV6UABgCs=; b=YwLKqxpJXP7CJdYsKALylmyJfs X6EAKvORcQm+NIE0RrPIW0ZuEAUNGqCfXw78Sgb0fHJ6jXe/gSOvggzV95QcGY8JemE7aySNdhEla zVBhH4Pkroe+06Dop5917C5wXZgtMsx4NbnqZH+zm6p82Hp4sumEUv1zAJzyzx+ovLcjUTWKUBqpl 9oBCRGHLEFovEhxRqKUz0sPbD2VkV0Sd83Z3CDv1Zdb1YbmhTbvzbceaKPy33pPNHr7kkcrKv7P9f ThAVQz00UPFk1oweyudaRFyG38NFIIahhUejf4JuzF5Lb15EkfG5GOS3Q0rnPMfF6TVl6HPR2DpwR LU7W1xvA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jPOh3-00051p-7c; Fri, 17 Apr 2020 10:57:57 +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 A879D304E03; Fri, 17 Apr 2020 12:57:54 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7BA882B1213E8; Fri, 17 Apr 2020 12:57:54 +0200 (CEST) Date: Fri, 17 Apr 2020 12:57:54 +0200 From: Peter Zijlstra To: Tim Chen Cc: vpillai , Nishanth Aravamudan , Julien Desfossez , mingo@kernel.org, tglx@linutronix.de, pjt@google.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, keescook@chromium.org, kerrnel@google.com, Phil Auld , Aaron Lu , Aubrey Li , aubrey.li@linux.intel.com, Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini , Joel Fernandes , joel@joelfernandes.org, Aaron Lu Subject: Re: [RFC PATCH 07/13] sched: Add core wide task selection and scheduling. Message-ID: <20200417105754.GY20730@hirez.programming.kicks-ass.net> References: <20200414133559.GT20730@hirez.programming.kicks-ass.net> <1e587d48-2e61-e425-81cf-d304e13c91d4@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1e587d48-2e61-e425-81cf-d304e13c91d4@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 16, 2020 at 04:32:28PM -0700, Tim Chen wrote: > > > On 4/14/20 6:35 AM, Peter Zijlstra wrote: > > On Wed, Mar 04, 2020 at 04:59:57PM +0000, vpillai wrote: > >> +static struct task_struct * > >> +pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) > >> +{ > >> + struct task_struct *next, *max = NULL; > >> + const struct sched_class *class; > >> + const struct cpumask *smt_mask; > >> + int i, j, cpu; > >> + bool need_sync = false; > > > > AFAICT that assignment is superfluous. Also, you violated the inverse > > x-mas tree. > > > >> + > >> + cpu = cpu_of(rq); > >> + if (cpu_is_offline(cpu)) > >> + return idle_sched_class.pick_next_task(rq); > > > > Are we actually hitting this one? > > > > I did hit this race when I was testing taking cpu offline and online, > which prompted the check of cpu being offline. This is the schedule from the stop task to the idle task I presume, there should really not be any other. And at that point the rq had better be empty, so why didn't the normal task selection work?