Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5092148ybf; Wed, 4 Mar 2020 17:11:28 -0800 (PST) X-Google-Smtp-Source: ADFU+vvimxpppRYRHH/wH9shjksGYha8fng8MSwoWza+W6mIAdRiXmFoQFdtnT5b0X3NcBx/DF64 X-Received: by 2002:a9d:3b6:: with SMTP id f51mr4821528otf.255.1583370688354; Wed, 04 Mar 2020 17:11:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583370688; cv=none; d=google.com; s=arc-20160816; b=ebzOBv+joBp6xRdgTU4n3Ei/xE/Q/aX/Z6XBHf3vUGrBe9goQC0Z3vNOAINAYNO+1h CErEDG3s2RO+50yfDr+ivJ4BkmPO6ztDiA3YyPTqHe086TMotyHI/t+mC28Y/LJL+xUM TCoqtY+tO+Qtheke8Sla96EaZ1LD9L2BPFMN6tDeG18vuHO/wX5fBARKFVEGuvmNk66s Oiu/weuwubuRJ0+h6Oq3oKe5/M2IxVwZ4bpv9vkL6ZPLy61EzjIUDmzhtA3CCp74lQq/ cyAf/J+FsTd37AdSJwwEYlJbXQXsihOqPCJ1F/Y3P5dZpsOP9VZDMBf47qM003hWtlgQ fljA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Z4P+zYE/fe1eLJrCIebGaSY7q5753BsPS3ZCDBZzMVE=; b=JMlwBE4M9bSCeU0d4u5v6bm6r9gmqER86zvU4KHe08YGY55HT2rqFKwCAsbKnvC8jL 2jAvPdqsu1kRN5Ng3L2mO2s2YtBH1w65e+ZnfFezuYf7VU5jDSF0440+pZXAAI+quMv7 CelL6wuwb9VjA9BMi59t5HEGzHJZI8e4MUu31aR5m2jp7VK+stDIV9RAYM6qGf9T9jvP lpQ3MEXQu9KOTmqpYGdWbBnBHHsu5NfCNqV8/tiRjrwr2y8pWFLzNUKPUwmmd8FL1yJe FPRjSKrBCQ1agkjIE9jPFg5hlybyvqbvBjZUxe4Z5FreMGsrSjyUnKNlU/K0GdA35yo6 OUTw== 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 e17si833262otq.272.2020.03.04.17.11.07; Wed, 04 Mar 2020 17:11:28 -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; 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 S1725875AbgCEBIY (ORCPT + 99 others); Wed, 4 Mar 2020 20:08:24 -0500 Received: from out30-44.freemail.mail.aliyun.com ([115.124.30.44]:43688 "EHLO out30-44.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbgCEBIY (ORCPT ); Wed, 4 Mar 2020 20:08:24 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R821e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=yun.wang@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0Trh.EBT_1583370490; Received: from testdeMacBook-Pro.local(mailfrom:yun.wang@linux.alibaba.com fp:SMTPD_---0Trh.EBT_1583370490) by smtp.aliyun-inc.com(127.0.0.1); Thu, 05 Mar 2020 09:08:21 +0800 Subject: Re: [RFC PATCH] sched: fix the nonsense shares when load of cfs_rq is too, small To: Peter Zijlstra , Vincent Guittot Cc: Ingo Molnar , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , "open list:SCHEDULER" 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> From: =?UTF-8?B?546L6LSH?= Message-ID: <0489ca96-29a3-921e-ca29-00108929a041@linux.alibaba.com> Date: Thu, 5 Mar 2020 09:08:10 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200304095209.GK2596@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/3/4 下午5: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. Should works, I'll give this one a test and send another fix :-) Regards, Michael Wang >