Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp468298ybl; Wed, 4 Dec 2019 05:52:26 -0800 (PST) X-Google-Smtp-Source: APXvYqwEXQrBzr/3paZWiWGs27qvsxAwXTBl4VKQaAYa2DFi9yirCFE4YVmXg3hMQ929q/9h0OMQ X-Received: by 2002:a9d:7b50:: with SMTP id f16mr2555864oto.18.1575467546330; Wed, 04 Dec 2019 05:52:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575467546; cv=none; d=google.com; s=arc-20160816; b=PzO4SidCJpAWMSIwCeSd0TysWE/pvKyupsviFw8jCHfz/SfHpykMZZk9XqZxzIpFcJ ANsSytpklmc/VN54kqShABFaoagI2C/K9gaqv5RVRzTEmnEzRmrriSuCkieFqBaXPf8W TdwKxKTfJ7l3eKyY097zAjbUnYVI9W6q2iiudD0JE63p93ihZA2mFLd0cJ23B984aYmo U93b71r+Et+fWct6HZvi5ncN30+Q95m/z7IUFyshNmjD2WddnlCOc+mYbkvjnwrDyPxv SJc9nhtdTtHgwmxrnUiNRprYLuiNvwJoTu7JJFdty2HcF3WcOAUljKy17xmPih2qCGMD AAzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:user-agent:in-reply-to:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=VA9lOoBJgqCxzPUvXrp+l1oPS8XjH4P1e6jO6rnjjg8=; b=S1uv3PYKOHS3tmyRkMPVXeiGkvBgtXibx813p9i59Fw/RfzTazEq5pYUT2atFVw+Z5 MM1Py0+l4RgseO+2u735BjahAKFi0JEQWOkUJ5DpIVwBSAS/VeE8F2HJgKZX71Y/+sKa zfWzSa/NQQ+SEtHpkz2m4EqIJKMf6wIQLegTMqqT0DivPv+cfvc7YBAJ9hW8Va8e0Li5 hMW+vZQ15Fse+etSVeUXrJ2B5ssPxAS9rqCPENd0Zh/TGklrUWAC5Fz4CkUP+3CiyLxv GKogz1T7y36FWQMpnW+E0MqZeCV8YCIK5m+iQ46XntCmF2wpm+Sjoi9NO/yTJ0iBOPDz 5xMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=f2Z+tp19; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l64si3157743oih.2.2019.12.04.05.52.13; Wed, 04 Dec 2019 05:52:26 -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=@redhat.com header.s=mimecast20190719 header.b=f2Z+tp19; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727912AbfLDNuw (ORCPT + 99 others); Wed, 4 Dec 2019 08:50:52 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:48056 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727792AbfLDNuw (ORCPT ); Wed, 4 Dec 2019 08:50:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575467450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VA9lOoBJgqCxzPUvXrp+l1oPS8XjH4P1e6jO6rnjjg8=; b=f2Z+tp19dJrQR0ToQ2UDHUTiTxUAL/eYzxqdD2/w+wjMZow6hJ5moqpIwswyH7yWeXnU/f eMR8lA6h7tfLT413WvnRIum1l7YFTcuog/hZVzwYu650nVVFnYv04cf6vmr8DAniprc1xv g/TbnvNaOO1bFIHMu/GZzDgztmUq/lw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-353-sTXKKfdVOFaPo2t4eAi-uw-1; Wed, 04 Dec 2019 08:50:49 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2144D91206; Wed, 4 Dec 2019 13:50:47 +0000 (UTC) Received: from ming.t460p (ovpn-8-23.pek2.redhat.com [10.72.8.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C826E19C68; Wed, 4 Dec 2019 13:50:32 +0000 (UTC) Date: Wed, 4 Dec 2019 21:50:14 +0800 From: Ming Lei To: Vincent Guittot Cc: Phil Auld , Dave Chinner , Hillf Danton , linux-block , linux-fs , linux-xfs , linux-kernel , Christoph Hellwig , Jens Axboe , Peter Zijlstra , Rong Chen , Tejun Heo Subject: Re: single aio thread is migrated crazily by scheduler Message-ID: <20191204135014.GA21449@ming.t460p> References: <20191115010824.GC4847@ming.t460p> <20191115045634.GN4614@dread.disaster.area> <20191115070843.GA24246@ming.t460p> <20191128094003.752-1-hdanton@sina.com> <20191202024625.GD24512@ming.t460p> <20191202040256.GE2695@dread.disaster.area> <20191202212210.GA32767@lorien.usersys.redhat.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: sTXKKfdVOFaPo2t4eAi-uw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 03, 2019 at 10:45:38AM +0100, Vincent Guittot wrote: > On Mon, 2 Dec 2019 at 22:22, Phil Auld wrote: > > > > Hi Vincent, > > > > On Mon, Dec 02, 2019 at 02:45:42PM +0100 Vincent Guittot wrote: > > > On Mon, 2 Dec 2019 at 05:02, Dave Chinner wrote= : > > > > ... > > > > > > So, we can fiddle with workqueues, but it doesn't address the > > > > underlying issue that the scheduler appears to be migrating > > > > non-bound tasks off a busy CPU too easily.... > > > > > > The root cause of the problem is that the sched_wakeup_granularity_ns > > > is in the same range or higher than load balance period. As Peter > > > explained, This make the kworker waiting for the CPU for several load > > > period and a transient unbalanced state becomes a stable one that the > > > scheduler to fix. With default value, the scheduler doesn't try to > > > migrate any task. > > > > There are actually two issues here. With the high wakeup granularity > > we get the user task actively migrated. This causes the significant > > performance hit Ming was showing. With the fast wakeup_granularity > > (or smaller IOs - 512 instead of 4k) we get, instead, the user task > > migrated at wakeup to a new CPU for every IO completion. >=20 > Ok, I haven't noticed that this one was a problem too. Do we have perf > regression ? Follows the test result on one server(Dell, R630: Haswell-E): kernel.sched_wakeup_granularity_ns =3D 4000000 kernel.sched_min_granularity_ns =3D 3000000 --------------------------------------- test =09=09 | IOPS --------------------------------------- ./xfs_complete 512 =09 | 7.8K=20 --------------------------------------- taskset -c 8 ./xfs_complete 512 | 9.8K=20 --------------------------------------- Thanks, Ming