From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6385AECAAD5 for ; Mon, 12 Sep 2022 08:55:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C66D28D0002; Mon, 12 Sep 2022 04:55:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C16378D0001; Mon, 12 Sep 2022 04:55:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ADE008D0002; Mon, 12 Sep 2022 04:55:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 9C97F8D0001 for ; Mon, 12 Sep 2022 04:55:39 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 5E2E91C6356 for ; Mon, 12 Sep 2022 08:55:39 +0000 (UTC) X-FDA: 79902825198.22.39BFD49 Received: from r3-25.sinamail.sina.com.cn (r3-25.sinamail.sina.com.cn [202.108.3.25]) by imf18.hostedemail.com (Postfix) with ESMTP id 272ED1C008B for ; Mon, 12 Sep 2022 08:55:34 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([114.249.57.76]) by sina.com (172.16.97.23) with ESMTP id 631EF3BF0000937B; Mon, 12 Sep 2022 16:54:26 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 4205554919821 From: Hillf Danton To: K Prateek Nayak Cc: linux-kernel@vger.kernel.org, mgorman@techsingularity.net, peterz@infradead.org, linux-mm@kvack.org, vincent.guittot@linaro.org Subject: Re: [PATCH 5/5] sched/fair: Add exception for hints in load balancing path Date: Mon, 12 Sep 2022 16:55:20 +0800 Message-Id: <20220912085520.2775-1-hdanton@sina.com> In-Reply-To: References: <20220910105326.1797-1-kprateek.nayak@amd.com> <20220911080547.2709-1-hdanton@sina.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.25 as permitted sender) smtp.mailfrom=hdanton@sina.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662972939; a=rsa-sha256; cv=none; b=MEzPvgxgUBzAw6ejOsTWzDqcwZqmPVdMx6MuoIiJVeCXozO+8f/EXE08RY6hCT+7oRKPmP g2l5/i+aeGcEf50eE31Y5yavezBZtR1GVOsohoatcztLpsLe8b6L3Tp7F3TgHWebDoDjS1 T7H1pHUvuR7KU/VU/QL1YL+GzmI2oLo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662972939; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uYg915gZaMtdOIsyrUbnrMpWSPbdRbW+q+dDMERPwM8=; b=gpvDrtB/15RLc7K2yvHFz9DJZh9iQJXh7whNJJGE0gBrvsPPdQy0g4CLyPIhgxcB/BzhOu sOPEbtz/yUizttgufKsXs8gttrDfYcZCC3IuwMuNXtKu62xgbMGpFOWuETa2kARKFirilE pNJcTsGOMUM2QPdLcEgxGPWWX3pTUR8= Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of hdanton@sina.com designates 202.108.3.25 as permitted sender) smtp.mailfrom=hdanton@sina.com; dmarc=none X-Rspamd-Queue-Id: 272ED1C008B X-Stat-Signature: pba69jqykuq9bszqo1kjok7fmgc3uojd X-Rspam-User: X-Rspamd-Server: rspam02 X-HE-Tag: 1662972934-93679 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 12 Sep 2022 11:59:50 +0530 K Prateek Nayak wrote: > >> @@ -7977,6 +7980,21 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env) > >> return 0; > >> } > >> > >> + /* > >> + * Hints are followed only if the MC Domain is still ideal > >> + * for the task. > >> + */ > >> + if (!env->ignore_hint) { > >> + /* > >> + * Only consider the hints from the wakeup path to maintain > >> + * data locality. > >> + */ > >> + if (READ_ONCE(p->hint) & > >> + (PR_SCHED_HINT_WAKE_AFFINE | PR_SCHED_HINT_WAKE_HOLD)) > >> + return 0; > >> + } > > > > The wake hints are not honored during lb without PR_SCHED_HINT_IGNORE_LB set > > then the scheduler works as you hint. > > Are you suggesting we leave it to the user, to control whether the > load-balancer can spread the task apart, even if hints are set, > via another userspace hint "PR_SCHED_HINT_IGNORE_LB"? Yes, given we have room in kernel for both LB and wake hints. > > I had not considered it before but it may benefit some workloads. Like setting CPU affinity, scheduler works as user hints, but not responsible for any results, stupid or smart, because you are making the game simpler. And this is a good work. Hillf