Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp825477ybp; Fri, 11 Oct 2019 05:05:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7zaHBqnFdyerN8ABaHdYQgUNWi0NMJaNCKPniCbNDZBC/klm2L2n77ICGlsSf/RsHRNgS X-Received: by 2002:a17:906:27c5:: with SMTP id k5mr13171984ejc.173.1570795557284; Fri, 11 Oct 2019 05:05:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570795557; cv=none; d=google.com; s=arc-20160816; b=XzV10z+IM9mj8Q4+X7XGWBLyThJo7XJhauxXLIIfSo9IZ66/VvGvRG61Fosgede2To bX+MY08+2IvKMdcyPxQ3ihtKrssVNQLCOPhmVhd8eKlwAq727zEdSmH32t4ZdvF3e9t9 M0qhxV3PAvfc1SwWFoO2tskjUHFs7AQ9P55OuOO5+64cjbCfClJyXjVjvuLr3J5SQCn6 H1TvaxsH30K5ALLOkl3u4ZpExtXRLYWxF+3nUA9T1+SQBuF+894z3vv01wGMieoXNxyE kv0wxTsqgfZ0mvoWqmNtkAtcJO8uwSUqW2n9gNFcYjDSDpmgCvnDC7zLpNjL3CBJnbR0 mtyQ== 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=AxdKXdktprxVPLGFRhSBtR4byaYDXWhAbn1nCDnhfzk=; b=LINFYWzR/CTUVRfXfBYvUsJW2C2deY7V8iOrBuKKBabc1UEtPUttynrIwAdg4Kd27g aIEanJ7fDZ9FvHWJY2S87tId9n8JOk6PB6AwnYetiPMUOdqqA0fISu4CQwe4itMaYuNQ fLW8G0MeTpf/v3+XfBmaI1utIjRsnKGkUTbGk2YFh1D2Zvs8D7urGeAJeWUAWsiuPw/y YUzOKIWmPJgeimRj3oXQlBHdw2JpoBGen4zNL/IKMpd7MAnCdHGyBX3hMXbyiMwC2iC6 MZVp5ryt62pax6VVsllOU0/7/m5Io/Cld7ohxVn2DzAzQ9JoT/t2gBgpoNJ4QTc9q/Xq Kd3g== 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 j14si5666427eda.181.2019.10.11.05.05.31; Fri, 11 Oct 2019 05:05:57 -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 S1727877AbfJKMCK (ORCPT + 99 others); Fri, 11 Oct 2019 08:02:10 -0400 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:58957 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727198AbfJKMCJ (ORCPT ); Fri, 11 Oct 2019 08:02:09 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=aaron.lu@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0TejlPIB_1570795316; Received: from aaronlu(mailfrom:aaron.lu@linux.alibaba.com fp:SMTPD_---0TejlPIB_1570795316) by smtp.aliyun-inc.com(127.0.0.1); Fri, 11 Oct 2019 20:02:02 +0800 Date: Fri, 11 Oct 2019 20:01:56 +0800 From: Aaron Lu To: Vineeth Remanan Pillai Cc: Tim Chen , Julien Desfossez , Dario Faggioli , "Li, Aubrey" , Aubrey Li , 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: <20191011114851.GA8750@aaronlu> References: <20190911140204.GA52872@aaronlu> <7b001860-05b4-4308-df0e-8b60037b8000@linux.intel.com> <20190912123532.GB16200@aaronlu> <20191010135436.GA67897@aaronlu> <20191011073338.GA125778@aaronlu> 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 Fri, Oct 11, 2019 at 07:32:48AM -0400, Vineeth Remanan Pillai wrote: > > > The reason we need to do this is because, new tasks that gets created will > > > have a vruntime based on the new min_vruntime and old tasks will have it > > > based on the old min_vruntime > > > > I think this is expected behaviour. > > > I don't think this is the expected behavior. If we hadn't changed the root > cfs->min_vruntime for the core rq, then it would have been the expected > behaviour. But now, we are updating the core rq's root cfs, min_vruntime > without changing the the vruntime down to the tree. To explain, consider > this example based on your patch. Let cpu 1 and 2 be siblings. And let rq(cpu1) > be the core rq. Let rq1->cfs->min_vruntime=1000 and rq2->cfs->min_vruntime=2000. > So in update_core_cfs_rq_min_vruntime, you update rq1->cfs->min_vruntime > to 2000 because that is the max. So new tasks enqueued on rq1 starts with > vruntime of 2000 while the tasks in that runqueue are still based on the old > min_vruntime(1000). So the new tasks gets enqueued some where to the right > of the tree and has to wait until already existing tasks catch up the > vruntime to > 2000. This is what I meant by starvation. This happens always when we update > the core rq's cfs->min_vruntime. Hope this clarifies. Thanks for the clarification. Yes, this is the initialization issue I mentioned before when core scheduling is initially enabled. rq1's vruntime is bumped the first time update_core_cfs_rq_min_vruntime() is called and if there are already some tasks queued, new tasks queued on rq1 will be starved to some extent. Agree that this needs fix. But we shouldn't need do this afterwards. So do I understand correctly that patch1 is meant to solve the initialization issue?