Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp330999pxb; Thu, 25 Feb 2021 03:54:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxgfDnMPDmyJDL6i9VeMpE1G9mvVmIJvAP2U6lhXiEgVTGyHqDkOsiopgkJHrdernKoAKy X-Received: by 2002:a17:906:6087:: with SMTP id t7mr2345018ejj.90.1614254044769; Thu, 25 Feb 2021 03:54:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614254044; cv=none; d=google.com; s=arc-20160816; b=DZjv06oggGTHm5ZYrnbuC1G+0MF2YHtltx0hLNv1fbK5mLC4oFumCtSbsU9z5qJVRx HYBW0VEanoqpkbBk9VW7v5U5vJxIV2nQkTMRYPY/p2qf0ZWZ6D4gMXdMo8ga2mQdUPjH LrpnwkLcof0jh0mgiZ9F155sqFRIa/L+xjdQngo7FcxsUZeL9Rq/8vlJ0uIdRQRpIb1Q 93oh5loeyq4dQFjW+9enDZA4IMDTaQVU/pZt/YWnnJc3fU6+zfbTpuHELDARai1HYxgE zuPk24NmJG3NIpI9x/d2eAgmhG2G5E+SWAVEBLyHFkfAuvujl/u2SVFmChrLZvrREvmt m0aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=UknmL3Ln104+wfTsfYVZ54bPabijCKLOkrDAkLG/DcE=; b=FZhJbP9fIa4U6kQhMpUdOgyTX5/XMGYJr2KxiVk/1aPGiGK+uD4I7sFe5jRNv7jDoA jLVF3/qXJ3i3p2BJASMlpEtvzMaDuCaFFkcAlY0YVHO1NNKNPvxYfKOxObyhHrwNL1MT JJ48Uk19R0e8hE5u0jcSoRJnsWWLULOe+MGtmatrnZ0rlqBf/s0p2dy5ZEo+4XihGown iTS9Wq9zooLq/PRNc4Xx7zt3iQFIDfRQ/XDOI9WAY3nnox0+LixFZZ5qXRgmZl5swLoL turlWr6lFZDj+wVTztRMryJWsVecroE9h9t5mXkhmxqkMTZWgwyVcukOSDWdV0rU/NE8 WqJg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j2si2578211ejx.646.2021.02.25.03.53.42; Thu, 25 Feb 2021 03:54:04 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233594AbhBYLrc (ORCPT + 99 others); Thu, 25 Feb 2021 06:47:32 -0500 Received: from foss.arm.com ([217.140.110.172]:55646 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232778AbhBYLr2 (ORCPT ); Thu, 25 Feb 2021 06:47:28 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EF107D6E; Thu, 25 Feb 2021 03:46:41 -0800 (PST) Received: from [192.168.1.15] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 504733F73D; Thu, 25 Feb 2021 03:46:40 -0800 (PST) Subject: Re: [PATCH v2 2/2] sched/fair: use lsub_positive in cpu_util_next() To: vincent.donnefort@arm.com, peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org Cc: linux-kernel@vger.kernel.org, qperret@google.com, patrick.bellasi@matbug.net, valentin.schneider@arm.com References: <20210225083612.1113823-1-vincent.donnefort@arm.com> <20210225083612.1113823-3-vincent.donnefort@arm.com> From: Dietmar Eggemann Message-ID: <6bf917f3-1581-25ca-1330-3084194a4973@arm.com> Date: Thu, 25 Feb 2021 12:46:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210225083612.1113823-3-vincent.donnefort@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/02/2021 09:36, vincent.donnefort@arm.com wrote: > From: Vincent Donnefort > > The sub_positive local version is saving an explicit load-store and is > enough for the cpu_util_next() usage. > > Signed-off-by: Vincent Donnefort > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 146ac9fec4b6..1364f8b95214 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -6525,7 +6525,7 @@ static unsigned long cpu_util_next(int cpu, struct task_struct *p, int dst_cpu) > * util_avg should already be correct. > */ > if (task_cpu(p) == cpu && dst_cpu != cpu) > - sub_positive(&util, task_util(p)); > + lsub_positive(&util, task_util(p)); > else if (task_cpu(p) != cpu && dst_cpu == cpu) > util += task_util(p); Reviewed-by: Dietmar Eggemann