Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2026464ybi; Sun, 16 Jun 2019 19:53:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6A8wH7ygdjmk0uBaeP3gsJ9TN//q356V5j3diI8yQ8W1KnpyFuFkESahyRMxleMZ4pqpH X-Received: by 2002:a63:d24f:: with SMTP id t15mr15207307pgi.301.1560739991904; Sun, 16 Jun 2019 19:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560739991; cv=none; d=google.com; s=arc-20160816; b=hGg7FaVwY1a2GGM5MoHuyGOiLrepFJ+6zu3NP76n35fQ3vwCBgZFuMwB9HIOs4er3p BBKrqAdKQkVn88zkaNaosA19ODl+rFcTi+elHHmeAhBmXN+YdBNpxAhupsx7Nk7zSQnE 9Q+sDbx5mljXuPhJjwEuvP3kdELLaLBEojTaDSOzigpANGPe9cIf05456lQY4gjvfjPB NmvHJnK4RflBhl3241AxCdXfQMB+NhmTwEspe0e2EUO2jOjPZR/flgiqU8lKdNRoaoX/ 5nreEfxurp/LaxBaNrEed5HqRCclCPNI/Fditz0c0kSb3VGwuU+1F91SrQ1liYoL6Bs8 ommg== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=NP+H5g/b+Wzp5HDVodVIMObUSQnlwY7qTP5h/jM808A=; b=zG2L6ccpMFggzX5IWm7MQBVSDFex5oTPFgSB+hm44mHcG7rFE6kYV8Z4JNfT9xYmdI iz5jLjJwccQa+7U1oI5R+sqRc2R5UlfzWwQU6Ha7Q7n7yRwpfvAhQoeTM5Hcp/dwtRxb qV85Wr0q2pV8HAHP+fu1bnLuzEC34M3ZzzkHQalmbxpamN31HTqfNmtNzNKXKaJOtkC9 NSJM7yHulVyqyCe6dj1gjnbyXb2//bRqDJCEGP+a4ojGcbsbEB6jMNNOSBmGzaytTNTk Rd0j0EttoL94l+FlZLMW4e0eMyM0NTzPN3Hm4+61G1mdtIC9Tqopy7pAAwLWEUH8OTEu WoXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KTvM1OeF; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w15si8870873ply.127.2019.06.16.19.52.57; Sun, 16 Jun 2019 19:53:11 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KTvM1OeF; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727573AbfFQCvl (ORCPT + 99 others); Sun, 16 Jun 2019 22:51:41 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:34819 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727441AbfFQCvl (ORCPT ); Sun, 16 Jun 2019 22:51:41 -0400 Received: by mail-lf1-f66.google.com with SMTP id a25so5337862lfg.2 for ; Sun, 16 Jun 2019 19:51:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=NP+H5g/b+Wzp5HDVodVIMObUSQnlwY7qTP5h/jM808A=; b=KTvM1OeFzJ0IQh2AZPn/iaoJKK/BFA/gSPbnw+dpHa1ZDMMLF9E9PlJJKgTOHsrYnm pIssE8Xpuasa+fx6cgM/Y0TvyOrngvWp3bWFBxOabommOPRLhwGBuW74QSXG+QhV03q8 H8OYGyItfYW27WbCks04vsdNnmYH0JdmUb24CHg79pVqWDbRMfiLryki6Pbp1kmVyXqS gXzv+5l456YuyrUevO71mCqfFPa+VeD+Uo+3FvGWWaYtFlaIeCqOXNo6fjseLpUTYOUU hgE0rTuiAlcUZhnqY98BqbI1HTY6m878x4DpPIOCsOKRdJc4zvi2aBud23QAJmSGbsGH S3tA== 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:content-transfer-encoding; bh=NP+H5g/b+Wzp5HDVodVIMObUSQnlwY7qTP5h/jM808A=; b=FgLGj9HYDV081FZ+ABCuCx2vIAc92EZySL/TV2+SBFMsdPZ4atfav0VSD8Q0MHy78n HtA7jJC5DxaoaxZYO18t1edhkf35vK8fldDDb/ynGFtVqAWl9XJYE1hLRYGPcLxMTrsN 79LCxn6cg3T6pE5MFLNkdAmy+IUSnI4dXDrrnEZZUJlowVRRD+eEtUgdeLYY4RQCMo+g nTeq0RdOw3aeNVcuVpV5YNPuT06FfrlJBc2oN7y3UugFMbSC86V2iUlfOdklnhen0ZpJ IdhtqUVfbhZ55ggmGBKYFYy4m3VMVRPw74wYVgW6LiMMJe8fACYucJF5w6rN0RPUXKvU wD/g== X-Gm-Message-State: APjAAAUhDEgKPt/J/L1KXXLeL5CoLhZFPH0VPv/PSo0DXZan0L+XNRGO h+XQJNvOrYrAsJrdldb5WWzLKLHR7LKUdzZGUnU= X-Received: by 2002:ac2:5636:: with SMTP id b22mr24697722lff.2.1560739898713; Sun, 16 Jun 2019 19:51:38 -0700 (PDT) MIME-Version: 1.0 References: <20190531210816.GA24027@sinkpad> <20190606152637.GA5703@sinkpad> <20190612163345.GB26997@sinkpad> <635c01b0-d8f3-561b-5396-10c75ed03712@oracle.com> <20190613032246.GA17752@sinkpad> In-Reply-To: <20190613032246.GA17752@sinkpad> From: Aubrey Li Date: Mon, 17 Jun 2019 10:51:27 +0800 Message-ID: Subject: Re: [RFC PATCH v3 00/16] Core scheduling v3 To: Julien Desfossez Cc: Subhra Mazumdar , Aaron Lu , Vineeth Remanan Pillai , Nishanth Aravamudan , Peter Zijlstra , Tim Chen , Ingo Molnar , Thomas Gleixner , Paul Turner , Linus Torvalds , Linux List Kernel Mailing , =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , Kees Cook , Greg Kerr , Phil Auld , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 13, 2019 at 11:22 AM Julien Desfossez wrote: > > On 12-Jun-2019 05:03:08 PM, Subhra Mazumdar wrote: > > > > On 6/12/19 9:33 AM, Julien Desfossez wrote: > > >After reading more traces and trying to understand why only untagged > > >tasks are starving when there are cpu-intensive tasks running on the > > >same set of CPUs, we noticed a difference in behavior in =E2=80=98pick= _task=E2=80=99. In > > >the case where =E2=80=98core_cookie=E2=80=99 is 0, we are supposed to = only prefer the > > >tagged task if it=E2=80=99s priority is higher, but when the prioritie= s are > > >equal we prefer it as well which causes the starving. =E2=80=98pick_ta= sk=E2=80=99 is > > >biased toward selecting its first parameter in case of equality which = in > > >this case was the =E2=80=98class_pick=E2=80=99 instead of =E2=80=98max= =E2=80=99. Reversing the order of > > >the parameter solves this issue and matches the expected behavior. > > > > > >So we can get rid of this vruntime_boost concept. > > > > > >We have tested the fix below and it seems to work well with > > >tagged/untagged tasks. > > > > > My 2 DB instance runs with this patch are better with CORESCHED_STALL_F= IX > > than NO_CORESCHED_STALL_FIX in terms of performance, std deviation and > > idleness. May be enable it by default? > > Yes if the fix is approved, we will just remove the option and it will > always be enabled. > sysbench --report-interval option unveiled something. benchmark setup ------------------------- two cgroups, cpuset.cpus =3D 1, 53(one core, two siblings) sysbench cpu mode, one thread in cgroup1 sysbench memory mode, one thread in cgroup2 no core scheduling -------------------------- cpu throughput eps: 405.8, std: 0.14% mem bandwidth MB/s: 5785.7, std: 0.11% cgroup1 enable core scheduling(cpu mode) cgroup2 disable core scheduling(memory mode) ----------------------------------------------------------------- cpu throughput eps: 8.7, std: 519.2% mem bandwidth MB/s: 6263.2, std: 9.3% cgroup1 disable core scheduling(cpu mode) cgroup2 enable core scheduling(memory mode) ----------------------------------------------------------------- cpu throughput eps: 468.0 , std: 8.7% mem bandwidth MB/S: 311.6 , std: 169.1% cgroup1 enable core scheduling(cpu mode) cgroup2 enable core scheduling(memory mode) ---------------------------------------------------------------- cpu throughput eps: 76.4 , std: 168.0% mem bandwidth MB/S: 5388.3 , std: 30.9% The result looks still unfair, and particularly, the variance is too high, ----sysbench cpu log ---- ----snip---- [ 10s ] thds: 1 eps: 296.00 lat (ms,95%): 2.03 [ 11s ] thds: 1 eps: 0.00 lat (ms,95%): 1170.65 [ 12s ] thds: 1 eps: 1.00 lat (ms,95%): 0.00 [ 13s ] thds: 1 eps: 0.00 lat (ms,95%): 0.00 [ 14s ] thds: 1 eps: 295.91 lat (ms,95%): 2.03 [ 15s ] thds: 1 eps: 1.00 lat (ms,95%): 170.48 [ 16s ] thds: 1 eps: 0.00 lat (ms,95%): 2009.23 [ 17s ] thds: 1 eps: 1.00 lat (ms,95%): 995.51 [ 18s ] thds: 1 eps: 296.00 lat (ms,95%): 2.03 [ 19s ] thds: 1 eps: 1.00 lat (ms,95%): 170.48 [ 20s ] thds: 1 eps: 0.00 lat (ms,95%): 2009.23 ----snip---- Thanks, -Aubrey