From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C34BC433E6 for ; Wed, 3 Feb 2021 18:44:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C150364F91 for ; Wed, 3 Feb 2021 18:44:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232747AbhBCSoF (ORCPT ); Wed, 3 Feb 2021 13:44:05 -0500 Received: from foss.arm.com ([217.140.110.172]:45034 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232856AbhBCSnt (ORCPT ); Wed, 3 Feb 2021 13:43:49 -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 B22AC11FB; Wed, 3 Feb 2021 10:43:02 -0800 (PST) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 610A03F719; Wed, 3 Feb 2021 10:43:01 -0800 (PST) From: Valentin Schneider To: Qais Yousef Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Vincent Guittot , Dietmar Eggemann , Morten Rasmussen , Quentin Perret , Pavan Kondeti , Rik van Riel Subject: Re: [PATCH 3/8] sched/fair: Tweak misfit-related capacity checks In-Reply-To: <20210203151515.4uphnp2lbch57v6y@e107158-lin> References: <20210128183141.28097-1-valentin.schneider@arm.com> <20210128183141.28097-4-valentin.schneider@arm.com> <20210203151515.4uphnp2lbch57v6y@e107158-lin> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Wed, 03 Feb 2021 18:42:59 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/02/21 15:15, Qais Yousef wrote: > On 01/28/21 18:31, Valentin Schneider wrote: >> @@ -113,6 +113,13 @@ int __weak arch_asym_cpu_priority(int cpu) >> */ >> #define fits_capacity(cap, max) ((cap) * 1280 < (max) * 1024) >> >> +/* >> + * The margin used when comparing CPU capacities. >> + * is 'cap' noticeably greater than 'ref' >> + * >> + * (default: ~5%) >> + */ >> +#define capacity_greater(cap, ref) ((ref) * 1078 < (cap) * 1024) > > nit: can we use cap1 and cap2 and make the implementation use '>' instead of > '<'? ie: > > #define capacity_greater(cap1, cap2) ((cap1) * 1024 > (cap2) * 1078) > > this is more intuitive to read IMHO. Especially few lines below we have > > return capacity_greater(ref->sgc->max_capacity, sg->sgc->max_capacity); > > which pass 'ref->...' as cap which can be confusing when looking at the > function signature @ref. > Unfortunate naming indeed... And I suppose it can't hurt to follow the argument "declaration" order.