Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1186970ybp; Wed, 9 Oct 2019 10:04:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyw6xzoZY5cel4cIS733VFeM6VLsKVGbJNnO1zYaT76kLNl0aj1uf/BnwNCXRmWaMRciHKE X-Received: by 2002:a17:906:2303:: with SMTP id l3mr3761126eja.230.1570640642213; Wed, 09 Oct 2019 10:04:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570640642; cv=none; d=google.com; s=arc-20160816; b=WTCGQ1seMCpC7U368e3R+YRtUqG40Yd59xNcADFLoEFL076kglXYEGPeWDedim8n03 BfJM+7/DYfj69QnYdXUbnQSBFMiQw9I86lj1d1rL5tsoWp73hpkUqMnJGwyqPQvSxWqB 40xGI3SzHkKGhc9HKvbBcw3Q3tku8tHU8b/qwp+9xSy1t+zC4eXYMgd3HQ94qwR9L/R0 7S31hTidfju+nxOlApo6GaB7l6GEbqSyQPKGJsIztLksF6IYc21zWK+9yfcX7AsEuAhc Wd5PuNW5n8joVp1uD5mIgzokFLq7mzM46wnai+CxjIu9uhZKAPHKOQ3TN+1x0rxz4blO GFzw== 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=TO0anZQhhM34EnZ56V7WRwgD9bovhDdkfpmkNbLxfbg=; b=k8Smp3PPQqV8ogR/OqpjCMLHbmDcN7F3WJgB6j6kp6+n1L/qEGuJ+cs5A0BJP8gRUt Sa5qO/rprLsSmq7zQrU2c3j3I/oY7OaXfur+JlOgjMhfd3iHsF2kOmVCA6y68Fo02Hch /ln4wAXAGH9r675xXPkoQ6XMxOnV7pK22bsTpk1Je3/+l82n8oDKzxPNURGWYJEhlOoS z5NdxLoqG9vxGY/F+/qJ6ivOK+rs/UkgO7gOFcjlklXkE2p86IyWTfvf95pSrgwXYnLo EfFYNjd8OgS9jbHZ8RFVCWyrVpLjVrPpL2Tmvj/V7/YL6dmq9X28MgiffO53T7oOBnjJ QLGA== 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 l45si1816981edc.185.2019.10.09.10.03.37; Wed, 09 Oct 2019 10:04:02 -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 S1731851AbfJIRCw (ORCPT + 99 others); Wed, 9 Oct 2019 13:02:52 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:3730 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730546AbfJIRCv (ORCPT ); Wed, 9 Oct 2019 13:02:51 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x99H1ugs070551 for ; Wed, 9 Oct 2019 13:02:50 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2vhj8jb895-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 09 Oct 2019 13:02:50 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 9 Oct 2019 18:02:46 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 9 Oct 2019 18:02:41 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x99H2eUi19464206 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 9 Oct 2019 17:02:40 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 549C84C044; Wed, 9 Oct 2019 17:02:40 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3727B4C050; Wed, 9 Oct 2019 17:02:36 +0000 (GMT) Received: from localhost.localdomain (unknown [9.85.75.123]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 9 Oct 2019 17:02:35 +0000 (GMT) Subject: Re: [RFC v5 4/6] sched/fair: Tune task wake-up logic to pack small background tasks on fewer cores To: Dietmar Eggemann , Vincent Guittot Cc: linux-kernel , "open list:THERMAL" , Peter Zijlstra , Ingo Molnar , Patrick Bellasi , Valentin Schneider , Pavel Machek , Doug Smythies , Quentin Perret , "Rafael J. Wysocki" , Tim Chen , Daniel Lezcano References: <20191007083051.4820-1-parth@linux.ibm.com> <20191007083051.4820-5-parth@linux.ibm.com> <80bb34ec-6358-f4dc-d20d-cde6c9d7e197@linux.ibm.com> <86dc25e4-9f19-627f-9581-d74608b7f20c@linux.ibm.com> From: Parth Shah Date: Wed, 9 Oct 2019 22:32:35 +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: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19100917-0028-0000-0000-000003A88AF8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19100917-0029-0000-0000-0000246A9081 Message-Id: <0ee8052e-e7fb-83cb-bf70-3c4855ccca8e@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-10-09_08:,, 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-1908290000 definitions=main-1910090147 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/9/19 7:56 PM, Dietmar Eggemann wrote: > On 09/10/2019 10:57, Parth Shah wrote: > > [...] > >>> On 07/10/2019 18:53, Parth Shah wrote: >>>> >>>> >>>> On 10/7/19 5:49 PM, Vincent Guittot wrote: >>>>> On Mon, 7 Oct 2019 at 10:31, Parth Shah wrote: > > [...] > >>>> Maybe I can add just below the sched_energy_present(){...} construct giving >>>> precedence to EAS? I'm asking this because I remember Patrick telling me to >>>> leverage task packing for android as well? >>> >>> I have a hard time imaging that Turbosched will be used in Android next >>> to EAS in the foreseeable future. >>> >>> First of all, EAS provides task packing already on Performance Domain >>> (PD) level (a.k.a. as cluster on traditional 2-cluster Arm/Arm64 >>> big.LITTLE or DynamIQ (with Phantom domains (out of tree solution)). >>> This is where we can safe energy without harming latency. >>> >>> See the tests results under '2.1 Energy test case' in >>> >>> https://lore.kernel.org/r/20181203095628.11858-1-quentin.perret@arm.com >>> >>> There are 10 to 50 small (classified solely by task utilization) tasks >>> per test case and EAS shows an effect on energy consumption by packing >>> them onto the PD (cluster) of the small CPUs. >>> >>> And second, the CPU supported topology is different to the one you're >>> testing on. >>> >> >> cool. I was just keeping in mind the following quote >> " defining a generic spread-vs-pack wakeup policy which is something >> Android also could benefit from " (https://lkml.org/lkml/2019/6/28/628) > > The main thing is that in case we want to introduce a new functionality > into CFS, we should try hard to use existing infrastructure (or > infrastructure there is agreement on that we'll need it) as much as > possible. > > If I understand Patrick here correctly, he suggested not to use uclamp > but the task latency nice approach. There is agreement that we would > need something like this as infrastructure: > > https://lore.kernel.org/r/20190830174944.21741-1-subhra.mazumdar@oracle.com > got it. > So p->latency_nice is suitable to include your p->flags |= > PF_CAN_BE_PACKED concept nicely. yeah, I'm working on that part too as a bigger goal. > >> >> BTW, IIUC that does task consolidation only on single CPU unless >> rd->overload is set, right? > > Task consolidation on Performance Domains (PDs) w/ multiple CPUs (e.g. > on a per-cluster PD big.LITTLE system) only works when the system is not > overutilized: > > 6326 int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu) > 6327 { > ... > 6337 if (!pd || *READ_ONCE(rd->overutilized)*) > 6338 goto fail; > ... ok. so does that mean TurboSched can still do some good in such systems as well ? I mean save energy even when rd->overutilized==1 by not waking user classified bg tasks on idle core. > > [...] > Thanks, Parth