Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5249440ybl; Tue, 10 Dec 2019 03:03:11 -0800 (PST) X-Google-Smtp-Source: APXvYqxZDGLqs94jvt84XlfKjCNHBebfYqShh+2f7e+nTDnhaWYemdDU6lJFSgpCQrU6e1oMe10o X-Received: by 2002:a9d:3b09:: with SMTP id z9mr18855764otb.195.1575975791198; Tue, 10 Dec 2019 03:03:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575975791; cv=none; d=google.com; s=arc-20160816; b=04duWLyxWStuRIienb4eSoY4cTdBDSv6h2TvlqTym/fVJoJa2w7ImUlH+zCbGk3mZh clGspoC/X+DQfJYQ/GqaG6GwrrN/CAVbWDqc8uXqW3U7zKz7j8fQUS6tkHavQfYgYV1Z tNw7tpuJFV7H1vGD43tywYFzLcTnFFqYDQ6iIgqKVuRiyRAu0QqBnrxI6adf2QyE4oOD KfxlqfWt9ySf6sjRZIpDas2lI/gu1NuvWHQWUS4l4oz5gS23USOlY9lE1YWtQNqqgFMo zaEXGkl+CgMxMkZZk7n7cJkCS1/l/2c27ZG86OAcuBJmecYU72S227V+wgHY+q3LpmXw W8qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=avT8djgaVLUaP/1BXJuTZBwRdJwwah+0AF+tp3FQZPs=; b=MVv0KxC82kxaozWexl9xepnuyo1mKruEA+QYPfLUWR1OhFX7GrmUXH0jzcC5X3S4kh o6307TpOdcr5AgSiFsI/l9Ba2Cbms8f2JpB2uQ4k6pc3CDDIHnwfnQjPX/tWCKCiRTPb KZQczGUAWD/5zuHngO7sLsqLxMcxBwblXcl9pWMeVuSWBvQeXhRPiEbu9JrCYHeTyRhH O7OWFRQg3cM3Jq4WR73lj+VkoXE0HTZMgEIkyXzt8fGO6TikmohphFm4mBzT4fnKMIVC 4mJweaFcKkUW65F314yTX57JSJ4IU2gjP98AoEvvVclAB9KcQ+FryUG9RpDVFHTLwBp9 JgVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mf3xlkOS; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v141si1738416oif.161.2019.12.10.03.02.56; Tue, 10 Dec 2019 03:03:11 -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=@linaro.org header.s=google header.b=Mf3xlkOS; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727185AbfLJLCY (ORCPT + 99 others); Tue, 10 Dec 2019 06:02:24 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:45304 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727114AbfLJLCY (ORCPT ); Tue, 10 Dec 2019 06:02:24 -0500 Received: by mail-lj1-f196.google.com with SMTP id d20so19321365ljc.12 for ; Tue, 10 Dec 2019 03:02:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=avT8djgaVLUaP/1BXJuTZBwRdJwwah+0AF+tp3FQZPs=; b=Mf3xlkOSDEXkKBh/xlW95jq/ctKWC6+5W25pp6TESvMuNfvypSGAfYHsVnbPTF1cYg RR0YLlmQ0tYBn9eVo9B5cXn5iQtVmIH73aTUt7+x6qyrXUIoBdS4hBRmUK0eZkDmLkAb EGIAlfTwNBPpLzuweZ8Ri86B/UxW1T1ZRDG8hmX5tHJ5Y5Aildo02kJCV0NHR6AdkbLh NBmHSZGnygxVFb9Yn3M+Ft/tELQKD1dHnNiv4mWLZc6mZCvBM+Tsyr0Wp7Sd2MG1aAHj Tq/GviXZQEHaPzhya05BIy0b3HF1EnJFgiDF4nG2cr+QZRR8UVHE0LLUBd9LPIqUTqH1 6QoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=avT8djgaVLUaP/1BXJuTZBwRdJwwah+0AF+tp3FQZPs=; b=lmLr/0v1qsw3vEraMBWm79H9umwP4IFOSdysSvSi3zJZ4Y5ziMSEZtPYjhLJqugOSI CLUTekjBHpNSaEd8zxE4KN2yp1OU+NU0zk5uAqVckIf2/iVHjYTYBRD+Fh4GptnfDmgu uA/E58Eojl/HHN8N+/ytOsdIw1azDE5NNvBkWX+PvVH3lqebfehrZhAaS2evN07x01k7 9UqymrDhpVuLVyAeBHrI2IMvCLZZF2pMvsb2ssh5j0xNIVeozgnssAgTIBynLFGqp9Pf FBHaOG2l1LZ7kR1C/tHBtxbWtGQ+2244cJZ/xhw0LbM9K3SlELhiwtUxpk8VORji/rrJ J9ow== X-Gm-Message-State: APjAAAX3r3gqRNp9oQsqtcvc4W/vdI6k+k59nR2IF9VVafWz+eqN84DA B5APDk3vUzYfjpvZrC4zdQ9Y/CkW/l7Xlo+2Wyk1zQ== X-Received: by 2002:a2e:9a04:: with SMTP id o4mr21104651lji.214.1575975741445; Tue, 10 Dec 2019 03:02:21 -0800 (PST) MIME-Version: 1.0 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> <20191210101116.GA9139@linux.vnet.ibm.com> In-Reply-To: <20191210101116.GA9139@linux.vnet.ibm.com> From: Vincent Guittot Date: Tue, 10 Dec 2019 12:02:09 +0100 Message-ID: Subject: Re: [PATCH v2] sched/core: Preempt current task in favour of bound kthread To: Srikar Dronamraju 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Dec 2019 at 11:11, Srikar Dronamraju wrote: > > * 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? I did the test on my local setup to change the nice priority of io workqueue and the active migrations are removed even with high wakeup_granularity because IO workqueue can still preempt normal task but let other workqueue behave normally. > > -- > Thanks and Regards > Srikar Dronamraju >