Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10739398ybi; Thu, 11 Jul 2019 10:08:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGpUfr/qJhpBL5wx+iR10vSwcrzFEnkVayAo49ZBH0nEGkGowRsgHSWC2Q0vuwqUn5xylz X-Received: by 2002:a63:fe52:: with SMTP id x18mr1157706pgj.344.1562864901848; Thu, 11 Jul 2019 10:08:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562864901; cv=none; d=google.com; s=arc-20160816; b=iCTp6wvleaUkq86FNBQsneVyyGaF3V9xuGqEqEfzDsr/uMItnROSV8qHawpS8TtRxz eFr7GFgeXb5lA7MDkcw4ZxcquaWxNOqop+Y0w2rkXI3wNtFXDLaQZEpY7t3gLwuHk6Vx LXae5YINZfPQWSK88LyOqbvVp8NItpTK+1rUJ6AvNZcScfcJbxp5M8i7/zLHH2I9Rv8y 9azbcVSdhDegl+S4I6EB0CmyHGZng6ln/ot+JzvYg53W77jRnHV0bymHP0inYGjP0JUf GxAmaaZLI4hNn8VQSZhIAAJXnwVLBedAi6RlEq4P78hidqn6w+Eps4hJ0n+ZgykvB0TQ Ng6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5j7z1tlACT61nuFnKG/Eec995GLAXwXEnm5NfF1n5nI=; b=oSpYROnKFjMAllASqvUt4sRJwjuQ9jp6DzUNjpj9/JD1avfpXRA54CIfWok0BhKqGk dpW4hzU+QVD2nW91Ww8Kw5DaF0tspahWrzFGi0qWwnjK5r6C3vYqXxdXTHirGrzROp7b ggsj2iA+EQRJwvsYRG4pAA9LmjOkX2HQuEmZKbfRYkNouHDK1Z+OiFuyl+erH942nlbi Q6nQm9q013MOI2Q13d23uyERSsEGMZUFksGht1FcC2SNw2qjoxsgorjjS7SQJWiBrVgW OSLGpWYfXL0mP3La0nR6qZ5oWIlzC3+SUd6ucAkmwf9Gwtc6RRNQge59aEV306cE+NJs k+HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=U9sxa8fS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f20si5634064pfn.166.2019.07.11.10.08.06; Thu, 11 Jul 2019 10:08:21 -0700 (PDT) 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; dkim=pass header.i=@chromium.org header.s=google header.b=U9sxa8fS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728711AbfGKRGq (ORCPT + 99 others); Thu, 11 Jul 2019 13:06:46 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:39548 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728559AbfGKRGq (ORCPT ); Thu, 11 Jul 2019 13:06:46 -0400 Received: by mail-lf1-f67.google.com with SMTP id v85so4558093lfa.6 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=DnwVvfjyiqUTIZgSV75wb6BPUQyNR1dBrhYqc34M8WvQ44bBwLX5/YUzKA96LLbhkV KmmQFSSVX7PRVAIEKJTlVUNh39Ph6NekssdfGtG8X2GX5ajnh576MLR+UlNDipuj4cgh t1WrMG7Z9cTdPC4SO779D2nveht47OsddnCeWZNq0CV2FF5F/cvWWDqNY8TQJXR1r2vw 9OjFazSKlXCSP/9a3L3OYg1SwaUNl/zlPkfW37Zn/DGarsaxcaonwlNsNklUdbzANjCs a1GkuSBmn6iNwiKmQJPkmq3N4Kr1EANwK+63ZLRysZRqzG7QV3P1pxebhE6x9F145j+B d0kQ== X-Gm-Message-State: APjAAAUowH5ssBHg6ri7wh0h709ZRlOLkLWiDgNiGvG0mkVi62d7eUXB dRqRtJ0nAhDW4IxVjyjan1Oh0XnEzr0= X-Received: by 2002:ac2:456d:: with SMTP id k13mr2381293lfm.77.1562864803431; Thu, 11 Jul 2019 10:06:43 -0700 (PDT) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com. [209.85.167.53]) by smtp.gmail.com with ESMTPSA id s26sm1054375ljs.77.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-f53.google.com with SMTP id b29so4585646lfq.1 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 Cc: linux-pm@vger.kernel.org, David Dai , Vincent Guittot , Bjorn Andersson , amit.kucheria@linaro.org, Doug Anderson , Sean Sweeney , LKML , linux-arm Mailing List , linux-arm-msm Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.