Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6149860ybv; Tue, 18 Feb 2020 10:54:34 -0800 (PST) X-Google-Smtp-Source: APXvYqy91uoj94HChMPZBqebQyQJCqbchsYlsc21pw1gLSqRYu+MrXxeGC6FuCHsQNqpsgINkECQ X-Received: by 2002:a9d:7d8b:: with SMTP id j11mr17699716otn.259.1582052074349; Tue, 18 Feb 2020 10:54:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582052074; cv=none; d=google.com; s=arc-20160816; b=Tlr1/ABY/QmbBCY5y+bjqfpDjfJN90seblXeai6fhTdyIivukxFG9XSkk3Xhs5WQAO Gua0w1DQLBf31IGpjvMSqBwU48462fpAPXW+JyEVV6CGcIyOvGjGLcHLJ8O8RC0LtxqQ JdFnDAd+jdrlYB3zO6xZAuz8gt7O+wRPlPE48iEOlUxho5Bfctp61jtOpKizwOPv/WII 6fZ9eRIVvnLICqwDv+kTnnyUxN3xtbGbqMhEIjmfWgit53185m3wGCd5bXDTQSiwhcQI 19W1/m6bgZa+DxX2tJ36ZZcY0YCoXbgjOCGUMgFo7NsWbyAxVlHSXPDnRXalS17K7eVa fKjw== 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; bh=XAdWnGLIwxuQVBfebw/R0fZ4Iwk3Yb2joHrqAf+86vU=; b=pHftPFj/Lvs4rpkzb8ivzkGuKuBAxJwjt2trvIxpu5geg4ZI4dG3Fs4ri2SGB5mMIS IZsGS8B+qAOBt9e5U2kH3HN1bvIBFozpjmSCygj2/7fZ0OI8nSLhNzoj9F6F9N6p0+nb 5FyONuov8mxMWOUU1tuGJSvbaaLdgNZ+cNRFh+U3wVzILQMcmJeQzVYaeth6YSpq2TTm u6fn7OY3jvixxiiV2TjAHawzDoRydwBI+28R2nNHRA2jVSUdlYveWPdXPD+bOvRzjlci xOZiQu3VroFi54EIAYLGxZZhB0bPNRXPC/ioyYwyc/REmdgqC3NBduNDXgZRo2zUeIBV AZng== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x26si2104553otk.325.2020.02.18.10.54.22; Tue, 18 Feb 2020 10:54:34 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726401AbgBRSw7 (ORCPT + 99 others); Tue, 18 Feb 2020 13:52:59 -0500 Received: from foss.arm.com ([217.140.110.172]:58972 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726291AbgBRSw7 (ORCPT ); Tue, 18 Feb 2020 13:52:59 -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 B25D231B; Tue, 18 Feb 2020 10:52:58 -0800 (PST) Received: from e107158-lin (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 642823F703; Tue, 18 Feb 2020 10:52:57 -0800 (PST) Date: Tue, 18 Feb 2020 18:52:54 +0000 From: Qais Yousef To: Steven Rostedt Cc: Dietmar Eggemann , Ingo Molnar , Peter Zijlstra , Pavan Kondeti , Juri Lelli , Vincent Guittot , Ben Segall , Mel Gorman , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] sched/rt: cpupri_find: implement fallback mechanism for !fit case Message-ID: <20200218185253.yryfozr7jf2ve4lv@e107158-lin> References: <20200214163949.27850-1-qais.yousef@arm.com> <20200214163949.27850-2-qais.yousef@arm.com> <20200217234549.rpv3ns7bd7l6twqu@e107158-lin> <20200218114658.74236b3c@gandalf.local.home> <20200218172745.hd7fxjqnzqkhfqx3@e107158-lin.cambridge.arm.com> <20200218130300.679f77ea@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200218130300.679f77ea@gandalf.local.home> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/18/20 13:03, Steven Rostedt wrote: > On Tue, 18 Feb 2020 17:27:46 +0000 > Qais Yousef wrote: > > > > If we are going to use static branches, then lets just remove the > > > parameter totally. That is, make two functions (with helpers), where > > > one needs this fitness function the other does not. > > > > > > if (static_branch_unlikely(&sched_asym_cpu_capacity)) > > > ret = cpupri_find_fitness(...); > > > else > > > ret = cpupri_find(...); > > > > > > if (!ret) > > > return -1; > > > > > > Something like that? > > > > Is there any implication on code generation here? > > > > I like my flavour better tbh. But I don't mind refactoring the function out if > > it does make it more readable. > > I just figured we remove the passing of the parameter (which does make > an impact on the code generation). Ok. My mind went to protecting the whole function call with the static key could be better. > Also, perhaps it would be better to not have to pass functions to the > cpupri_find(). Is there any other function that needs to be past, or > just this one in this series? I had that discussion in the past with Dietmar [1] My argument was this way the code is generic and self contained and allows for easy extension for other potential users. I'm happy to split the function into cpupri_find_fitness() (with a fn ptr) and cpupri_find() (original) like you suggest above - if you're still okay with that.. [1] https://lore.kernel.org/lkml/39c08971-5d07-8018-915b-9c6284f89d5d@arm.com/ Thanks -- Qais Youesf