Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp792662ybv; Wed, 19 Feb 2020 09:18:13 -0800 (PST) X-Google-Smtp-Source: APXvYqwbC9HPv3XiY0gM+A9LLwca1vZScrDh7tcJeoPFXNAY81pVmiCuHIRLAvD5nBModVzf6GVM X-Received: by 2002:a9d:6b84:: with SMTP id b4mr20585457otq.190.1582132693017; Wed, 19 Feb 2020 09:18:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582132693; cv=none; d=google.com; s=arc-20160816; b=UhWbUa3PY86vhXJlCWjwuQIJy4qTV1be1q3IdFt290xcmzAe+FjYsLJJr4GCBY3xyt kkR0OHXobJpV7+O2/WEQTqZQ8sEYdIbYj8PkEnkRpD453fy4nwTU5e/yM0zCy1p+ej0V v48qCCbuIJEEJcY6+W6+I2XTh/xLwpcof4VyLelgviTQ6bQKXyxjO1qmQe3nf+bqIW/a 3+bwa5psXZ/XwBeh3leYiEIaYkMFGIcU5UjchXvndY151GLUW8YHxxqbRi0HYYrJzz59 jTI2fuSzp+Sv0uVU0FykcIhCCQZjhiTs9RgGpwY6xqBw8OwbqNRtaj8n12vHO093L6tE hHew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=73kbc7sX76Gr4HjDNq/jj2n23ipbr26ddf0jVYeGy64=; b=YiADYVVTb81Xw2TtwwG3u4IsCtn5upUfUCffvlAbHtJi7fKoN6qM27/8/dqmO/jF20 YPwcg8fZguSfqDa7ck0OwihXFbb0jAxwStWHuwPYrn4sloDp9PNeDp3QZ6FK33uvZaIX Smwsp8eeToNjgjXCUv6YEzSD6usu3XQGXZognmLLWtbQdLVenEokt8iBCJb+ac5/NtKZ R+h+qFaFprENPoVWj29QBK0wPxADsjUGTpshHLdzQhYmft4AlcuxqC7cMidHWlVBUGNq OJrOmThqsIXl89j4CD4PTUYC4IVroL2ezuoyA56mzRScdlmbORP6wP3lmOiub1YnFV02 M3WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=iB9qxeif; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 10si9458988ois.76.2020.02.19.09.18.00; Wed, 19 Feb 2020 09:18:13 -0800 (PST) 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=@oracle.com header.s=corp-2020-01-29 header.b=iB9qxeif; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726613AbgBSRRk (ORCPT + 99 others); Wed, 19 Feb 2020 12:17:40 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:35620 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726539AbgBSRRk (ORCPT ); Wed, 19 Feb 2020 12:17:40 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01JHDBHa103535; Wed, 19 Feb 2020 17:17:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=73kbc7sX76Gr4HjDNq/jj2n23ipbr26ddf0jVYeGy64=; b=iB9qxeife3op9zsK+6OpUa/cLVFp+vxDjTP+zUznMV8SUwJbRDQV6NU4jRYczHr5HbDC jJyzqoXrpNFjnJWhSaS/KPZ6Nq7TXDqAn3258psvaBJKr9h669/HtERT1gJpLee9rSlA KupOWfXl/Zw7d2p0mh+HAz8ZVpamrHr5UE9M/TOX2tyaAQWtueCJOTb9SmlU6R4SaFtK 15fC9GSAXM2OBe2JU0854Xvrj1DobgdbGKrmTcllIXR7UfCbEMpaggz8iZbeQAuOwvkP mjAsQpPBTHmAGcT3Yzykr4O8eXhRl2TbrP3eDOLXonrjggIJOIHg5c7ukNkAaoX5Knlt sQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2y8udd4m0b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Feb 2020 17:17:16 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01JHCGnB023515; Wed, 19 Feb 2020 17:17:15 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 2y8udavyhf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Feb 2020 17:17:15 +0000 Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 01JHHBYq028822; Wed, 19 Feb 2020 17:17:12 GMT Received: from [192.168.0.195] (/69.207.174.138) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 19 Feb 2020 09:17:11 -0800 Subject: Re: [PATCH v3 0/3] Introduce per-task latency_nice for scheduler hints To: David Laight , Parth Shah , "vincent.guittot@linaro.org" , "patrick.bellasi@matbug.net" , "valentin.schneider@arm.com" , "dhaval.giani@oracle.com" , "dietmar.eggemann@arm.com" Cc: "linux-kernel@vger.kernel.org" , "peterz@infradead.org" , "mingo@redhat.com" , "qais.yousef@arm.com" , "pavel@ucw.cz" , "qperret@qperret.net" , "pjt@google.com" , "tj@kernel.org" References: <20200116120230.16759-1-parth@linux.ibm.com> <8ed0f40c-eeb4-c487-5420-a8eb185b5cdd@linux.ibm.com> <3ce2e8940fb14d95b011c8b30892aa62@AcuMS.aculab.com> From: chris hyser Message-ID: <10f42efa-3750-491a-74fe-d84c9c4924e3@oracle.com> Date: Wed, 19 Feb 2020 12:16:59 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <3ce2e8940fb14d95b011c8b30892aa62@AcuMS.aculab.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9536 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002190131 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9536 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002190131 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/19/20 6:18 AM, David Laight wrote: > From: chris hyser >> Sent: 18 February 2020 23:00 > ... >> All, I was asked to take a look at the original latency_nice patchset. >> First, to clarify objectives, Oracle is not >> interested in trading throughput for latency. >> What we found is that the DB has specific tasks which do very little but >> need to do this as absolutely quickly as possible, ie extreme latency >> sensitivity. Second, the key to latency reduction >> in the task wakeup path seems to be limiting variations of "idle cpu" search. >> The latter particularly interests me as an example of "platform size >> based latency" which I believe to be important given all the varying size >> VMs and containers. > > From my experiments there are a few things that seem to affect latency > of waking up real time (sched fifo) tasks on a normal kernel: Sorry. I was only ever talking about sched_other as per the original patchset. I realize the term extreme latency sensitivity may have caused confusion. What that means to DB people is no doubt different than audio people. :-) > > 1) The time taken for the (intel x86) cpu to wakeup from monitor/mwait. > If the cpu is allowed to enter deeper sleep states this can take 900us. > Any changes to this are system-wide not process specific. > > 2) If the cpu an RT process last ran on (ie the one it is woken on) is > running in kernel, the process switch won't happen until cond_reshed() > is called. > On my system the code to flush the display frame buffer takes 3.3ms. > Compiling a kernel with CONFIG_PREEMPT=y will reduce this. > > 3) If a hardware interrupt happens just after the process is woken > then you have to wait until it finishes and any 'softint' work > that is scheduled on the same cpu finishes. > The ethernet driver transmit completions an receive ring filling > can easily take 1ms. > Booting with 'threadirq' might help this. > > 4) If you need to acquire a lock/futex then you need to allow for the > process that holds it being delayed by a hardware interrupt (etc). > So even if the lock is only held for a few instructions it can take > a long time to acquire. > (I need to change some linked lists to arrays indexed by an atomically > incremented global index.) > > FWIW I can't imagine how a database can have anything that is that > latency sensitive. > We are doing lots of channels of audio processing and have a lot of work > to do within 10ms to avoid audible errors. There are existing internal numbers that I will ultimately have to duplicate that show that simply short-cutting these idle cpu searches has a significant benefit on DB performance on large hardware. However that was for a different patchset involving things I don't like so I'm still exploring how to achieve similar results within the latency_nice framework. -chrish