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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 E2FAAC74A5B for ; Thu, 11 Jul 2019 17:06:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB78521019 for ; Thu, 11 Jul 2019 17:06:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jZJBkpVD"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="U9sxa8fS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB78521019 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=z+risikFdCjrbXXiSnbKhmEJb/gWR7UhrFw2PqI8qSo=; b=jZJBkpVDYeX0rE kwavcoALbseKFjKnnVsaQmQXS3wY1NpV1+VFpWBYKr1wGDaf9pRjRRDFHbFSxU6pScaRrJAidU4F6 v4EAGuccH4GjpqQ84qDH0fIAnwkqollDKpwG4nieXdkrAZh9vyTj0g2C5XEJmK/SOCd2PPwkYjk/k QBeNR6fDlRgerxOO+CxBQgeQybZVNzq3Xu8Mha4K8ipGHM600Xox1sIIK+Dre6/fRniewFtLFksaO DYzF9RCIOYVIRhJH7iI0sc6naoNmG4jYpLyGbGru+NrJVPpVBojkV3uy59fKdghp3ECHaw99WGHcc G5Wy+c8I6ao1zTuZw95w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hlcWu-0006qZ-Bl; Thu, 11 Jul 2019 17:06:48 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hlcWr-0006px-KA for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2019 17:06:47 +0000 Received: by mail-lj1-x244.google.com with SMTP id i21so6538358ljj.3 for ; Thu, 11 Jul 2019 10:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5j7z1tlACT61nuFnKG/Eec995GLAXwXEnm5NfF1n5nI=; b=U9sxa8fSXSruS90asSicj9t1oMJy9v72igCT9Qbcik/hA2dpzv/9CUHo6btpjcTrSD gIE4ApjaO9/tQ754+nqPWc101+0P0JsvUDPMdMxiR0PybRR3o1Q2vBtMpkFcY9U8ArJJ sO5KOKBFMbHuR+7UAixtCB9tDnCSusoxMLLTY= 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=5j7z1tlACT61nuFnKG/Eec995GLAXwXEnm5NfF1n5nI=; b=jo++3rFhQbPEpwLRso0doUEDX/Fqcos5Xxt3W5T9uu0RVtF/3Z2jj26TUgKhizCg3P Cu7EuAKgjpJ37l+x8rUDGKR6YwKoTTifpU4o+0JUypq9oCMuEhKIiRz/vJdyezcOU56Z a3HOE8YNAQjeV3Lb+aYrGH+++8iuQUe/K7mkYfeS0aERKTdrWip1q6BmhKIQcueEmcVN gu2T1Z4rZzpKWmpr6aDcTH8cTmGVMjdk51usmV34Nehg8qG1S4hEMVVXUn9OLgaDy3jw pe3ayf+84Sz7kosMo/HY/cZoV8VRvyWS9M/QDhZKoHRCmbAall+nUycq84fxQvVld9J8 OSIQ== X-Gm-Message-State: APjAAAW+eE3kuOAmcYh4m6nS90mPJW3QARDIGDnQTdvkemQVjMAvmVf2 tWdxT9LqHGlKU+pmBfchpth7oYfYO6s= X-Google-Smtp-Source: APXvYqyWiBSIvkOQJ8CZMnPQmga27ceeS9mvNo7bGYBAlHJq5zx4x0LqJwkAzAwQ0cJ80MAifEvRtw== X-Received: by 2002:a2e:8756:: with SMTP id q22mr3247160ljj.108.1562864803278; Thu, 11 Jul 2019 10:06:43 -0700 (PDT) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com. [209.85.167.44]) by smtp.gmail.com with ESMTPSA id d3sm804060lfb.92.2019.07.11.10.06.41 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jul 2019 10:06:41 -0700 (PDT) Received: by mail-lf1-f44.google.com with SMTP id s19so4550347lfb.9 for ; Thu, 11 Jul 2019 10:06:41 -0700 (PDT) X-Received: by 2002:ac2:4839:: with SMTP id 25mr2410156lft.79.1562864800872; Thu, 11 Jul 2019 10:06:40 -0700 (PDT) MIME-Version: 1.0 References: <20190618091724.28232-1-georgi.djakov@linaro.org> <20190618091724.28232-2-georgi.djakov@linaro.org> In-Reply-To: <20190618091724.28232-2-georgi.djakov@linaro.org> From: Evan Green Date: Thu, 11 Jul 2019 10:06:04 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] interconnect: Add support for path tags To: Georgi Djakov X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190711_100645_694475_D66D25A7 X-CRM114-Status: GOOD ( 25.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pm@vger.kernel.org, Sean Sweeney , LKML , David Dai , Doug Anderson , amit.kucheria@linaro.org, Bjorn Andersson , linux-arm-msm , linux-arm Mailing List Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Georgi and David, On Tue, Jun 18, 2019 at 2:17 AM Georgi Djakov wrote: > > Consumers may have use cases with different bandwidth requirements based > on the system or driver state. The consumer driver can append a specific > tag to the path and pass this information to the interconnect platform > driver to do the aggregation based on this state. > > Introduce icc_set_tag() function that will allow the consumers to append > an optional tag to each path. The aggregation of these tagged paths is > platform specific. > > Signed-off-by: Georgi Djakov > --- > drivers/interconnect/core.c | 24 +++++++++++++++++++++++- > drivers/interconnect/qcom/sdm845.c | 2 +- > include/linux/interconnect-provider.h | 4 ++-- > include/linux/interconnect.h | 5 +++++ > 4 files changed, 31 insertions(+), 4 deletions(-) > > diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c > index 871eb4bc4efc..251354bb7fdc 100644 > --- a/drivers/interconnect/core.c > +++ b/drivers/interconnect/core.c > @@ -29,6 +29,7 @@ static struct dentry *icc_debugfs_dir; > * @req_node: entry in list of requests for the particular @node > * @node: the interconnect node to which this constraint applies > * @dev: reference to the device that sets the constraints > + * @tag: path tag (optional) > * @avg_bw: an integer describing the average bandwidth in kBps > * @peak_bw: an integer describing the peak bandwidth in kBps > */ > @@ -36,6 +37,7 @@ struct icc_req { > struct hlist_node req_node; > struct icc_node *node; > struct device *dev; > + u32 tag; > u32 avg_bw; > u32 peak_bw; > }; > @@ -204,7 +206,7 @@ static int aggregate_requests(struct icc_node *node) > node->peak_bw = 0; > > hlist_for_each_entry(r, &node->req_list, req_node) > - p->aggregate(node, r->avg_bw, r->peak_bw, > + p->aggregate(node, r->tag, r->avg_bw, r->peak_bw, > &node->avg_bw, &node->peak_bw); > > return 0; > @@ -385,6 +387,26 @@ struct icc_path *of_icc_get(struct device *dev, const char *name) > } > EXPORT_SYMBOL_GPL(of_icc_get); > > +/** > + * icc_set_tag() - set an optional tag on a path > + * @path: the path we want to tag > + * @tag: the tag value > + * > + * This function allows consumers to append a tag to the requests associated > + * with a path, so that a different aggregation could be done based on this tag. > + */ > +void icc_set_tag(struct icc_path *path, u32 tag) > +{ > + int i; > + > + if (!path) > + return; > + > + for (i = 0; i < path->num_nodes; i++) > + path->reqs[i].tag = tag; It's a little unfortunate to have this tag sprayed across all the request nodes in the path, even though it's really a single value. If we thought there were likely to be more attributes common to a path that a provider might want access to, we could add a pointer to the path in icc_req, then stick the tag in the path. But if the tag ends up being the only thing worth looking at, then I guess what you have now is slightly better. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel