Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp911813pxu; Mon, 23 Nov 2020 07:11:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTGURNzaj0uKU8AgXsgdkYbMwQmvXIWOJ5L9B+ktkvGXaQggfuzIACCrOuOvLotOp/Y0zc X-Received: by 2002:a17:906:3413:: with SMTP id c19mr20346ejb.421.1606144297027; Mon, 23 Nov 2020 07:11:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606144297; cv=none; d=google.com; s=arc-20160816; b=PVc0a4c9qvjsJHk6V7eevPZ+iIrK8vDd05iT28wv8T4IF//fX+oluDJUWRJ96fC1N1 lczbPVrVUe3fx1yJ37UemZBxFn7qhlj5Nr4bL4FvL2f+u09aLJdFJhoz095CBFJ2UJun WJMeXlil7DXu028vyc5Cm2kpRSCHTihbEvyJwxq068irfT8JOItVZ8n58bxRRM2TJsVv clA3tpgOuNa2RQhC2Eo+1YY6R90iWYAb9+rosRk+Bcj0PuJ1hLEV+FpOArBmM1TntusO C2YFEfUSXwzMyDRtP6c1lum5EhQUNvml02J0lZ6wnI/+GsRUyqCVyeUCywQybPHs4ntI JAqA== 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=uaTBy7duACrZ01Cgd2pzr2aKYDY0MDqYD+X4UBp6BAA=; b=H8GjssDgSI5lOo+JRgZas0mgMMYPB5hIw8/w5uggiEYve39a/+fNfGKlbywtYoxrIp i5ZQBJvfN4cOM87Ve8VSDXTcWE0wE3TQSfX3YYw6nnKs33ot9/Diz3+uPU6jZ08gubRm U7h9qkwTX4PwzE8s17eLRuoTNm1KgLMru0M1axH5/qfRlklSHHNBGoQzvyV3SJ/QtZhV raGo80iVhZnr4y76ddKXkAecdKzl2MfuqtwFvwuAWKmiBWWJhWJCdRH7QkBrNF0mf83e PFHGF1suVb3k1j2LnhmxU6iky6ZtDjcMFmXW69KVD30V3Sx28kShE8P22it9QliAS1E0 KlXg== 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 u26si6857045edb.100.2020.11.23.07.11.12; Mon, 23 Nov 2020 07:11:37 -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 S1731940AbgKWPIP (ORCPT + 99 others); Mon, 23 Nov 2020 10:08:15 -0500 Received: from mga06.intel.com ([134.134.136.31]:26410 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727444AbgKWPIP (ORCPT ); Mon, 23 Nov 2020 10:08:15 -0500 IronPort-SDR: KNfySEUXrYAEO9bl1t7Z1gKXMVVz5OIG9IAtmzFGX2EaCkuxPdGdfDmr2NZymQDW7GvwXb9mis DxUPnTiM+UhA== X-IronPort-AV: E=McAfee;i="6000,8403,9813"; a="233392218" X-IronPort-AV: E=Sophos;i="5.78,363,1599548400"; d="scan'208";a="233392218" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2020 07:07:42 -0800 IronPort-SDR: cbpRnnDiGC+ADzV6wkpZf+wuU5o4eXn6jQfqQVU1c01mt3iP42dFZH+n7np7TMUlZWGG4q6b6U w2FnspVNoUhg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,363,1599548400"; d="scan'208";a="370063566" 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 07:07:27 -0800 Subject: Re: [PATCH -tip 13/32] sched: Trivial forced-newidle balancer To: Balbir Singh , "Joel Fernandes (Google)" Cc: 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> From: "Li, Aubrey" Message-ID: <1de89fd3-fb5f-5aaa-8ea6-7a12d3307fa4@linux.intel.com> Date: Mon, 23 Nov 2020 23:07:27 +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: <20201123043836.GG110669@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/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. Thanks, -Aubrey