Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2014940ybe; Sat, 7 Sep 2019 07:17:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqy23Ptaemsnr0ir8wek/wbLfO1Uck/lWVIYqLTY6qt/d/C0OrEftLQ5VWQh/Q0HDZbLZkJP X-Received: by 2002:a17:90a:7f01:: with SMTP id k1mr14843865pjl.84.1567865871341; Sat, 07 Sep 2019 07:17:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567865871; cv=none; d=google.com; s=arc-20160816; b=HK1bIxfBqRFXVQkTJkeSWDeMdcF1w3TXzHQpgDGCqYXGv3R3AU+1TwUOpBO2UIzXsm giOyrbRs9yGMTvEyUfGpMTvLF+TPf8opYjRHr5aIYlbygycCfK/8yROtOLWkx4p7etiy rvA2u5XU4CZpSj4VQpPPpY8myNzAxFfzRQ5eNAIuG6Pz0Lrzr4Q+BRS4BePz7SaDvOFM PMZCbYgBGhdB0ijxuQrhmF2lUMKVAg4Gu3c7qxldWl0mFgQRBieIQqMBxeodC8bJrm5P wXyWOgoAq6s/wYtk4uUQyTTMr4+CCC7Uzgn+gV8ii8g5vB+ceo6aF9wtnxtxLVi3kzRZ VRWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject; bh=mm9x71kC9khlIr6YErS7dPnb7J/rRB28GjUxKCRN6h8=; b=e/oj0ZeWe4+LXAARgBkw7/IpXZhOT7M9Yiv+Ev/z9SfWyCsKMRYm3jecrVWaoeOynL XXdgKvEsvNqUdu0WaD8VjUB1EHO2Kuflx7kP/YJ08/6TcIaWOhRP+T8yGX/T9uGQ12Iw IvI2QBsKm5FzSNOl9j4XgxZhMBUxvDkLGc+d0hL7SNlKnKreJ72gYaW8FE5TxLwKa/+h WsitbNgZj2cl5lcV9yFMC1PK1H0v9f3lJCVuL0du4dmgTijckBAU1+Fr2nF2tUJwC9xT bYNX+6dL51XofR4HpaEW9TRGElTRt2nX7rvI5K2732AxZfy/F/NpivSIBCcnOvlEhAmI enGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si6910525pgq.355.2019.09.07.07.17.24; Sat, 07 Sep 2019 07:17:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394878AbfIFRKX (ORCPT + 99 others); Fri, 6 Sep 2019 13:10:23 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:37790 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733096AbfIFRKW (ORCPT ); Fri, 6 Sep 2019 13:10:22 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x86H7DMK074642 for ; Fri, 6 Sep 2019 13:10:21 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uusdmdy48-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 06 Sep 2019 13:10:20 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 6 Sep 2019 18:10:18 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 6 Sep 2019 18:10:13 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x86HACop42008614 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 6 Sep 2019 17:10:12 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7642811C04A; Fri, 6 Sep 2019 17:10:12 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6F88311C064; Fri, 6 Sep 2019 17:10:08 +0000 (GMT) Received: from localhost.localdomain (unknown [9.102.0.23]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 6 Sep 2019 17:10:08 +0000 (GMT) Subject: Re: [RFC PATCH 1/9] sched,cgroup: Add interface for latency-nice To: Valentin Schneider , Patrick Bellasi Cc: Peter Zijlstra , Subhra Mazumdar , linux-kernel@vger.kernel.org, mingo@redhat.com, tglx@linutronix.de, steven.sistare@oracle.com, dhaval.giani@oracle.com, daniel.lezcano@linaro.org, vincent.guittot@linaro.org, viresh.kumar@linaro.org, tim.c.chen@linux.intel.com, mgorman@techsingularity.net References: <20190830174944.21741-1-subhra.mazumdar@oracle.com> <20190830174944.21741-2-subhra.mazumdar@oracle.com> <20190905083127.GA2332@hirez.programming.kicks-ass.net> <87r24v2i14.fsf@arm.com> <20190905104616.GD2332@hirez.programming.kicks-ass.net> <87imq72dpc.fsf@arm.com> <87d0ge3n85.fsf@arm.com> <3bb17e15-5492-b78c-20a8-5989519f20e2@linux.ibm.com> <75e782c7-121d-a0ea-7fbf-efb0c83f50e6@arm.com> From: Parth Shah Date: Fri, 6 Sep 2019 22:40:07 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <75e782c7-121d-a0ea-7fbf-efb0c83f50e6@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19090617-0008-0000-0000-00000311F001 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19090617-0009-0000-0000-00004A304E1F Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-06_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909060182 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/6/19 7:43 PM, Valentin Schneider wrote: > On 06/09/2019 13:45, Parth Shah wrote:> >> I guess there is some usecase in case of thermal throttling. >> If a task is heating up the core then in ideal scenarios POWER systems throttle >> down to rated frequency. >> In such case, if the task is latency sensitive (min latency nice), we can move the >> task around the chip to heat up the chip uniformly allowing me to gain more performance >> with sustained higher frequency. >> With this, we will require the help from active load balancer and latency-nice >> classification on per task and/or group basis. >> >> Hopefully, this might be useful for other arch as well, right? >> > > Most of the functionality is already there, we're only really missing thermal > pressure awareness. There was [1] but it seems to have died. > > > At least with CFS load balancing, if thermal throttling is correctly > reflected as a CPU capacity reduction you will tend to move things away from > that CPU, since load is balanced over capacities. > Right, CPU capacity can solve the problem of indicating the thermal throttle to the scheduler. AFAIU, the patchset from Thara changes CPU capacity to reflect Thermal headroom of the CPU. This is a nice mitigation but, 1. Sometimes a single task is responsible for the Thermal heatup of the core, reducing the CPU capacity of all the CPUs in the core is not optimal when just moving such single task to other core can allow us to remain within thermal headroom. This is important for the servers especially where there are upto 8 threads. 2. Given the implementation in the patches and its integration with EAS, it seems difficult to adapt to servers, where CPU capacity itself is in doubt. https://lkml.org/lkml/2019/5/15/1402 > > For active balance, we actually already have a condition that moves a task > to a less capacity-pressured CPU (although it is somewhat specific). So if > thermal pressure follows that task (e.g. it's doing tons of vector/float), > it will be rotated around. Agree. But this should break in certain conditions like when we have multiple tasks in a core with almost equal utilization among which one is just doing vector operations. LB can pick and move any task with equal probability if the capacity is reduced here. > > However there should be a point made on latency vs throughput. If you > care about latency you probably do not want to active balance your task. If Can you please elaborate on why not to consider active balance for latency sensitive tasks? Because, sometimes finding a thermally cool core is beneficial when Turbo frequency range is around 20% above rated ones. > you care about throughput, it should be specified in some way (util-clamp > says hello!). > yes I do care for latency and throughput both. :-) but I'm wondering how uclamp can solve the problem for throughput. If I make the thermally hot tasks to appear bigger than other tasks then reducing CPU capacity can allow such tasks to move around the chip. But this will require the utilization value to be relatively large compared to the other tasks in the core. Or other task's uclamp.max can be lowered to make such task rotate. If I got it right, then this will be a difficult UCLAMP usecase from user perspective, right? I feel like I'm missing something here. > It sort of feels like you'd want an extension of misfit migration (salesman > hat goes on from here) - misfit moves tasks that are CPU bound (IOW their > util is >= 80% of the CPU capacity) to CPUs of higher capacity. It's only > enabled for systems with asymmetric capacities, but could be enabled globally > for "dynamically-created asymmetric capacities" (IOW RT/IRQ/thermal pressure > on SMP systems).> On top of that, if we make misfit consider e.g. uclamp.min (I don't think > that's already the case), then you have your throughput knob to have *some* > designated tasks move away from (thermal & else) pressure. > > > [1]: https://lore.kernel.org/lkml/1555443521-579-1-git-send-email-thara.gopinath@linaro.org/ > Thanks, Parth