Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5203773ybl; Tue, 10 Dec 2019 02:13:51 -0800 (PST) X-Google-Smtp-Source: APXvYqyVTOPmU3zIQKFnfaDGt2pMiHiC0bMd9e2Te0QbD2svHD/pJ6S72PLDIZuoxyXEYXdWp38A X-Received: by 2002:a9d:24a6:: with SMTP id z35mr24071987ota.343.1575972830962; Tue, 10 Dec 2019 02:13:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575972830; cv=none; d=google.com; s=arc-20160816; b=h0XQgh5GNNRBw5fWj9hv8G+7zZcpdSMP/EOXRA70uRcG6lMGaGtExcj5EY1TLXu4wz 9eE9aMt910cwy+2h073RHKrWSVoiuBH56G85zCsg5Ot3ABFouN+NxDTKpBkGvWjpSk95 WMVqZFMl3lOUPjO27oCuszBzk0nEumcIUUfOZGihINnq6oMSew3gfJOBYZEYUDqW4uPg S90HsRad5CoQANGGWLtd/hVQO3Aipe5fWloJC+YwIawaiwNI85kMSdt1MSRvjdLgcSaJ dT1U9eb/NVkC5+jT0jifS7+vh3i4qqj8c2B/51AgCWiXnOgbS4QyGBh2M+0s7aTs+du5 DhpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date; bh=qLRmMgi6ydas/SWzzlTpf1jTkYlYlC7ka2PMXRS4eBo=; b=D1dIBvtGUiKbPbGrCyfSKBBZMdh7yRcy5LE/Ce1dJPpG0LbsQXr3lJ/qS1PiGP0Zdl Vwu1iHLrEucGfAAh8Y4rp6sXiw2Tha1fYqtP01til0wVcEaMX4wLmsNl+AEsr405Mx1t XxhR87mjppwHP1rvLnL+403bao03w2Fx9ues/EGjZLPO0avCJWBfeDd2M6nxzQJquVwy duLRjmS+dRM/d2hUD/2Bgv1u4+J9d/4b/A65QfQVWt69dJbcRBMXIgRc8pVhq1sWo2Ac N1ZgWkIhsNSwr1yLajnKw6vw83URfRoDOP9LUBHl8gGdDXeEHxnYD8RoMKd/O5qiRr7b 2b6w== 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 s22si1688133otq.10.2019.12.10.02.13.38; Tue, 10 Dec 2019 02:13:50 -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; 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 S1727320AbfLJKLa (ORCPT + 99 others); Tue, 10 Dec 2019 05:11:30 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:16056 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727305AbfLJKLa (ORCPT ); Tue, 10 Dec 2019 05:11:30 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBAA7Fi4058096 for ; Tue, 10 Dec 2019 05:11:28 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2wsknaqw9q-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 10 Dec 2019 05:11:28 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 10 Dec 2019 10:11:26 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 10 Dec 2019 10:11:21 -0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xBAABKum50004096 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Dec 2019 10:11:20 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2951C42042; Tue, 10 Dec 2019 10:11:20 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 670BC42052; Tue, 10 Dec 2019 10:11:17 +0000 (GMT) Received: from linux.vnet.ibm.com (unknown [9.126.150.29]) by d06av24.portsmouth.uk.ibm.com (Postfix) with SMTP; Tue, 10 Dec 2019 10:11:17 +0000 (GMT) Date: Tue, 10 Dec 2019 15:41:16 +0530 From: Srikar Dronamraju To: Vincent Guittot Cc: Dave Chinner , Peter Zijlstra , Phil Auld , Ming Lei , linux-block , linux-fs , linux-xfs , linux-kernel , Jeff Moyer , Dave Chinner , Eric Sandeen , Christoph Hellwig , Jens Axboe , Ingo Molnar , Tejun Heo Subject: Re: [PATCH v2] sched/core: Preempt current task in favour of bound kthread Reply-To: Srikar Dronamraju References: <20191115234005.GO4614@dread.disaster.area> <20191118092121.GV4131@hirez.programming.kicks-ass.net> <20191118204054.GV4614@dread.disaster.area> <20191120191636.GI4097@hirez.programming.kicks-ass.net> <20191120220313.GC18056@pauld.bos.csb> <20191121132937.GW4114@hirez.programming.kicks-ass.net> <20191209165122.GA27229@linux.vnet.ibm.com> <20191209231743.GA19256@dread.disaster.area> <20191210054330.GF27253@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 x-cbid: 19121010-0012-0000-0000-000003736E80 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19121010-0013-0000-0000-000021AF4031 Message-Id: <20191210101116.GA9139@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-10_01:2019-12-10,2019-12-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 mlxscore=0 phishscore=0 impostorscore=0 mlxlogscore=999 spamscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912100090 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Vincent Guittot [2019-12-10 10:43:46]: > On Tue, 10 Dec 2019 at 06:43, Srikar Dronamraju > wrote: > > > > This is more prone to happen if the current running task is CPU > > intensive and the sched_wake_up_granularity is set to larger value. > > When the sched_wake_up_granularity was relatively small, it was observed > > that the bound thread would complete before the load balancer would have > > chosen to move the cache hot task to a different CPU. > > > > To deal with this situation, the current running task would yield to a > > per CPU bound kthread, provided kthread is not CPU intensive. > > > > /pboffline/hwcct_prg_old/lib/fsperf -t overwrite --noclean -f 5g -b 4k /pboffline > > > > (With sched_wake_up_granularity set to 15ms) > > So you increase sched_wake_up_granularity to a high level to ensure > that current is no preempted by waking thread but then you add a way > to finally preempt it which is somewhat weird IMO > Yes, setting to a smaller value will help mitigate/solve the problem. There may be folks out who have traditionally set a high wake_up_granularity (and have seen better performance with it), who may miss out that when using blk-mq, such settings will cause more harm. And they may continue to see some performance regressions when they move to a lower wake_up_granularity. > Have you tried to increase the priority of workqueue thread (decrease > nice priority) ? This is the right way to reduce the impact of the > sched_wake_up_granularity on the wakeup of your specific kthread. > Because what you want at the end is keeping a low wakeup granularity > for these io workqueues > Yes, people can tune the priority of workqueue threads and infact it may be easier to set wake_up_granularity to a lower value. However the point is how do we make everyone aware that they are running into a performance issue with a higher wakeup_granularity? -- Thanks and Regards Srikar Dronamraju