Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4269060ybz; Mon, 20 Apr 2020 19:53:04 -0700 (PDT) X-Google-Smtp-Source: APiQypIrq/sHrcvRIGnTMlr7Jt3eSV9+an0UqRyOkwy8C67y+Fs2GInRcD2pthIi7ZSLZ4W7CnHI X-Received: by 2002:a17:906:c82b:: with SMTP id dd11mr18093065ejb.216.1587437584544; Mon, 20 Apr 2020 19:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587437584; cv=none; d=google.com; s=arc-20160816; b=rPqr5h8YNXGubHLOdBvR1bSGeKigjjvbpGvWno54L6fsSKPmlhHKWBCYMGRPjXAXWj 0ID80UNSlBY1xHNFraHoX1AXmcJYiklsH6e6mJ+uT9WEAEBD1SCqakNO7PtP83ap/7Vi VXU0LgkthW4zyLLSUJvlm+5d9j4PNdUkf3TMr8pVsG4gqjqqgQerDq48Vp/f0IwmJrsG iojcVYaPjHylemBgGIL/VD2mEUmk5M033Ycg7+HCGLcUeNkZeM21rdvQ1NvZ8HIDhEGs 03jPJHQjmm11dCVZWo7H+dIhrUzMSF7VXwPT14IqQAKnCBgSfrhGhFUGJsYEv1ehbxdz RWag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=IOYiW0cFU06Y60gljkCOtUC5CPSaXPSr8wG1AO8tdlg=; b=KUYb5g373cEGli8cbg3zIbVAcr40ADDmSwTOMte7pXdQMxltnijI5qUUeCzPPUOiVL nkk65rFm3wOEgz4Lp9dFpzkCPZ43v8aHUYaiwEKFI/rrOeHkySCdIErLlIuPUP59QIPH 6mjZfubCwvHdWUa8MKIx4XG0ZSgMP098O34cJ20PnJtEMZV4m77cJ1YVlhlykT3MghRx DNrvcbkeJX8f4Yurr2XFyVHOcAqt/BwwzocBamQlpa/nlL5K45ZKVTBVU/fUNcct0CLV /LLZELLGCrSMgLqjlwDOF/YmUOayNOQZLGa6wv4fDk+MVeP0QqGrOQqWQJXUy/FdkspZ wZGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U8DLC6Uv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id q24si724417eju.147.2020.04.20.19.52.41; Mon, 20 Apr 2020 19:53:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U8DLC6Uv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726817AbgDUCvm (ORCPT + 99 others); Mon, 20 Apr 2020 22:51:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725829AbgDUCvl (ORCPT ); Mon, 20 Apr 2020 22:51:41 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C29AC061A0E for ; Mon, 20 Apr 2020 19:51:41 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id ay1so4723589plb.0 for ; Mon, 20 Apr 2020 19:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=IOYiW0cFU06Y60gljkCOtUC5CPSaXPSr8wG1AO8tdlg=; b=U8DLC6UvGzn3yX4U5EL788c3XjR5qwjwp+otHn8goLviyguy500btfkwryCJF70/UK Yn4Ya1Oe57h489iWtFrjX6zVkOVWmGR9vzXItfTzVadrPXeyjS8zy5Ok/Oj3DmUygG0l K3ll1O6E6smgQ+fmrWapftB5MjBa3wFstmKhtMUtH3uqG1yNMMP0bHVhO3n8m9YAQfXu EMfvemgVZ2mp7jrLelChT0u6M0IXtl0MUzqnbxV5qeonA+U3WVg/YciJ4tKyrIOkmXSk uMID9uDLS1/2eTIM/nehg3bNPEpcpswvjHurq7qg2DQXDQDfYpDDByrOuT/dWF3WzxvO IlBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=IOYiW0cFU06Y60gljkCOtUC5CPSaXPSr8wG1AO8tdlg=; b=Y+DqPtEgTQPZHZ0bArSw+FKAgckjaL/z06oOE4hgmtXKEHu091dtP/KFJSczs5VTrr t9B7Lv6ufnkyBHfmPuMKBHsLjxWHKkFliTVD5V6ZbvYjOeJ7zBuQv2Oey7VoG6ecxZp3 nkGNVRL6VYVv4/fPExdySc6iexrr5TnnSYbFaIh3qA+JKEF4nTNVjyt1p69H3FKLd0+D 4OI1JiQ5d/MQlXvTehmLyLOXLaxL5rEy02ynLx8wxyA8INZ5nDREtVFLqXiljDX3MKXV ZKxPuKTD/maffscVwSbBzBv/PN9j0X6Nwp8HigcHVygBiQmHEQbdPAJ59kAqaLWUHbCw m4vA== X-Gm-Message-State: AGi0Pub98WwTchEC9uwtjFL12sV7ogjCd544E1P+OhX9zD6nVp8lE4m1 1jqlRir52hmUdtlqTxX0Pew= X-Received: by 2002:a17:90b:19c1:: with SMTP id nm1mr2907310pjb.73.1587437500997; Mon, 20 Apr 2020 19:51:40 -0700 (PDT) Received: from aaronlu-desktop ([47.89.83.64]) by smtp.gmail.com with ESMTPSA id p189sm896122pfp.135.2020.04.20.19.51.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 19:51:40 -0700 (PDT) Date: Tue, 21 Apr 2020 10:51:31 +0800 From: Aaron Lu To: Vineeth Remanan Pillai Cc: Peter Zijlstra , Nishanth Aravamudan , Julien Desfossez , Tim Chen , Ingo Molnar , Thomas Gleixner , Paul Turner , Linus Torvalds , Aaron Lu , Linux List Kernel Mailing , =?iso-8859-1?Q?Fr=E9d=E9ric?= Weisbecker , Kees Cook , Greg Kerr , Phil Auld , Aubrey Li , "Li, Aubrey" , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini , Joel Fernandes , Joel Fernandes Subject: Re: [PATCH updated] sched/fair: core wide cfs task priority comparison Message-ID: <20200421025131.GA227300@aaronlu-desktop> References: <2f83d888890cec14be3a7aead0859dceebb4012f.1583332765.git.vpillai@digitalocean.com> <20200414135624.GU20730@hirez.programming.kicks-ass.net> <20200415033408.GA168322@ziqianlu-desktop.localdomain> <20200415040741.GA169001@ziqianlu-desktop.localdomain> <20200417094045.GA197704@ziqianlu-desktop.localdomain> <20200420080759.GA224731@ziqianlu-desktop.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 20, 2020 at 06:26:34PM -0400, Vineeth Remanan Pillai wrote: > On Mon, Apr 20, 2020 at 4:08 AM Aaron Lu wrote: > > > > On Fri, Apr 17, 2020 at 05:40:45PM +0800, Aaron Lu wrote: > > > The adjust is only needed when core scheduling is enabled while I > > mistakenly called it on both enable and disable. And I come to think > > normalize is a better name than adjust. > > > I guess we would also need to update the min_vruntime of the sibling > to match the rq->core->min_vruntime on coresched disable. Otherwise > a new enqueue on root cfs of the sibling would inherit the very old > min_vruntime before coresched enable and thus would starve all the > already queued tasks until the newly enqueued se's vruntime catches up. Yes this is a concern but AFAICS, there is no problem. Consider: - when there is no queued task across the disable boundary, the stale min_vruntime doesn't matter as you said; - when there are queued tasks across the disable boundary, the newly queued task will normalize its vruntime against the sibling_cfs_rq's min_vruntime, if the min_vruntime is stale and problem would occur. But my reading of the code made me think this min_vruntime should have already been updated by update_curr() in enqueue_entity() before being used by this newly enqueued task and update_curr() would bring the stale min_vruntime to the smallest vruntime of the queued ones so again, no problem should occur. I have done a simple test locally before sending the patch out and didn't find any problem but maybe I failed to hit the race window. Let me know if I misunderstood something. > Other than that, I think the patch looks good. We haven't tested it > yet. Will do a round of testing and let you know soon. Thanks.