Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp712803pxu; Fri, 23 Oct 2020 11:21:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHI/8HyNUVYddxVM1kwNzTTSQ9eJdFQT/nHqLPfcqcDyfnjOhPzDFMM1nIkB3AGNmVfUvU X-Received: by 2002:a50:c05b:: with SMTP id u27mr3361661edd.290.1603477313879; Fri, 23 Oct 2020 11:21:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603477313; cv=none; d=google.com; s=arc-20160816; b=EFeqccu7qKVNqYkohqtTZDuvYQv/U8y3gKjwybcu8ng0hW05gWeMEi6PvsJNehs1bC k0NT2mVf7uz+RzzJhbuUPr9AaIok/0JfRWhVwGzK2/PoqitcGtJphq2DvCPeTlsJH0Up RFzayCGQULwWfQASN3fyehvmn/2CiJ90M0hi6XGau7L6fR9Plo0vdecpXRvoSb/O9DYq tzluXpDcRFt/T3KYaU/vbMVehOWvirGy/eiSJLV4pDvuG6C5CIXBMMHe+c8SrPx1+Xxt 8PHZuhirsG+Heo8VwPbWPIwIrp9yenKmFLHkRwfZ+6iUEhYeqiYaMkBOENAB8UDeunV7 OVUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=3j1wdMU3iWUzcnIirPeVJ1o9wQMVAaCuFP8KGikRUI0=; b=F74t+KvV07iTXxnYp1cYd6E6Dn+nr1nRmlCEnw/b1YzySuLpcMgE3/sQa15uEqaJPQ YzvaI3YvNrILXJHmjRhewdH01hWJw0IkvngUur/coIVBCt3C3lC8O3Pxg6u3c6gbJN0r m/GAlWhzcLTJEyzK59xMb4z50T3rfkWuKCrUQ8oG31hHqdr+HgocXlvUb92Jit39LBt3 33A1oVvUCoXElAQM04MlaHudxwEqBR209HXrgJt1vZ4C6QvW1kJ6KGJuJOqA12+WLmdh +JliUN3QhiE8eZBrBuKaPpGVSTBW6nUnxHnGyfi314ZvW668eY+27wpLrC1RHplLlfUP rh1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ieVavwer; 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 l2si1430837ejf.667.2020.10.23.11.21.31; Fri, 23 Oct 2020 11:21:53 -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=@infradead.org header.s=casper.20170209 header.b=ieVavwer; 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 S465568AbgJWPHc (ORCPT + 99 others); Fri, 23 Oct 2020 11:07:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S465564AbgJWPHc (ORCPT ); Fri, 23 Oct 2020 11:07:32 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9367C0613CE for ; Fri, 23 Oct 2020 08:07:31 -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=3j1wdMU3iWUzcnIirPeVJ1o9wQMVAaCuFP8KGikRUI0=; b=ieVavwerONVKNmvQX5oI6DkDTM xYe7zBeHmxdM+6wrbRurYQvNGQWZo/kpijA2qehJEvfz/d4lvgZ1KDgMl0BA2+JB02ikmH9YWTvdG F9Euv40tJJLBnNumSVN8AYIT1vV/MKP2tS9VYiUdZpuOZr/VfhY3cg7nBnMTahqviuJa1S3ePwM4W wa8L31fLNzlgxiBuJWGrJLeNPVyx9Dzymz0bvpQEMEJNAUQmMOkJMdaurwW/ASsF7ObaAxwldiCRS JyuGUXxhUd4r6SjRkHgKHAda9oX98Z6r6akBbgVCPRpX01+yIjGARQu+xj5zUEgFct/0BupmHumo/ SQxtRAuQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kVydV-0003m3-Jh; Fri, 23 Oct 2020 15:05:45 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 5CA9B98104F; Fri, 23 Oct 2020 17:05:44 +0200 (CEST) Date: Fri, 23 Oct 2020 17:05:44 +0200 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, Vineeth Remanan Pillai , Aaron Lu , Aubrey Li , "Paul E. McKenney" , Tim Chen Subject: Re: [PATCH v8 -tip 06/26] sched: Add core wide task selection and scheduling. Message-ID: <20201023150544.GG2974@worktop.programming.kicks-ass.net> References: <20201020014336.2076526-1-joel@joelfernandes.org> <20201020014336.2076526-7-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201020014336.2076526-7-joel@joelfernandes.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 19, 2020 at 09:43:16PM -0400, Joel Fernandes (Google) wrote: > From: Peter Zijlstra > > Instead of only selecting a local task, select a task for all SMT > siblings for every reschedule on the core (irrespective which logical > CPU does the reschedule). This: > > During a CPU hotplug event, schedule would be called with the hotplugged > CPU not in the cpumask. So use for_each_cpu(_wrap)_or to include the > current cpu in the task pick loop. > > There are multiple loops in pick_next_task that iterate over CPUs in > smt_mask. During a hotplug event, sibling could be removed from the > smt_mask while pick_next_task is running. So we cannot trust the mask > across the different loops. This can confuse the logic. Add a retry logic > if smt_mask changes between the loops. isn't entirely accurate anymore, is it?