Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp135781pxu; Wed, 25 Nov 2020 15:26:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVHT8IFXpF+xGob0Epw2vTFae0WbDl7XgYl745YYqYQ7/9z/8TVR/WgNnoOb/bhrfHh+Lf X-Received: by 2002:aa7:d407:: with SMTP id z7mr55610edq.234.1606346811687; Wed, 25 Nov 2020 15:26:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606346811; cv=none; d=google.com; s=arc-20160816; b=N87MO2IR8IuZYxrP9uBjlyRAfKsQ3KfhSgBrneaDe9Emte0XGNFHlk6WZl+QavaROk +Qj+QhDQyee8AXCPPfdQAN3pf5iizuJi8r4qB6j1N+uvGYLI5hZp4XlbJkHRIiz4yu3O 8ZjTpXyDGM1Db6F6hzN5JAQYYHO56f5CXGg1QuFmkrDYSVEQTBVstV5yBGcfPvc4gQEf C0uPLuDImZ1EDFC7yoJTYi1gz3aronOS90finRUOvDn1xgEPMhBZgsFbhSJvWxJt72Rn N+5mdqsLzt2z5nRlgWswXPDOD3ec9EeoKc+MhiFizkvXrWlSoX3OAaNT6PAxrCPH0SF6 3cMg== 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=TEKekla+RKDZzxcpwcoco3ZCfku7RtHZxgTQ+E5cu/c=; b=krvsFL1VYgu9kXG6kb561aXzylYVuAMxp5UgO3n2oE7p3HSsGAYpcSCT1RKt04QvgE P/QIFtCTZuvnb3C3dX9cMR8ekx6kbflkxaW9sVadFfKOkMyZ553H+Ya5E7+8S+KrT9TG gqwN+JIBIn/GGILF5ZRPsPlgSl9Qcl7zYXv8KOEe/UPCYvoqtApjeahj5K80E2LiX9I8 Bez7Ibvc2JbXG0Zdaf5B/GXtOCZ7ztX2YllxmmvxSdMnvUiRW1NoW/p1AkxBdKKUR4qO qWPZweoPNcxFI4NYcR2VLnpMmLDqRm7oJYuuaMaQi2iz+76LCvnkLOJXH5Nit6+qqNa/ TmIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ExcUbg65; 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 d19si2043209edx.252.2020.11.25.15.26.29; Wed, 25 Nov 2020 15:26:51 -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=ExcUbg65; 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 S1732144AbgKYV2e (ORCPT + 99 others); Wed, 25 Nov 2020 16:28:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732060AbgKYV2e (ORCPT ); Wed, 25 Nov 2020 16:28:34 -0500 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21933C0613D4 for ; Wed, 25 Nov 2020 13:28:34 -0800 (PST) Received: by mail-pg1-x542.google.com with SMTP id k11so879130pgq.2 for ; Wed, 25 Nov 2020 13:28:34 -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=TEKekla+RKDZzxcpwcoco3ZCfku7RtHZxgTQ+E5cu/c=; b=ExcUbg65EY3y8gWSVHVqTaSz+Lpco8rTUp4reA9wkWRgUfxeEoqfhUp+yFfSlI27pj wV6DdK9Fk1cwLcPh6G/FtigrtG/fYlWEvkXxCxsWvuoHIhRculNe4WrEtfsQZzSvIKfB Ee27Qlf73/iJd7Qpl8o8wR3ME4YPsTHwZEY4w2zTpSDz4U0pSM8rUiNm2XHp3vH40bv2 s1sI948fDe1bELAFTeTrgQ8mhR65eWc8J7Mux4b9IvGgRBl2olx5NLJRz4jL+VvAaPx+ E+eal8O9Hh7L6earr9Mdf3u3oX5QTaVdCBTaJmRDjn8SF1pEFF6sNKzYUkSJ/V3W1YpQ gaoQ== 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=TEKekla+RKDZzxcpwcoco3ZCfku7RtHZxgTQ+E5cu/c=; b=H+oKQ/mkoY8fS0jOpsLKJGCXGFchld1tcfjsslHcXAYOwdnWQ+4m3ufN5r5g++8HSI JhfPRX0IwTr6V79mEwcqVMhuyTjItSWogZ/opKbSUuWSp6geXXI7EQQEu/XViMv3FJcq U2vueExpq7rarNRbD5SQnFJlBEw5qkijigJDk9Ipk0RNWLTQzYeGwPLGQ93X8ieq9g9O LSguPjy5oadKH6x0v3Tc4LAqyTbmkdkw+3pyHxJHt4HnvnTisIOj4TPXZHFHun2E+0I5 NwjfqKTyUrd5p8kaqZ87WWb72ZZiGYfrWWg72SWi+9YVDpiFCy86zAMrYh0hi+4peQuJ 2nwA== X-Gm-Message-State: AOAM533BFsMYf4YqifUzbmmGMDcpLaTpQj9nlDKM4y1mkvgjfF8kwhvS g5Zj+hO8lubqLPNShhgwRDY= X-Received: by 2002:a63:5322:: with SMTP id h34mr4431634pgb.95.1606339713513; Wed, 25 Nov 2020 13:28:33 -0800 (PST) Received: from localhost (61-68-227-232.tpgi.com.au. [61.68.227.232]) by smtp.gmail.com with ESMTPSA id s5sm2860628pgc.15.2020.11.25.13.28.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2020 13:28:31 -0800 (PST) Date: Thu, 26 Nov 2020 08:28:28 +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: <20201125212828.GA163610@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> <20201123233508.GC8893@balbir-desktop> <2277bfa9-7f67-6b66-b2db-a2130993de53@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2277bfa9-7f67-6b66-b2db-a2130993de53@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 24, 2020 at 08:32:01AM +0800, Li, Aubrey wrote: > 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). > Hmm.. I find that hard to interpret that. But I am happy to re-read the code again. Balbir Singh.