Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3362780ybp; Sun, 13 Oct 2019 05:45:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgldtstTkCV91i7AhJeT/762aPzB1xvxCDxxLPT7x9T17hgvrYpvv5fGvC+5Gx3HEMwY2a X-Received: by 2002:a17:906:19d9:: with SMTP id h25mr22945756ejd.297.1570970746775; Sun, 13 Oct 2019 05:45:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570970746; cv=none; d=google.com; s=arc-20160816; b=Q6mL9BOhs1NS4NhzASp3eKw/km8ahLjNdlA3+MXNLMG9D4fKDLGYz0mYyfezTXGJEk kojeJjXmVWJFrsIS8XN8D0T6Uqyyg29IZh8x2F00p6DprmLK1g88BcmnXYVx9APnN2bv stCQQpp915hxfa7MCS8CKFap5YMJtnu/Q5Ppyv9sIExvUBr9oHPNhS1ACGo6OdIwzDME kX3Fp1Dn7/BXwxp6ixV+Cq1Dzzne+MIbxKw8dKBEX/cYdZ3xQwQLp91TisJo+/98XsEL crNQTcETtf99tjfav2gv6Miehlv4cjqumZaENksTszbKho8q/e+SDCBRv1Fhypu/8JLt GUVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=h3US1YpCNnCbUgNT1GPpUvzikfVR1h1FRwVNOVDSOqE=; b=J4WIHL4UofK6H5kJqPqJlMw78KdygE6swLsViRcHYgkJEx41snf0W62HRbLW1j2brn W8S2or98C9KeibN58vKl1b9mfdHbBADyQIWsxGZXGufmK8wTRU6tMBF/PAVLyRo4oYZY EI+iMnd4EJ7BMF9enB/NtV2WjZcNe2tD2kJLWeuNgHh0+orTjNituP99F//kyQ4j2rT3 je5PDvSDJsuY1DwNtJ6VkXmbJ2eixIgcGG5OoiUIwNfjXFY02dn82P6UWwIbC6SEKPe+ b/0kk73TeuqwNjSv1us/oEiHDy6YBqcNEBhWmRstmtT2fU1BWfeDIU4bZOD0F0j5Tvd2 bRIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digitalocean.com header.s=google header.b=SBN5REzk; 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=REJECT sp=REJECT dis=NONE) header.from=digitalocean.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u14si9225716edq.167.2019.10.13.05.44.52; Sun, 13 Oct 2019 05:45:46 -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=@digitalocean.com header.s=google header.b=SBN5REzk; 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=REJECT sp=REJECT dis=NONE) header.from=digitalocean.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728508AbfJMMoq (ORCPT + 99 others); Sun, 13 Oct 2019 08:44:46 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:38789 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728159AbfJMMoq (ORCPT ); Sun, 13 Oct 2019 08:44:46 -0400 Received: by mail-oi1-f196.google.com with SMTP id m16so11657053oic.5 for ; Sun, 13 Oct 2019 05:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digitalocean.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=h3US1YpCNnCbUgNT1GPpUvzikfVR1h1FRwVNOVDSOqE=; b=SBN5REzkBXcLX9aBB3cOWFxG8TFRqF94/v5HDsN2Jc6svbAljItH5wBkpBGF6p0sUA aihBnsfukVp8zN4L5SUQb0CSqyOspBrzLCLCNaDSeIBP9mvFeICK4C9Y1jrOjpWr48fH 87VW0dkx/zo48Y5721wltuECedzkKawxW+HZs= 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; bh=h3US1YpCNnCbUgNT1GPpUvzikfVR1h1FRwVNOVDSOqE=; b=f5MhPqev7r676CTYJR1SDFtNeAM81P+gtwIHz0UlYu7BCU/ejCyRVjcfwY8KDmhAvF sCROcKPmd/U5HNu4MxuMvE3nq365ZYCQRIQWwQoABj7t76cFK6hVQPVErdQDX1Z4mzaq Ch2KSR1oGSlHG5Nh5+JMvuC17PLcqACxHRaOv9qNDJGZ/7u6OJJyksrAfaJO5NRC0zHc zj0Nh9lEFjuGZ7d6461HxQ3On9ImwUpDRj6VHgySNEwFan7GRn4CJLW7AnrSVmaoFqBp T2ejH5GOYgc2gaeoTNEIpTXHY4edVQavSEYtXvsqSDz24uy6/UoN5LDe2cjdI51ykrhV JAXw== X-Gm-Message-State: APjAAAUCpEY+b1cqdyTtpQ+OYlpQiFIlIK53sQD9Bs2/F9ET4kew65Z2 Bk7vjfqL37jlA3T5Lzze2MchOgkykZyDgP9dOqWlVg== X-Received: by 2002:aca:a9ca:: with SMTP id s193mr5974772oie.85.1570970683812; Sun, 13 Oct 2019 05:44:43 -0700 (PDT) MIME-Version: 1.0 References: <20190912123532.GB16200@aaronlu> <20191010135436.GA67897@aaronlu> <20191011073338.GA125778@aaronlu> <20191011114851.GA8750@aaronlu> <20191012035503.GA113034@aaronlu> In-Reply-To: <20191012035503.GA113034@aaronlu> From: Vineeth Remanan Pillai Date: Sun, 13 Oct 2019 08:44:32 -0400 Message-ID: Subject: Re: [RFC PATCH v3 00/16] Core scheduling v3 To: Aaron Lu 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 , =?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" 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 11:55 PM Aaron Lu wrote: > > 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). > Ok, I think I get it now. I see that your first patch actually wraps all the places where min_vruntime is accessed. So yes, the tree vruntime updation is needed only one time. From then on, since we use the wrapper cfs_rq_min_vruntime(), both the runqueues would self adjust from then on based on the code wide min_vruntime. Also by the virtue that min_vruntime stays min from there on, the tree updation logic will not be called more than once. So I think the changes are safe. I will do some profiling to make sure that it is actually called once only. > 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. Yeah, I noticed this. In my patch, I had already accounted for this and changed to min() instead of max() which is more logical that min_vruntime should be the minimum of both the run queue. > 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. > Understood. The only reason I did the normalize is to get both the runqueues under one min_vruntime always. And as long as we use the cfs_rq_min_vruntime from then on, we wouldn't be calling the balancing logic any more. > Does this make sense? Sure, thanks for the clarification. Thanks, Vineeth