Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4587021ybv; Tue, 25 Feb 2020 23:22:29 -0800 (PST) X-Google-Smtp-Source: APXvYqzhjybn/Ku2j0fbaDutCgIaMStN26LOCapDySZYvT3TShnWYehAgiw05w++b9YwHclvbqpX X-Received: by 2002:a05:6808:4c7:: with SMTP id a7mr2052447oie.83.1582701749129; Tue, 25 Feb 2020 23:22:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582701749; cv=none; d=google.com; s=arc-20160816; b=lJRctxhTzM9606OYb8aW1YsTl0iGOFyjeutTnf2rnq1XRFzhYKXc30cCKZxaDh3B94 h8KonK4bV1NlH+Qey2qd47/lGQ+cpjhPgcHSiVPoWShNkpPDOD0qaaxfJEL4eKuGLTYW BLa9j6PRmVT3LIXAg/J3YHubgDuimHfKYtuOCVUOvK96Gx4IlO1jtn45MXxiWhtUdonI GjKtftl4cp/5gBBLHzE+o/4k5co9+R87ffiJCgdmYg5EDIV3IqmEh3n2/6Nx1nfQNl3x TALAMg9rilKkvk4QDAI1EA0TMBnrHGt4G4AFaq2Fbcn+DgTQIe7/3VIsAzyIy95yRQCh qgTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=0M6EtJg4ZSjY6Oxjrmkg1KX+Te8MK2AsJq370rGDenk=; b=fFrh3utiDJkJkzfB7vtNRvH53wd+2ZLspvDYhwQ/mRcsqwVCPXti52aQ0aRWvohaN/ Bt5GGUXHhvzrSD6uxu0iCbVoc0Mz3WCMVF+OrW08FKktv5JF+k0P0+lRSdM6lcvva14t ppo6i4iYOxjGIqUlBN+CWw5LLlIihYtVId+htFHTKME82YB7UWZn1/cT0er1AZo3rHCB iNtu3DJ3L8P+2NWRqhVaCQPd8z7buLihUn7T4/qkRGna6Fyqhf4yhDnjAcenItDWDLap ekVE9STnEVOxbYyXPfBb0TfsNfKBe0bEdQcT1eqnameQvDc30nS8aaHzPQudA9FQfj49 IxBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ov82jrDa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h203si683793oif.3.2020.02.25.23.22.16; Tue, 25 Feb 2020 23:22:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ov82jrDa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727140AbgBZHWH (ORCPT + 99 others); Wed, 26 Feb 2020 02:22:07 -0500 Received: from mail-lj1-f195.google.com ([209.85.208.195]:45381 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726823AbgBZHWH (ORCPT ); Wed, 26 Feb 2020 02:22:07 -0500 Received: by mail-lj1-f195.google.com with SMTP id e18so1794214ljn.12 for ; Tue, 25 Feb 2020 23:22:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0M6EtJg4ZSjY6Oxjrmkg1KX+Te8MK2AsJq370rGDenk=; b=Ov82jrDatD8bWboohqMvsOAhZba+htl2ve7n0JeExu/+R09MMPxYS8aCRiX8VMo2HH 1DaJDem20tq/u8lJmwbugF+0esSVoiVlaw+Sl481MfG4YVZo3DmdRQ/LvY43wAqAoaLQ 0FfVCi8a3XiAfJHgLv2TKiuv3kzoWwyZ3l4UgbXX71u7Y6J2uaPJS6gpVMXNTeRavdu8 y2cjQBVVsePfXE/TUVFTxPBoN0tiaQcveksMQ3bf6Y8WXkMCG6+EVIl96fNrkJxReWg0 TL0wbMgW0DZVh/pbs3FktPSDEHYqScVQONLxzLvvhrtsbpxKlt1UlmGIY8vnuVdmWUeW Rc7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0M6EtJg4ZSjY6Oxjrmkg1KX+Te8MK2AsJq370rGDenk=; b=PwtKvKuaP8+QiNZW0WsfYqFhyryOtfh7eNh+SEQVqomMjEQVHv0KIZwOOFkLxXjq4M I6LeoxM9/A/WuU7Ns2apGTnBKeuThuDL1XuMVGcs3xS6lyJD4LVanzpS6V0DqfCOYtOw TeOgTXwM6S88g9KUKe4dNjn0eDtNLyGdQhOjRnxur4QhCrCnHSIgtyyqdD0LetTku8gS A5CHv8u84eOFRttM3yd1H+ROphgrRgK4/iDMEaZS5NhqgA11TrIyFHL8q0I5AGx85IZc IsZx8y+gESKkAVI2UONl7RSHide4gTHEgd7lPu8tsBOuBeG/ZDknqHoJ78jUlpMjUfPH +o3Q== X-Gm-Message-State: APjAAAVHsu94dSrHDDd0JvdrFjxoLnAzUplkIaruHwcWus0ICId3+fn+ cW5uNBtflKfkDeU73yLDwHYRSwKhtx4OqVnqDss= X-Received: by 2002:a2e:9d89:: with SMTP id c9mr2039039ljj.212.1582701724994; Tue, 25 Feb 2020 23:22:04 -0800 (PST) MIME-Version: 1.0 References: <5e3cea14-28d1-bf1e-cabe-fb5b48fdeadc@linux.intel.com> <3c3c56c1-b8dc-652c-535e-74f6dcf45560@linux.intel.com> <20200212230705.GA25315@sinkpad> <29d43466-1e18-6b42-d4d0-20ccde20ff07@linux.intel.com> <20200225034438.GA617271@ziqianlu-desktop.localdomain> In-Reply-To: From: Aubrey Li Date: Wed, 26 Feb 2020 15:21:53 +0800 Message-ID: Subject: Re: [RFC PATCH v4 00/19] Core scheduling v4 To: Vineeth Remanan Pillai Cc: Aaron Lu , Tim Chen , Julien Desfossez , Nishanth Aravamudan , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Paul Turner , Linus Torvalds , Linux List Kernel Mailing , Dario Faggioli , =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , Kees Cook , Greg Kerr , Phil Auld , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 26, 2020 at 4:51 AM Vineeth Remanan Pillai wrote: > > I have a quick patch > which might fix this. The idea is that, we allow migration if p's > hierarchical load or estimated utilization is more than dest_rq->curr. > While thinking about this fix, I noticed that we are not holding the > dest_rq lock for any of the migration patches. Migration patches would > probably need a rework. Attaching my patch down, but it also does not > take the dest_rq lock. I have also added a case of dest_core being > forced_idle. I think that would be an opportunity to migrate. Ideally > we should check if the forced idle task has the same cookie as p. > > https://gist.github.com/vineethrp/887743608f42a6ce96bf7847b5b119ae > Hi Vineeth, Thanks for the quick fix. I guess this patch should work for Aaron's case because it almost removed the cookie checking here. Some comments below: + if (rq->core->core_forceidle) + return true; We check cookie match during load balance to avoid two different cookie tasks on the same core. If one cpu is forced idle, its sibling should be running a non-idle task, not sure why we can return true directly here. And if we need to check cookie, with this forced idle case, why it's special to be picked up? + if (task_h_load(p) > task_h_load(rq->curr)) + return true; + if (task_util_est(p) > task_util_est(rq->curr)) + return true; These two need to exclude rq->curr == rq->idle case? otherwise idle balance always return true? Thanks, -Aubrey