Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3263669pxf; Mon, 22 Mar 2021 02:00:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlZSKo9oxX4EICqMW/UEiz4dz+jlhTr2lFuiYAhe1sRDwESsZ11sh6G1bt8UbjzwQE9dyd X-Received: by 2002:a17:907:1614:: with SMTP id hb20mr18132435ejc.77.1616403651709; Mon, 22 Mar 2021 02:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616403651; cv=none; d=google.com; s=arc-20160816; b=B1JMbEAECGsUWCQz/iX3le7sF5n5dxekbvn2nBEy48mhqIcioVIfqjOeyQQIiVykNR vWfJmfMdK4ZdTmK3eZb/mK9OD4IidSIAvs64BWbc/RRpfV4o9xoeBtq7U6WCybGwEWkf kMcTSKR1Sagn4Q+FoMwvPexacg/X5/ZE0tnb4CsSxZMKaquTnCr0Kze1Q+fVBDJ95Mrg vFu1v3G6CWYxXLZA4/USknDBEaeq6E/hXgJKULgp1R/JxMDYpiZvVf5Z6So/2c0S8Yg+ tbpS9VYrQJ8MZBpnS68i8qIttNKvjNIGBQbXQ8zU0fvh2vtHYaE4SrmmIslI9AAnNGpZ ptHA== 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=gkJyH1ka82Nqgxz80lMFhKAEIXgYyo5mEmTvgPuh6PI=; b=MLutmtn3DhMoqsgovrbv/wnHjWdUwiDb0V8V1wKdZhHFSKTOxBRvLBD2i7OQxOMiki 32Xlw0RRXkySV+hSiiYA9OFlXdD6Ii9O+mKCbYaEtDld1GAnYddiUP+ndwjIK0QzxrmK gQNIz8ToQ/XM8ugAXN4MgP5Qh3Ugblhgkm+RWhEeBF5befnQpn8+1UzOgwce5vYlX3f/ G579mvnzg3HU44Cr75UyEpisd6xg8yZNjmVXnBfiUEBuhCDLMfaW+BP02r4imKjlRaCA 9e+Cg1Ub5nHZXcrNO8HgqCJyX3+YgXZOF8fgF7JZNOefK8WcqhmFVoSLCVPWT90/ewGb aozA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b="ixb4/abe"; 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 z1si11276536edc.76.2021.03.22.02.00.28; Mon, 22 Mar 2021 02:00:51 -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=desiato.20200630 header.b="ixb4/abe"; 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 S229591AbhCVI7c (ORCPT + 99 others); Mon, 22 Mar 2021 04:59:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbhCVI7W (ORCPT ); Mon, 22 Mar 2021 04:59:22 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66254C061574 for ; Mon, 22 Mar 2021 01:59:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=gkJyH1ka82Nqgxz80lMFhKAEIXgYyo5mEmTvgPuh6PI=; b=ixb4/abe4TfMXQTJFEsCig074d CaAEl8FHq2w1iArMw3Ra3P8DuUPf8JjtK4NnXrSO77N2KeGN4JfX2Q/FViFy2smtdMtMm61bxCUxk OyzJLry08t+Q4Rldf9HRgGT2X1T3eGLlxW3snWhXUXFpHKio0QUKPpgVgB9R4cckx3aYM5ZDCwqBq Y4WiIrAzn1ZzIGZtpc4hpLx+0kSaSTDORivRbmTc29ySs+3u4epJhV7lMaNVrEFm9E6Z8wC8MNBde ixaFLBPMrjFzqP+GYsni28LZr0oXvG940+gTyS2H6xQ/GYW6rkxHPw7ugk+vD3pZrv8UZbroRQWeD CHZKGGgw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lOGNl-00BCx1-Fe; Mon, 22 Mar 2021 08:57:54 +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 5A274304BAE; Mon, 22 Mar 2021 09:57:51 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 42E232BA3A2F9; Mon, 22 Mar 2021 09:57:51 +0100 (CET) Date: Mon, 22 Mar 2021 09:57:51 +0100 From: Peter Zijlstra To: "Li, Aubrey" Cc: "Joel Fernandes (Google)" , 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, 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, rostedt@goodmis.org, benbjiang@tencent.com, Alexandre Chartre , James.Bottomley@hansenpartnership.com, OWeisse@umich.edu, Dhaval Giani , chris.hyser@oracle.com, Josh Don , Hao Luo , Tom Lendacky , Aubrey Li Subject: Re: [PATCH 1/6] sched: migration changes for core scheduling Message-ID: References: <20210319203253.3352417-1-joel@joelfernandes.org> <20210319203253.3352417-2-joel@joelfernandes.org> <20210320153457.GX4746@worktop.programming.kicks-ass.net> <28e13609-c526-c6ee-22a3-898652aed5e6@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 22, 2021 at 04:12:17PM +0800, Li, Aubrey wrote: > > But suppose there is an imbalance; then this cookie crud can forever > > stall balance. > > > > Imagine this cpu running a while(1); with a uniqie cookie on, then it > > will _never_ accept other tasks == BAD. > > > > How about putting the following check in sched_core_cookie_match()? > > + /* > + * Ignore cookie match if there is a big imbalance between the src rq > + * and dst rq. > + */ > + if ((src_rq->cfs.h_nr_running - rq->cfs.h_nr_running) > 1) > + return true; That's just tinkering... cookie matching should not also look at imbalance of any kind. > Do you have any suggestions before we drop it? Yeah, how about you make it part of task_hot() ? Have task_hot() refuse migration it the cookie doesn't match. task_hot() is a hint and will get ignored when appropriate.