Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1272794pxu; Mon, 23 Nov 2020 16:41:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwL16w0R8guexORwuSxFrWJ5iF0sO/Vamoa11p4+Ezx39wsc1Xsldz4l6kip1GyAFjp5Cwq X-Received: by 2002:a17:906:9609:: with SMTP id s9mr1929733ejx.473.1606178484833; Mon, 23 Nov 2020 16:41:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606178484; cv=none; d=google.com; s=arc-20160816; b=VmFD+I2xDqOy6gmrUgH0LFVhRtnqkSUd7UneF6U2FV54ppuHUiUKPYq//C6m/wLjJ7 8bW7wORD08JOXqOOsQFMXfkxngt2fbRb1lMkRxi+v8zJnVvi9EwSKoRku33YNuPw4CG8 CAw15ah7GD7zn+Z/ffo4FewbPc29CmuW+P8c02MdGEjTRBdXQacZniXEAP1yL6p21TZe tYXTBze78d+82Ckvos+jv/5VU66pMG//6g8US9sK+NnI96c/p3ErxsHW/RSE3yLiGGaL eyrYFEXPPDt1jQrHPanyndf2mT3o5YktWZw9QivofpQY9X6e/SUrSsyvtzpQWGPCzEPr duPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=EqCdcY0NjJYGsiQJ8eTnyGd/Mw2TsG9juC2Rv9pve2o=; b=OzVjU6VPUoGG5c9jKF15z81s40AHNWIOUC/UIyD2L3F0Xd53KayWwwxEboWUl40BCd PspdSTlAI2dumBBeD2Gnyk3hwzWYRbxFWmiHi18XN7ZcNDsw3g7V3uZN5YBoIvxdG5SD O6HIL/6K6/UpAbGrbG6nh6+7e2YJ2lSWu0PzlH+Diz0uFMGTWV/0e5sqwUlOPuJu1dAS 8DGltJubu/TZktB6UwjXshXipin/+kSdNO8iMnfydxemjBhnSyJreUA3R+9tga1HdHxl xW2pfg0TGytDq1eh0y1LOYNjZ1bScHvkimSbvtZgGP9QbH92oNKr0wZeslZPvhn8oFO0 AFug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ew89d2b5; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si7439360ejb.73.2020.11.23.16.41.02; Mon, 23 Nov 2020 16:41:24 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ew89d2b5; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727013AbgKWXfQ (ORCPT + 99 others); Mon, 23 Nov 2020 18:35:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726934AbgKWXfP (ORCPT ); Mon, 23 Nov 2020 18:35:15 -0500 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD1F4C0613CF for ; Mon, 23 Nov 2020 15:35:13 -0800 (PST) Received: by mail-pg1-x544.google.com with SMTP id j19so15721064pgg.5 for ; Mon, 23 Nov 2020 15:35:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=EqCdcY0NjJYGsiQJ8eTnyGd/Mw2TsG9juC2Rv9pve2o=; b=ew89d2b5uePmAzmlDIwTELvqG17w7Iuqx1lCm3J9X1/izXZun8Y+EorDdHiYRafpU5 KG8hL9TjkBscWYCUhVVqdklnqEWP86o36mAd15I0GST1gsOjFtsYKi1n3O1afXbFqbb3 ydbEURqlMK6CTsYGFcYbHwc0RxzLn9rvEHNrzuZrIKRxfQ8yHx5DDvUMI6o4ciej4MBS lQISo+C9cUg1yzMorIkuVpdQu6BCO6P+S3kOrXzDn7qIxBU/bqiUhFH7j3IsA3MXxwHz BflK19SkMlbnYFpXNE6pzvlTMP5zzdArnO73TNh2MVgYsAIE5DL8iTUh3XAhEI04978Q zc0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=EqCdcY0NjJYGsiQJ8eTnyGd/Mw2TsG9juC2Rv9pve2o=; b=mDOwL/B/sXvVa/rlbk4A2kOn5BmuNk0b5qxAgVy8ZS6UbaDi4wPzbJDaEmoENHiMu8 puoU8WtpHpNLdS74et+UaSOziUUq7XCJ+HVCMGbzFDoroKHhGV3j02iAd6k07OZ07SDd TYXYaoGfUup6btuzlNHtEtZqR+i/AtZuDVhps8aK5NhyjnJBTu6BcZCEEVcCU8PT1gr7 05JF94IRCYm8WsKWkT+ntD7HEqblUoc16263cd5OuQTqHwIIl4hCsN0nRpVU5XJyxouJ aQp/UXRhzrvpMiCOGhqrY3fZYygl6VN1d9OwL6NzKwsMt2snIuxH3scxlKc0bMaptg7K 85Dg== X-Gm-Message-State: AOAM531QCu0CbEvqeW5niVlbR3kL+akeNqMI/e9QFgITAlrDWNx5rZ6Y NRlKjlqZk1UPJ9XUlNlVvUM= X-Received: by 2002:a63:485:: with SMTP id 127mr1401720pge.29.1606174513156; Mon, 23 Nov 2020 15:35:13 -0800 (PST) Received: from localhost (61-68-227-232.tpgi.com.au. [61.68.227.232]) by smtp.gmail.com with ESMTPSA id e8sm12853179pfj.157.2020.11.23.15.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 15:35:11 -0800 (PST) Date: Tue, 24 Nov 2020 10:35:08 +1100 From: Balbir Singh To: "Li, Aubrey" 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 Subject: Re: [PATCH -tip 13/32] sched: Trivial forced-newidle balancer Message-ID: <20201123233508.GC8893@balbir-desktop> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1de89fd3-fb5f-5aaa-8ea6-7a12d3307fa4@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?) Balbir Singh.