Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4336091ybf; Wed, 4 Mar 2020 01:54:16 -0800 (PST) X-Google-Smtp-Source: ADFU+vuqOvAaG2tvM0JmUjrz/AGFkRYXkwKD1p95W6gCmLGBJg/w5jVg5Ap43cnmzLp8Ufqo57lt X-Received: by 2002:a9d:77c3:: with SMTP id w3mr1566166otl.245.1583315656568; Wed, 04 Mar 2020 01:54:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583315656; cv=none; d=google.com; s=arc-20160816; b=ujhv49jx5aIK1ZXWHzbGsDiou6B2WjpDfbk5laKj7gQ3uvJUfoRqtdA2Suf8oTYTif 4llgxdGqeLtDsILb+AbWBXoKlYY0blUbk4Jde28ejOo9C0fcmkF0V8BXEW7N9jmAFsQm EqwhYDPLY6Xk4t+QjPIPvIp1AfgDLalsozGkOgTLCxqbPgkqd8uLozhWpoX5fw0DRCJ+ XrK/HaD2XTTjuVuIGFKGBZrsvXk3W7z7OuUFstLG2D7ZtHPNJnz4sc963QxeEwZwKnjU 5UJ0zQYo/sg6bGd41tZ+Sfz9ImT3mgWgQiu4iA0+6CJwyWszNQ2p8axuRaYE1bCEUadx 1qVw== 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:dkim-signature; bh=tKeqTycVyzl7DYa83kr4ZG5LIFgM+C0+xw2HEdA4qUM=; b=UvKGkVHZNGJqGH3M5q0lBZmXUJg88/pCtLpkWgpO/rPmRS4KJ+SLj3b2+qUna5jxpX ZCm+tdd7ngiJ3p6Ss6Yh7JI+42XKgp/Jw3d91PLOdQduUhqdiWNwozfcHhEbKimkSuLF CdBegwhvr4W7iaW5cFDryNrwdWM0rhPLQRcaKV7OkIs46HwWy1EZ8Ch1/XKHG0Tf0HAh cQoPSzMDiKGYoAkUgHxLjteWKz2uH8a1WGMic/anv1BxuAOZQNPlKDueqPqCUHz52zfF aPoCsxlVU8gUFRt8xl/E8QVGtYvGGt7TuxeC/a3TvpRnQue431XmBYnoNlHbgjl7JyFZ wv8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=yjYfo81n; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a23si866191oie.81.2020.03.04.01.54.05; Wed, 04 Mar 2020 01:54:16 -0800 (PST) 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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=yjYfo81n; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729232AbgCDJwg (ORCPT + 99 others); Wed, 4 Mar 2020 04:52:36 -0500 Received: from merlin.infradead.org ([205.233.59.134]:37842 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728301AbgCDJwg (ORCPT ); Wed, 4 Mar 2020 04:52:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tKeqTycVyzl7DYa83kr4ZG5LIFgM+C0+xw2HEdA4qUM=; b=yjYfo81n1EmRA/Vrnh0lQnkx/k 5xXLtLgwJ10Y9SLDxuI4PBjCO1W2r4cvmVeKywMJOJVacUf4nOs0xlHZmHqjBpOm1GTqaw02TV1ZM rg8sqrC5iQI+ZtsTS3UK5mCT6v6NyC/a0Y6K1n3LedZOWexjSQQdHDhcE9KwIGkcIfyE+UzltDDyA 63ZEH7V4LkiiJqvAKpIRDoFb+z+j3ZmcYTAvxhEHFBWrnRhLbzHI3cNYswND2ZdAIZ8FnKwNhZE5c k8gLaOsEcz5HzfqQq2c8HZQokvYkHxuYy4L1OqFakL1toaDKw9e0uWp1SiKMt9TFiPvfOZsTKcYNd j8DCBvCg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1j9QhI-00082P-V4; Wed, 04 Mar 2020 09:52:13 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7DBE43012C3; Wed, 4 Mar 2020 10:50:11 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F140820BCBDC5; Wed, 4 Mar 2020 10:52:09 +0100 (CET) Date: Wed, 4 Mar 2020 10:52:09 +0100 From: Peter Zijlstra To: Vincent Guittot Cc: =?utf-8?B?546L6LSH?= , Ingo Molnar , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , "open list:SCHEDULER" Subject: Re: [RFC PATCH] sched: fix the nonsense shares when load of cfs_rq is too, small Message-ID: <20200304095209.GK2596@hirez.programming.kicks-ass.net> References: <44fa1cee-08db-e4ab-e5ab-08d6fbd421d7@linux.alibaba.com> <20200303195245.GF2596@hirez.programming.kicks-ass.net> <241603dd-1149-58aa-85cf-43f3da2de43f@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 04, 2020 at 09:47:34AM +0100, Vincent Guittot wrote: > you will add +1 of nice prio for each device > > should we use instead > # define scale_load_down(w) ((w >> SCHED_FIXEDPOINT_SHIFT) ? (w >> > SCHED_FIXEDPOINT_SHIFT) : MIN_SHARES) That's '((w >> SHIFT) ?: MIN_SHARES)', but even that is not quite right. I think we want something like: #define scale_load_down(w) \ ({ unsigned long ___w = (w); \ if (___w) \ ____w = max(MIN_SHARES, ___w >> SHIFT); \ ___w; }) That is, we very much want to retain 0 I'm thinking.