Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6799788ybh; Thu, 8 Aug 2019 05:57:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyObHnF34UwoHTkPH/EjxV4KC20I6tb1xjFDaHDCfpmDeG6F3kDvALeG8BBktiirKVEq+g X-Received: by 2002:a65:5183:: with SMTP id h3mr12698821pgq.250.1565269032540; Thu, 08 Aug 2019 05:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565269032; cv=none; d=google.com; s=arc-20160816; b=A8kN1t+K3DZfEoV5P/BK3KsUXJkpZqwU9B/6AFIBpkUutVqjrHL0GfOYLf1gJEyRmC VoUrkkiyUjwGqhBo5zi6vVjkwPhOo01A0tXIQj6afSz5r1wX4Cyy0mh+In6UBG3GSQ+m 3593vvLlq34c0+0L1vTCVRo51eOSo5EINx9UDqOfCORrM1wbZv/P0sGaxeAepKSbwy2S s+EyVH/DzQ7S2jg8c2/0GpiiQ9Swz17+fPT/5qYfhymG7SvS+CBVYKUww2fvFo1tHmd6 sH6KlkCktoPHU33FuWt1t25GQPSfSeu5Sg4TqBnlxEgGcmt5xUs18oKUDgO6tzPagWkj BoDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=7aZ877X7BrTCftpjVYy+YmJG6Qm46QL6KwrmcgFPrYM=; b=aq5U5Oo07uQjQCYl+mIJvfrnBt7kzRBnBjxHwxDahpRVcvQd39hxVhkenkQc0Tdj5U wMdCI2Y2AK7S1ktsi8kTheGrOgdQl2ByQm0QPG59ygYu3GXtlqLzMQ4ytcmx108s44Kl byEU5X/kmYlSlVUGSN3S2NAmdBd4/7C3YoVnEXWDKdcVVeE6ac8GL38VLYha3dWsLtFc VTTxc1K4GgZN2dYFUjlG2/FWLN6k06GkX4O9tyMq7Q2pJoNrrpqyYFzny87ccUqlXFxm 3zMrY/jbPi6NJKmpKed7Rz7feOL7kvgjNHYs/QxSJFlJYx4RdIEgFM0jYRQWzLngw/3i kcMg== 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=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p19si51681486pfn.53.2019.08.08.05.56.57; Thu, 08 Aug 2019 05:57:12 -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; 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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389653AbfHHMzq (ORCPT + 99 others); Thu, 8 Aug 2019 08:55:46 -0400 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:10905 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732608AbfHHMzq (ORCPT ); Thu, 8 Aug 2019 08:55:46 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R791e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01422;MF=aaron.lu@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0TYy9zQo_1565268916; Received: from aaronlu(mailfrom:aaron.lu@linux.alibaba.com fp:SMTPD_---0TYy9zQo_1565268916) by smtp.aliyun-inc.com(127.0.0.1); Thu, 08 Aug 2019 20:55:22 +0800 Date: Thu, 8 Aug 2019 20:55:16 +0800 From: Aaron Lu To: Tim Chen Cc: Julien Desfossez , "Li, Aubrey" , Aubrey Li , Subhra Mazumdar , Vineeth Remanan Pillai , Nishanth Aravamudan , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Paul Turner , Linus Torvalds , Linux List Kernel Mailing , =?iso-8859-1?Q?Fr=E9d=E9ric?= Weisbecker , Kees Cook , Greg Kerr , Phil Auld , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini Subject: Re: [RFC PATCH v3 00/16] Core scheduling v3 Message-ID: <20190808125516.GA67687@aaronlu> References: <20190613032246.GA17752@sinkpad> <20190619183302.GA6775@sinkpad> <20190718100714.GA469@aaronlu> <20190725143003.GA992@aaronlu> <20190726152101.GA27884@sinkpad> <7dc86e3c-aa3f-905f-3745-01181a3b0dac@linux.intel.com> <20190802153715.GA18075@sinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 05, 2019 at 08:55:28AM -0700, Tim Chen wrote: > On 8/2/19 8:37 AM, Julien Desfossez wrote: > > We tested both Aaron's and Tim's patches and here are our results. > > > > Test setup: > > - 2 1-thread sysbench, one running the cpu benchmark, the other one the > > mem benchmark > > - both started at the same time > > - both are pinned on the same core (2 hardware threads) > > - 10 30-seconds runs > > - test script: https://paste.debian.net/plainh/834cf45c > > - only showing the CPU events/sec (higher is better) > > - tested 4 tag configurations: > > - no tag > > - sysbench mem untagged, sysbench cpu tagged > > - sysbench mem tagged, sysbench cpu untagged > > - both tagged with a different tag > > - "Alone" is the sysbench CPU running alone on the core, no tag > > - "nosmt" is both sysbench pinned on the same hardware thread, no tag > > - "Tim's full patchset + sched" is an experiment with Tim's patchset > > combined with Aaron's "hack patch" to get rid of the remaining deep > > idle cases > > - In all test cases, both tasks can run simultaneously (which was not > > the case without those patches), but the standard deviation is a > > pretty good indicator of the fairness/consistency. > > Thanks for testing the patches and giving such detailed data. > > I came to realize that for my scheme, the accumulated deficit of forced idle could be wiped > out in one execution of a task on the forced idle cpu, with the update of the min_vruntime, > even if the execution time could be far less than the accumulated deficit. > That's probably one reason my scheme didn't achieve fairness. Turns out there is a typo error in v3 when setting rq's core_forceidle: diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 26fea68f7f54..542974a8da18 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3888,7 +3888,7 @@ next_class:; WARN_ON_ONCE(!rq_i->core_pick); if (is_idle_task(rq_i->core_pick) && rq_i->nr_running) - rq->core_forceidle = true; + rq_i->core_forceidle = true; rq_i->core_pick->core_occupation = occ; With this fixed and together with the patch to let schedule always happen, your latest 2 patches work well for the 10s cpuhog test I described previously: https://lore.kernel.org/lkml/20190725143003.GA992@aaronlu/ overloaded workload without any cpu binding doesn't work well though, I haven't taken a closer look yet.