Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1779216ybp; Fri, 11 Oct 2019 21:12:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcEV/Lh9EpXMOxP3JkX0aF2Da4CvyyUEsc6Y1s1DVLzo7LXqRQPPVhB70ytuqtxKTFzn8F X-Received: by 2002:a17:906:68d5:: with SMTP id y21mr17184135ejr.272.1570853552383; Fri, 11 Oct 2019 21:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570853552; cv=none; d=google.com; s=arc-20160816; b=qW0gnZyxqJH4getc0wNbvlzsYc12HH61XcUZccDBZfT6Bt9n5j3hOGFCf/7JtmG8GI cHkx+krn29hr4788rU/U/gSv65uhY0tw9xLWuVJZAxAOZBKgI2oOdKefHzDNCRsrPcwI 7clfC7nNfpxaDO8EXf2ZT5c6PU5DsqEBm1ZTEWkN/tpL46tfW+w68YEJxPTMzmR+cQ3N p6TQh3lsOrExVy5iZrdHdZ/mpPZAEHSx1kI/K2ozJ/KKQMib9pD3jQjajAxUqSr0JCSB Lae4wz2brogFmzK3sghvDLqPb0M8zwtpNbHngjgAk70fRo8+k0si0HHfK8oO/iEUpTBc x8UQ== 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=1nB/DtA5Sb0vEHrEKi68/sGNt+VgESO/JlBeti/Xgpg=; b=0CKgg1YLkVYIj3ZTjyMCMfKBTBBZNEcZV6FCLr7p7QdwUR1KytvuI1R64/j2DgyIFn wNxAWMjxbA2YJOjMISh6mPXLXRWGUrlAX57P6cqDTDRRQfJkCTrTrGsiVGM2lEinNhwD sBrRZK3i8VKvoz4PzhjY9CIXumH//3aC37KIxHY7QSqrEcXiw7AlK2bPN8ZYQGbUa2W8 DQRnWFrBvTRKxkzw6sfOzBPfASC9deODruv3xCLVpVAq2j28ppOF3nBeGoqn2G2EdEbY XV/05oMCz9hx0TvR4FbjOq3ADZBpaucq3k202oLOH26buZMfbu2ygn2ZZMQIaPUiTtXL TVGg== 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 z42si7994172edz.23.2019.10.11.21.12.09; Fri, 11 Oct 2019 21:12:32 -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 S1728111AbfJLDzP (ORCPT + 99 others); Fri, 11 Oct 2019 23:55:15 -0400 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:49751 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726269AbfJLDzO (ORCPT ); Fri, 11 Oct 2019 23:55:14 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R751e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07487;MF=aaron.lu@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0TenDtwe_1570852503; Received: from aaronlu(mailfrom:aaron.lu@linux.alibaba.com fp:SMTPD_---0TenDtwe_1570852503) by smtp.aliyun-inc.com(127.0.0.1); Sat, 12 Oct 2019 11:55:09 +0800 Date: Sat, 12 Oct 2019 11:55:03 +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: <20191012035503.GA113034@aaronlu> References: <20190912123532.GB16200@aaronlu> <20191010135436.GA67897@aaronlu> <20191011073338.GA125778@aaronlu> <20191011114851.GA8750@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 08:10:30AM -0400, Vineeth Remanan Pillai wrote: > > 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? > > I think we need this update logic even after initialization. I mean, core > runqueue's min_vruntime can get updated every time when the core > runqueue's min_vruntime changes with respect to the sibling's min_vruntime. > So, whenever this update happens, we would need to propagate the changes > down the tree right? Please let me know if I am visualizing it wrong. I don't think we need do the normalization afterwrads and it appears we are on the same page regarding core wide vruntime. The intent of my patch is to treat all the root level sched entities of the two siblings as if they are in a single cfs_rq of the core. With a core wide min_vruntime, the core scheduler can decide which sched entity to run next. And the individual sched entity's vruntime shouldn't be changed based on the change of core wide min_vruntime, or faireness can hurt(if we add or reduce vruntime of a sched entity, its credit will change). The weird thing about my patch is, the min_vruntime is often increased, it doesn't point to the smallest value as in a traditional cfs_rq. This probabaly can be changed to follow the tradition, I don't quite remember why I did this, will need to check this some time later. All those sub cfs_rq's sched entities are not interesting. Because once we decided which sched entity in the root level cfs_rq should run next, we can then pick the final next task from there(using the usual way). In other words, to make scheduler choose the correct candidate for the core, we only need worry about sched entities on both CPU's root level cfs_rqs. Does this make sense?