Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1066150imm; Wed, 10 Oct 2018 08:38:00 -0700 (PDT) X-Google-Smtp-Source: ACcGV617k05G0eSz5wZioMbBmNO7HMf0laCnx1dwLQUq9p8bxltGWh4eLkns6RotkZYH+22nYA8R X-Received: by 2002:a17:902:4a0c:: with SMTP id w12-v6mr32976881pld.289.1539185880082; Wed, 10 Oct 2018 08:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539185880; cv=none; d=google.com; s=arc-20160816; b=eileEPebHtWdc7K3MV1nXsF4xbL04spu5hSg+dRTZAg+F6U4NPIae1ZM0POAQwvgus GqWIoeJqAe3Zp8SKSYcD0NjgqkTOGO/JgFL+A/Gc15EKbRSvo9MnJZp1nv/EfUAKtap3 GUULk5P0IhmiYHX6ykzUiZf30XhqcSRRrYegHG20oikCPGtq6Ns+b5jG44pXi4nrTOWC erz7zWvLIo13G9Xm5JeehDySkYIM9QxkD7DC0Vs3TFJ9byxdzwbJWhZJS+C7okKuApqp 2zeb2BRU4PMa9zfcqcoawSE+ujtA36wxNnWm0WRM6nHgEihIEBGmnu4aSo6P5tc3Z4GU dO9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:from:cc:to:subject:dkim-signature:dkim-filter; bh=LF8CHup0hwN6e3zMjLhGQk2IAJe9bp3KBHoPDx7uFUQ=; b=U+yNbRy5z4zVkUQ+2nRIBMeTAkZwT8lSrZFcX6Rrk2+V+uHqTcwY6AyBExwUGKpXyz h5r2SifenfTJszABl75gO7Hio7Pa+egDNFVaVgcbllQLhk+dZITZrCaiQVWaFrH2ukkn qGflcvop9qJ0WnIj4DPxkz9fV4nbvF62Wm8D0IoWxm8irUZ7AHf9cB5bx26U6nl40IBi 3TL9jAsxdCxjE0mCdkzJGKn3YOKiKy0/ngyoEObt65YUH33xk/NI6UltZAfy1n7jZ/Nd 12sGdtjBfX7FBkDYj1GtJz1sP0G3FhcRielqN4tosNg1svJOPEl/WTa3C4WXzmQhuqtr tfrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=uTZMgcAp; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w24-v6si24318115plp.110.2018.10.10.08.37.44; Wed, 10 Oct 2018 08:38:00 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=uTZMgcAp; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726871AbeJJW6k (ORCPT + 99 others); Wed, 10 Oct 2018 18:58:40 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:50186 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726479AbeJJW6j (ORCPT ); Wed, 10 Oct 2018 18:58:39 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181010153555euoutp029d3b7c8311ad78fb5fa34775e91d7c73~cSUopzf7r1574615746euoutp02b for ; Wed, 10 Oct 2018 15:35:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181010153555euoutp029d3b7c8311ad78fb5fa34775e91d7c73~cSUopzf7r1574615746euoutp02b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539185755; bh=LF8CHup0hwN6e3zMjLhGQk2IAJe9bp3KBHoPDx7uFUQ=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=uTZMgcApcZKDKNRZlC4q9Og8Yy+OukHQywXA7aZkocyGqZTpEGinyHixsVDTEVfto dBl4anWtzJIJuNB/f3RX6AJOb/+blUqKCNe4V73cSMYhPiwdBa0cFx77puCRbvxki2 hhzct2UYlkL3XVOFuynV1b2l51D6JckwcHA9MwH4= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181010153554eucas1p1eaf7b82c7459eff49b98774638dd2bce~cSUnZtcAJ2965129651eucas1p12; Wed, 10 Oct 2018 15:35:54 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id FF.67.04806.95C1EBB5; Wed, 10 Oct 2018 16:35:53 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20181010153553eucas1p1b8f74f4aa45751ef029805fd118affc1~cSUmU58-F2963929639eucas1p1L; Wed, 10 Oct 2018 15:35:53 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20181010153552eusmtrp1fb70c9dc8cef3422aaa7ff09a8f9ae91~cSUmDjIlE3183731837eusmtrp1x; Wed, 10 Oct 2018 15:35:52 +0000 (GMT) X-AuditID: cbfec7f5-367ff700000012c6-8a-5bbe1c59b201 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 15.37.04128.85C1EBB5; Wed, 10 Oct 2018 16:35:52 +0100 (BST) Received: from [106.120.51.20] (unknown [106.120.51.20]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20181010153551eusmtip177f92fefbe1a2894fee0c807f76e4ecf~cSUlVhZRy2708527085eusmtip1b; Wed, 10 Oct 2018 15:35:51 +0000 (GMT) Subject: Re: [RFC PATCH 0/7] Introduce thermal pressure To: Thara Gopinath , linux-kernel@vger.kernel.org Cc: mingo@redhat.com, peterz@infradead.org, rui.zhang@intel.com, gregkh@linuxfoundation.org, rafael@kernel.org, amit.kachhap@gmail.com, viresh.kumar@linaro.org, javi.merino@kernel.org, edubezval@gmail.com, daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, quentin.perret@arm.com, ionela.voinescu@arm.com, vincent.guittot@linaro.org, Bartlomiej Zolnierkiewicz From: Lukasz Luba Date: Wed, 10 Oct 2018 17:35:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1539102302-9057-1-git-send-email-thara.gopinath@linaro.org> Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA01Sf0yMYRz3vO97773dHM9d0VeJ7SoTqxjm2Zj5ub3GzD9+dRsdva7mOrm3 IvMHRdLUjKLulKzReZXbndRJirRatawfNCmGRauUzRUyQ9eb6b/P9/PjeT7fPQ9Ha78oArg4 c6JgMRtMOlbFVDSMPw/fN79Gv+xX6irycyRfSZx5DgUp9ASRGy+6FCSt2MGS3KdZFPktFbCk s+o6SzxZ9Yh0PCmiSGPWE4p8dDkYUjCaS5O+99ksacvNp0lG/TeaOMf49Rq+tLAU8Q+tb5T8 ffsSvrh6gOJd0gWW7+2qZvnaglIl/6XmJctnl0uI97gW7FRFqdbGCKa4ZMESuS5aFVv1/TOV 8DjoRMPXSsVpZJubiXw4wCuhZLBBkYlUnBbbEYzmNCi9ghaPIuj6GSoLHgS16RXoX6KzeEQp CyUI/rx9ieRhGMHnuxLldfni1dD8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fruWuYuRg4NNQE9ix6pCEJNXwE3iW3cxiMkioCqxoskbZIyo QITE6uUvWEFsXgFBiZMzn7CAlHAKeEqsW1kJEmYWMJOYt/khM4QtLnHryXwmCFteYvvbOcwT GIVmIemehaRlFpKWWUhaFjCyrGIUSS0tzk3PLTbSK07MLS7NS9dLzs/dxAiM/m3Hfm7Zwdj1 LvgQowAHoxIP7w+pfdFCrIllxZW5hxglOJiVRHgZBIBCvCmJlVWpRfnxRaU5qcWHGE2BXpvI LCWanA9MTHkl8YamhuYWlobmxubGZhZK4rznDSqjhATSE0tSs1NTC1KLYPqYODilGhjD2k8E mDAY7tq6tkPpSuH7A5N1JnzmPr9c+YVJ4fuppd//KPb52hzWXfBw40mbSzZWbJeTrcN+54lt cV/49uzzlTWZxicThCe+/VR4mne3yMykPyEP9t4/+ID/irW8Q+tbj4eWdZGvL35mV/51RMvh rgdjJpfk+pO+oYZKEYo77xV53mHdzPtMiaU4I9FQi7moOBEASHAiJRQDAAA= Message-Id: <20181010153553eucas1p1b8f74f4aa45751ef029805fd118affc1~cSUmU58-F2963929639eucas1p1L@eucas1p1.samsung.com> X-CMS-MailID: 20181010153553eucas1p1b8f74f4aa45751ef029805fd118affc1 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181009162509epcas1p4fdd2e23039caa24586a4a52c6d2e7336 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181009162509epcas1p4fdd2e23039caa24586a4a52c6d2e7336 References: <1539102302-9057-1-git-send-email-thara.gopinath@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thara, I have run it on Exynos5433 mainline. When it is enabled with step_wise thermal governor, some of my tests are showing ~30-50% regression (i.e. hackbench), dhrystone ~10%. Could you tell me which thermal governor was used in your case? Please also share the name of that benchmark, i will give it a try. Is it single threaded compute-intensive? Regards, Lukasz On 10/09/2018 06:24 PM, Thara Gopinath wrote: > Thermal governors can respond to an overheat event for a cpu by > capping the cpu's maximum possible frequency. This in turn > means that the maximum available compute capacity of the > cpu is restricted. But today in linux kernel, in event of maximum > frequency capping of a cpu, the maximum available compute > capacity of the cpu is not adjusted at all. In other words, scheduler > is unware maximum cpu capacity restrictions placed due to thermal > activity. This patch series attempts to address this issue. > The benefits identified are better task placement among available > cpus in event of overheating which in turn leads to better > performance numbers. > > The delta between the maximum possible capacity of a cpu and > maximum available capacity of a cpu due to thermal event can > be considered as thermal pressure. Instantaneous thermal pressure > is hard to record and can sometime be erroneous as there can be mismatch > between the actual capping of capacity and scheduler recording it. > Thus solution is to have a weighted average per cpu value for thermal > pressure over time. The weight reflects the amount of time the cpu has > spent at a capped maximum frequency. To accumulate, average and > appropriately decay thermal pressure, this patch series uses pelt > signals and reuses the available framework that does a similar > bookkeeping of rt/dl task utilization. > > Regarding testing, basic build, boot and sanity testing have been > performed on hikey960 mainline kernel with debian file system. > Further aobench (An occlusion renderer for benchmarking realworld > floating point performance) showed the following results on hikey960 > with debain. > > Result Standard Standard > (Time secs) Error Deviation > Hikey 960 - no thermal pressure applied 138.67 6.52 11.52% > Hikey 960 - thermal pressure applied 122.37 5.78 11.57% > > Thara Gopinath (7): > sched/pelt: Add option to make load and util calculations frequency > invariant > sched/pelt.c: Add support to track thermal pressure > sched: Add infrastructure to store and update instantaneous thermal > pressure > sched: Initialize per cpu thermal pressure structure > sched/fair: Enable CFS periodic tick to update thermal pressure > sched/fair: update cpu_capcity to reflect thermal pressure > thermal/cpu-cooling: Update thermal pressure in case of a maximum > frequency capping > > drivers/base/arch_topology.c | 1 + > drivers/thermal/cpu_cooling.c | 20 ++++++++++++- > include/linux/sched.h | 14 +++++++++ > kernel/sched/Makefile | 2 +- > kernel/sched/core.c | 2 ++ > kernel/sched/fair.c | 4 +++ > kernel/sched/pelt.c | 40 ++++++++++++++++++-------- > kernel/sched/pelt.h | 7 +++++ > kernel/sched/sched.h | 1 + > kernel/sched/thermal.c | 66 +++++++++++++++++++++++++++++++++++++++++++ > kernel/sched/thermal.h | 13 +++++++++ > 11 files changed, 157 insertions(+), 13 deletions(-) > create mode 100644 kernel/sched/thermal.c > create mode 100644 kernel/sched/thermal.h >