Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4433103ybf; Wed, 4 Mar 2020 03:57:08 -0800 (PST) X-Google-Smtp-Source: ADFU+vv9ycQF/TSfSXr/8QstBbGZsDfTMg4lggPRP6da7Yfpn54TsHNcl90t3fV1qTvaMEXs1cB2 X-Received: by 2002:aca:c415:: with SMTP id u21mr1445338oif.49.1583323028574; Wed, 04 Mar 2020 03:57:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583323028; cv=none; d=google.com; s=arc-20160816; b=Tp0hNKOK0BxJkPAd4jN4ZFBjHZPBuHDO1Tup/rUbjA2TCUIVNYlG/JYN0Zob42gnxy kGSRh0BcjuqxZac6hneq3xfFWg572TXT1NuFeLPk3rTD4seV+qgsXFSHVw2SG1WepXSM CsTAd3k7zuaTPMEVZuYgm1xW31VMaGgwmfCC82bLT700vL9SuDsQYYqigYv4lKR9M83A ov6thjtMsi0HbqJocTJfesNYNvco9/T3qbpKzkLEEfCc7S/JGwCSWNU1Jnnc1DUsxweF MbVtgBoydYJ4N+wr4WROUwUrU/JmdDFLL9XcFrJQ8TC9YOXXITQkL5+yqHIH8kqYy8Ov jHKw== 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=8KGst1ceARhN0S2erqmPUjoBDzaUYfQfZODEEV8BeYQ=; b=KvDtrrwgQ/hfumxm438hxLd+V5bdG9pz4+xxf3XYUeuwLipUGcKnUcA1VXupCuwR+u e00I7upU0oY5gsV7Zie4CvotHOUeBqtp0HU2E4T8ifUZ3X/GskM/nPAmaz0lLuafPJtT 3Y4P9K2KjD3F1aMRzR1T6Rj914ea07qwVV6ND1I4uz4O8p0TwBh0DIBnFmgfPQmbwxd4 K0xF3dy+mVcgN1WMO73yuEtkxJc1hJemK4xkYFQ2HphK22eqriBM6DYh+9v+LAwiLYAd 9p/qf4NDnjItXVzvfjXKxuUOpqqLLZQrOg0wsyNVTK4xbm6i02nU8YPb7AqKtDuHMerN Ntwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yOg1Jo7K; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si969023oto.221.2020.03.04.03.56.52; Wed, 04 Mar 2020 03:57:08 -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=pass header.i=@linaro.org header.s=google header.b=yOg1Jo7K; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729428AbgCDLzf (ORCPT + 99 others); Wed, 4 Mar 2020 06:55:35 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:33767 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729380AbgCDLzf (ORCPT ); Wed, 4 Mar 2020 06:55:35 -0500 Received: by mail-lj1-f194.google.com with SMTP id f13so1708378ljp.0 for ; Wed, 04 Mar 2020 03:55:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8KGst1ceARhN0S2erqmPUjoBDzaUYfQfZODEEV8BeYQ=; b=yOg1Jo7KzdMLopESxdGS+mL3Qz5sl5hwYNd8jOj+HQOvhLJZI4fjf1oogv6Nw7vQ1m 6KQ1acWQt/meOar5gO34IqB2Qipkm0gnwiyRRZ8xNnSvVPO/4kK+zSRQx/HtzYHjid6g DCiXOEE4swpPGCIWlOj4ZtmJYwVlwfobDg1IUeBe1Ib5fiQAzMLQY6mPv541b46iBI2Q Yi04t3IzyQ/vUkCl93F9B+hIpNJfztY20ykD2fqJ0yPBNdFmYhz6bUD8FUzwi/a1vgyX aDo3yIqfsCrorbsx0XjTXNvu0wkWmFWSFJ+c2dvs7c7dLJcARNQ6ArnayAirkSU9eZYp NxnQ== 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=8KGst1ceARhN0S2erqmPUjoBDzaUYfQfZODEEV8BeYQ=; b=NzMQXj21wYd5iTybAM3IavZqMIYVmlHhgPmc4z13HiDRsw17Trb2sQ2OSaHIdSJjOV Y3waPZKAf8zRtBHh5zcOfgD6WrktsG/BNvLM25kxdAkHLLg3Y1nVSygTcyP+uQy3zwJe M8S0BV/bDcgb297iMiOKUa83RK+JoCdSMDUy+fRT0SlYNknkXQ81jLlGlmwfgvO2R8BJ sdGRrZEY3lZQ0mSqXB9F/GI11bEICfB/VO0uJBPI+dCLaSLzvCN5HAXEJBOTksHAB3yZ 82l+/iaB0poVEAH3XWgMHprOazmAV923TsvW+Zx1tNnXWgN8hc5OBrUyMpPO1SOQ/bHe uEcg== X-Gm-Message-State: ANhLgQ0C/JoJM0VcLsngk641bRU+HKf8KHLUp8h2R2YKcmY86uNX7scr oJFgD9KUtt0VORpB1rnEpvrE1pyo7yRj/aOI7xlS0Q== X-Received: by 2002:a2e:2a06:: with SMTP id q6mr1751495ljq.65.1583322933077; Wed, 04 Mar 2020 03:55:33 -0800 (PST) MIME-Version: 1.0 References: <44fa1cee-08db-e4ab-e5ab-08d6fbd421d7@linux.alibaba.com> <20200303195245.GF2596@hirez.programming.kicks-ass.net> <241603dd-1149-58aa-85cf-43f3da2de43f@linux.alibaba.com> <20200304095209.GK2596@hirez.programming.kicks-ass.net> In-Reply-To: <20200304095209.GK2596@hirez.programming.kicks-ass.net> From: Vincent Guittot Date: Wed, 4 Mar 2020 12:55:21 +0100 Message-ID: Subject: Re: [RFC PATCH] sched: fix the nonsense shares when load of cfs_rq is too, small To: Peter Zijlstra Cc: =?UTF-8?B?546L6LSH?= , Ingo Molnar , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , "open list:SCHEDULER" 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 Wed, 4 Mar 2020 at 10:52, Peter Zijlstra wrote: > > 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. yes, you're right