Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1659882pxj; Fri, 18 Jun 2021 12:00:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQludsm4s29VRw+zR3zhZjMDmoowotLUDH7WUJQbchlxppQlFoFD2w3fDM9ES8QEEprXxH X-Received: by 2002:a05:6402:2791:: with SMTP id b17mr7091414ede.113.1624042824625; Fri, 18 Jun 2021 12:00:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624042824; cv=none; d=google.com; s=arc-20160816; b=Mtw5CFSHF0GpEZhal0tmJ8ZplCVgk0tbB/WrkZjRGMc2CDcaC1SVKUwzRrFgT5e4WS ZfOg5g2jIRzR40qQmslT6iCxKedKA/v1e1bGz/9HN2IlNGJZ61Z2czPpOYT2SBEOTrA4 SZ9RS9im9xztnSajmfRtaducec3kUQp6dDEnh2gSJaiaVuWSLvhfRnkZ+GG06MnzWHvS Ltj6s2nN2+dkJoAGbcM+AGX+86yJgm4bkw3QEBLIX3+GBpjYLiKquT8K2wXUVfPQ7W7a stwDI55shN5Bv5ud9ttahHzIxuCg6a4HS5G5e9nZyXewkQ/wQi+cIr04pF+QMx1BDYMT 4TxA== 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=c3fka3EAVM1AflK7NcLmHyzy+6rfLViw3l09VWANu58=; b=ErUeqsimDkPZqMnf5uzfSD6GLEALTa3/33k+Ya1br/5/3Ukc4riJgKVauXXGcVF9xp oCDZ8K9T2ABATM911SK5RCEqV4Gje6abL5j7cEV/aymTtfHJjRNJ2C8kZJKzmy1KKBqq 3lPqDO3L9oBVcqAVqDFS1VY3MUnaBU8Xqpty0zRolcxHUYFoaNRpEh5GvSBeVwVuf5z/ Cb2DyGGvPuxyaQR40gdpgJBngf+jsnIBmr2oCGv66nCJjQZlsuanpiNDR5j2J4d3Y//2 f5/b/BF77ejnLdBISh1wMqTRtXmQaRULNzA9Z39cj6RRqB6X1AoACiBmeqgEA3shfou2 eO6w== 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 10si3044544eji.282.2021.06.18.11.59.59; Fri, 18 Jun 2021 12:00:24 -0700 (PDT) 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 S235820AbhFRQQ5 (ORCPT + 99 others); Fri, 18 Jun 2021 12:16:57 -0400 Received: from mga01.intel.com ([192.55.52.88]:11556 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235572AbhFRQQx (ORCPT ); Fri, 18 Jun 2021 12:16:53 -0400 IronPort-SDR: G5igGP8NHH4zqzEUR4m6z+kAHV3PRbssP8k69h2lqTstNYv4O5Bdyt6FM2uqPzHLFQtMUy8hat GLi6kmT8GeoA== X-IronPort-AV: E=McAfee;i="6200,9189,10019"; a="228107989" X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="228107989" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2021 09:14:09 -0700 IronPort-SDR: grecWCbWLShL3k2D500boaEDGhZ/XvdIqKc1m8uoOBzd3fFDwJz8dyVlzGkOYCdlnc/jssRQGA 0ueJBctZGTqQ== X-IronPort-AV: E=Sophos;i="5.83,284,1616482800"; d="scan'208";a="640748206" Received: from salmansi-mobl1.amr.corp.intel.com (HELO schen9-mobl.amr.corp.intel.com) ([10.212.173.244]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jun 2021 09:14:08 -0700 Subject: Re: [PATCH] sched/fair: Rate limit calls to update_blocked_averages() for NOHZ To: Vincent Guittot Cc: Qais Yousef , Joel Fernandes , linux-kernel , Paul McKenney , Frederic Weisbecker , Dietmar Eggeman , Ben Segall , Daniel Bristot de Oliveira , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Steven Rostedt , "Uladzislau Rezki (Sony)" , Neeraj upadhyay , Aubrey Li References: <4aa674d9-db49-83d5-356f-a20f9e2a7935@linux.intel.com> <2d2294ce-f1d1-f827-754b-4541c1b43be8@linux.intel.com> <577b0aae-0111-97aa-0c99-c2a2fcfb5e2e@linux.intel.com> <20210512135955.suzvxxfilvwg33y2@e107158-lin.cambridge.arm.com> <729718fd-bd2c-2e0e-46f5-8027281e5821@linux.intel.com> From: Tim Chen Message-ID: <366aa93b-ecbf-ac0f-cd9e-3376b20d4929@linux.intel.com> Date: Fri, 18 Jun 2021 09:14:07 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: 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 6/18/21 3:28 AM, Vincent Guittot wrote: >> >> The current logic is when a CPU becomes idle, next_balance occur very >> shortly (usually in the next jiffie) as get_sd_balance_interval returns >> the next_balance in the next jiffie if the CPU is idle. However, in >> reality, I saw most CPUs are 95% busy on average for my workload and >> a task will wake up on an idle CPU shortly. So having frequent idle >> balancing towards shortly idle CPUs is counter productive and simply >> increase overhead and does not improve performance. > > Just to make sure that I understand your problem correctly: Your problem is: > - that we have an ilb happening on the idle CPU and consume cycle That's right. The cycles are consumed heavily in update_blocked_averages() when cgroup is enabled. > - or that the ilb will pull a task on an idle CPU on which a task will > shortly wakeup which ends to 2 tasks competing for the same CPU. > Because for the OLTP workload I'm looking at, we have tasks that sleep for a short while and wake again very shortly (i.e. the CPU actually is ~95% busy on average), pulling tasks to such a CPU is really not helpful to improve overall CPU utilization in the system. So my intuition is for such almost fully busy CPU, we should defer load balancing to it (see prototype patch 3). Tim