Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp666360ybf; Wed, 26 Feb 2020 20:46:03 -0800 (PST) X-Google-Smtp-Source: APXvYqzRrrWNsaV8CNgMKzewlsJf9DUj8GWtOcU7q977o0IPv4BmYEQexZTmbWXBudjVDGsZaNsv X-Received: by 2002:a9d:6443:: with SMTP id m3mr1856997otl.20.1582778763074; Wed, 26 Feb 2020 20:46:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582778763; cv=none; d=google.com; s=arc-20160816; b=pKzl/ZmOqH7FdKw0KH5qc5UNinfU3aC4iASHBkgXTMzH17xzDuxYcblfPyPbW3m4mB 2W3zKzaq1eu3lxKojh45o4kRoyNwJZU9ulA+ZXdn5/Japi9x9rVwAq4HWG8L+lQMeXkO pufIvfZ4aTTlNetMniHE69n1zLnrRUZbXgrWgLWfcSvOZ93ZK9HOggR43Nkp+fMgFz/w 3ssBGOZrHP7NJOuPKnDqv7YlBs8BaiJKfF8fcAGw/pKmPovt8E+GICuGiQCMrBxIJqZv a5q0b38X0AOVwFOpe/7Pb4NcfEidU9pC1HlUkeLGsXMYyGZIERplJ1TpJDLzA5QkAomM QOUQ== 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=PiXJcLUpRVHcpB6LdyRFbmWgKnATo19wj7jDFJArUOs=; b=rDQG4xZaGhVwccScHWv9rF2tMty3Zh+iytTo+BCLcC9gqRzlZXkILrJhaYgSERArL8 SEt5lkODC6cXcJXmjy0KWVtmRkZ55HwbIS5TERzuXT0Ispw9l/OgeU7fQgOZh7BzDPHf wtduRNXYPqUl6lmAe5hs9R91aQ32GsZ61Uxp4YZFUX7xt+msOiK5fKuBg0s62+QMeK+J UyJaozUZ7AWsKVr1e9AMNe9JXi57BMI3/4omQBR5icy2mMaRsxy/kAQUEuXTpOpo/+vd PgfEIMCoTQJySm9Vc0HDY26iEXR/yneBvkgcNt2TQH07q2As3QtjxpayLSYv/v2SiR2x S5yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KJLPHS6s; 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 i124si688122oif.214.2020.02.26.20.45.51; Wed, 26 Feb 2020 20:46:03 -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=KJLPHS6s; 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 S1728424AbgB0Ep0 (ORCPT + 99 others); Wed, 26 Feb 2020 23:45:26 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:38056 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728284AbgB0EpZ (ORCPT ); Wed, 26 Feb 2020 23:45:25 -0500 Received: by mail-lj1-f196.google.com with SMTP id w1so1772921ljh.5 for ; Wed, 26 Feb 2020 20:45:24 -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=PiXJcLUpRVHcpB6LdyRFbmWgKnATo19wj7jDFJArUOs=; b=KJLPHS6sNiGExqsGhENMjlF7WNsf4pdO9oI2TUbXQjbGP2cuPkDXsFSGEgM12IK8dT fGBXeIDJPvTWtGi78u2GkTp/PVg+no6pJoYQ7qRkl67iYsAjSHTkIgryXCszvaZT4lZ+ g2+JRThSaEg/5ZOUuXeh6lCtLiqCXfOk4F3ftuJutmlmyJgqyxguCTZCBleoSKozBVz4 ToTXZBCgQtzkVOtpz19rrMCMLntzZaLKwxnMJ631srZW3SYV1yOTLiYqqlAEghFV4bah Z4hI1YEU3IEsdiQggvHzPOuvgx9HyMf60MP1wtyQaelfCPj/2Qo7qwBH1zupB+zhhZYM Fl2Q== 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=PiXJcLUpRVHcpB6LdyRFbmWgKnATo19wj7jDFJArUOs=; b=H9uYPxx6efCr7EdoCzlS5yJZjtReteNZHGpGajIUXxNSuCRgXR6kMRS9I+0kErkaQf ZAsKRFMhvXcTUBf6NobyQK6H1X6uzT3xWw9VJ36+ku72XeBJILVujctEZumTwenNwHTd eEpxIVcu5kBdX4cjZ/H3CypfIo0WTW484nPN5mBIqboJBOfDTlJocLqGcQUphOEsIHYl a6U8Hi1BZ9scmTYPd9HEtWF/c8tX5n/UTv3Bduic7TOE1HcWSVbUj+YrCUFhOObrJFz0 f9HSSz1pICBUsqoREZMA6mevVd6y8oklBlx0y4t/dEcxkTj/EO8GhIUS7vb0MpvAOiXK lyaQ== X-Gm-Message-State: ANhLgQ3Z1iwXkK2KCRWDcZT67/sbMkGlD57FukFPGH6ItPCDD62gdyyo iZOo+Nw4LzYNgGQ56/WZf9ubvSKkN6t7HS902D8= X-Received: by 2002:a2e:b6ce:: with SMTP id m14mr1401676ljo.99.1582778723339; Wed, 26 Feb 2020 20:45:23 -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: Thu, 27 Feb 2020 12:45:11 +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 Thu, Feb 27, 2020 at 5:54 AM Vineeth Remanan Pillai wrote: > > Hi Aubrey, >> >> >> 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? > > The idea behind this was: If a core is forced idle, then we have a > scenario where one task is running without a companion and one task > is forced to be idle. So if this source task is of the same cookie > as the forced idle task, then migrating this source task will offer a > chance for the force idle task to run together with task in subsequent > schedules. We don't have a framework to check the cookie of forced > idle tasks and hence this if block is only partial fix. To mitigate force idle, this helper is trying to prevent unmatched case, not catch the matched case. If the task's cookie is matched with forced idle cpu's sibling, it's able to pass the check later. Comparing to my original intention, this fix increases unmatched case as it returns immediately and we don't check cookie later. >> >> >> + 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? > > rq->curr being NULL can mean that the sibling is idle or forced idle. > In both the cases, I think it makes sense to migrate a task so that it can > compete with the other sibling for a chance to run. This function > can_migrate_task actually only says if this task is eligible and > later part of the code decides whether it is okay to migrate it > based on factors like load and util and capacity. So I think its > fine to declare the task as eligible if the dest core is running > idle. Does this thinking make sense? > The intention here is stopping migration not allowing migration. task_h_load(idle) is zero, but idle_task's sibling CPU is running a task with cookieA, the fix returns immediately when task_h_load(task cookieB) > 0, this puts another unmatched case in. > On our testing, it did not show much degradation in performance with > this change. I am reworking the fix by removing the check for > task_est_util. It doesn't seem to be valid to check for util to migrate > the task. I'm not sure the check for task_h_load is exactly wanted here either. From my understanding, the problem is because we stopped high weight task migration because its cookie does not match with the target's, can we check high load here instead of high weight? Thanks, -Aubrey