Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1907019pxu; Tue, 24 Nov 2020 11:45:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwmZ41SiKjmJrfepvKE5tAoJ5hZ9bMHl+9sKvzTRH3HXHnyByzqy3AIHk1zV5X1LFwssCqm X-Received: by 2002:a50:9fc1:: with SMTP id c59mr75875edf.59.1606247123434; Tue, 24 Nov 2020 11:45:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606247123; cv=none; d=google.com; s=arc-20160816; b=HCUUerYpHiwwuiLP+J6S8/Oxj8VfirdeDqD77BUmfZ32UfLGexYS9cXcw23WHuxMZY XMn/hlyIokKVXemOXflPDOEjVU4PX+Dx1yqZmOywIRtz0D5itivjW8+zno0E486LJ0Ah Xiga6sf1Ebp55ZNrd9aLCjbZ7aLWbEKcqgnYOkjPuIR0hk74/gji8VkIjtBbUeRqjqlj 7wOZqBQVVnEmH/LmdFvrND33p/XF8mi8IiQGktIxUIxR2YgdlxNy6iWiq5vQDDiFwAHI dPol8zzZZIXOZ+2ANx7XMfngorFVQnkBdrRqH6H6zOh8/QaOwOLZMb4Ocht2m9bgWeh2 ggZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=1FxvpflQ3W3hziM/G79d9qyj50JCQlxrzOEMN21Jd+c=; b=pUMpBl940JK6GbvHqedWf3lNPlUZ8CAXLdcdB3rHXNP3RfzWq8hBy2Z/1kQ0XxhZDe KF9dDjHw6gLzWgGe3mQNTBmZnXkkNewMjg8owcrmoOmqqWBt0LfP8UJGJ/HHrQ8wdeO2 tsZ4drIQcBqMwwvytcekogdaOO1f9nmdeSwu5MuoVxlcsVBY2y6iu6b6FXThIxbxB5Hf qmhmfYYwyTsmX0YqfMCdyLq2Mq2DUaX3CoGunUvdYCbZHm/h83LYsINbK3xD6xgOdtu3 sx2G3/O6TBtJdN7Y9JqgZv/IVdFuidTOTG2y78TKO/5zE9EpUkopeCWnZkBRd8PTGY9F ZyTw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ah13si9016912ejc.416.2020.11.24.11.44.55; Tue, 24 Nov 2020 11:45:23 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730613AbgKXAcP (ORCPT + 99 others); Mon, 23 Nov 2020 19:32:15 -0500 Received: from mga11.intel.com ([192.55.52.93]:22890 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728654AbgKXAcO (ORCPT ); Mon, 23 Nov 2020 19:32:14 -0500 IronPort-SDR: 0VmygGDkd/fzXaTrPe90NrF91HRqyPrzyTJCaSRyfghZvYJpoUqCob32ZJZhcgGx8Fo+t9NkkH sQml2WGUGChA== X-IronPort-AV: E=McAfee;i="6000,8403,9814"; a="168358141" X-IronPort-AV: E=Sophos;i="5.78,364,1599548400"; d="scan'208";a="168358141" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2020 16:32:12 -0800 IronPort-SDR: aFDIjmEnv5l91rhGRODEcHOmW4Zjzq8UfIEWs3FEMGOjy3Alez342mKSMAv5nqf26VTO46T/Tp 9KR9a0eLpVFg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,364,1599548400"; d="scan'208";a="370232786" Received: from cli6-desk1.ccr.corp.intel.com (HELO [10.239.161.125]) ([10.239.161.125]) by FMSMGA003.fm.intel.com with ESMTP; 23 Nov 2020 16:32:02 -0800 Subject: Re: [PATCH -tip 13/32] sched: Trivial forced-newidle balancer To: Balbir Singh Cc: "Joel Fernandes (Google)" , Nishanth Aravamudan , Julien Desfossez , Peter Zijlstra , 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, Ben Segall , Josh Don , Hao Luo , Tom Lendacky , "Paul E . McKenney" , Tim Chen References: <20201117232003.3580179-1-joel@joelfernandes.org> <20201117232003.3580179-14-joel@joelfernandes.org> <20201123043836.GG110669@balbir-desktop> <1de89fd3-fb5f-5aaa-8ea6-7a12d3307fa4@linux.intel.com> <20201123233508.GC8893@balbir-desktop> From: "Li, Aubrey" Message-ID: <2277bfa9-7f67-6b66-b2db-a2130993de53@linux.intel.com> Date: Tue, 24 Nov 2020 08:32:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20201123233508.GC8893@balbir-desktop> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/11/24 7:35, Balbir Singh wrote: > On Mon, Nov 23, 2020 at 11:07:27PM +0800, Li, Aubrey wrote: >> On 2020/11/23 12:38, Balbir Singh wrote: >>> On Tue, Nov 17, 2020 at 06:19:43PM -0500, Joel Fernandes (Google) wrote: >>>> From: Peter Zijlstra >>>> >>>> When a sibling is forced-idle to match the core-cookie; search for >>>> matching tasks to fill the core. >>>> >>>> rcu_read_unlock() can incur an infrequent deadlock in >>>> sched_core_balance(). Fix this by using the RCU-sched flavor instead. >>>> >>> ... >>>> + >>>> + if (p->core_occupation > dst->idle->core_occupation) >>>> + goto next; >>>> + >>> >>> I am unable to understand this check, a comment or clarification in the >>> changelog will help. I presume we are looking at either one or two cpus >>> to define the core_occupation and we expect to match it against the >>> destination CPU. >> >> IIUC, this check prevents a task from keeping jumping among the cores forever. >> >> For example, on a SMT2 platform: >> - core0 runs taskA and taskB, core_occupation is 2 >> - core1 runs taskC, core_occupation is 1 >> >> Without this check, taskB could ping-pong between core0 and core1 by core load >> balance. > > But the comparison is p->core_occuption (as in tasks core occuptation, > not sure what that means, can a task have a core_occupation of > 1?) > p->core_occupation is assigned to the core occupation in the last pick_next_task. (so yes, it can have a > 1 core_occupation). Thanks, -Aubrey