From: Georgi Djakov <georgi.djakov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Vincent Guittot
<vincent.guittot-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: "linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org"
<rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Kevin Hilman <khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
mturquette <mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
"gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org"
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
Saravana Kannan <skannan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Andy Gross <andy.gross-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"Sweeney, Sean" <seansw-Rm6X0d1/PG5y9aJCnZT0Uw@public.gmane.org>,
"Dai, David" <davidai-jfJNa2p1gH1BDgjK7y7TUQ@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-kernel
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
LAK
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v1 1/3] interconnect: Add generic interconnect controller API
Date: Fri, 30 Jun 2017 15:52:13 +0300 [thread overview]
Message-ID: <93a7ab62-8b64-a757-1b5f-9a8bdd1751a4@linaro.org> (raw)
In-Reply-To: <CAKfTPtCLf-JAKM5MD-pe-az3xUF_4nYtYvnsZpztmtaqk0C4PQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hi Vincent,
On 06/28/2017 08:45 PM, Vincent Guittot wrote:
> Hi Georgi,
>
> On 27 June 2017 at 19:49, Georgi Djakov <georgi.djakov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>
> [snip]
>
>> +
>> +static int interconnect_aggregate(struct interconnect_node *node,
>> + struct interconnect_creq *creq)
>> +{
>> + int ret = 0;
>> +
>> + mutex_lock(&node->icp->lock);
>> +
>> + if (node->icp->ops->aggregate) {
>> + ret = node->icp->ops->aggregate(node, creq);
>> + if (ret) {
>> + pr_info("%s: error (%d)\n", __func__, ret);
>> + goto out;
>> + }
>> + } else {
>> + /* do not aggregate by default */
>> + struct icp *icp = node->icp;
>> +
>> + icp->creq.avg_bw = creq->avg_bw;
>> + icp->creq.peak_bw = creq->peak_bw;
>
> Does it means that by default the last caller defines the bandwidth
> for everybody ?
> IMHO, having a default aggregation policy that sums the avg_bw of all
> request of the node
> and that gets the max of peak_bw of all request of a node is better
>
Yes, i had this in one of the previous versions, but then i removed the
aggregation by default. Will put it back. Thanks!
>> + }
>> +
>> +out:
>> + mutex_unlock(&node->icp->lock);
>> + return ret;
>> +}
>> +
>> +/**
>> + * interconnect_set() - set constraints on a path between two endpoints
>> + * @path: reference to the path returned by interconnect_get()
>> + * @creq: request from the consumer, containing its requirements
>> + *
>> + * This function is used by an interconnect consumer to express its own needs
>> + * in term of bandwidth and QoS for a previously requested path between two
>> + * endpoints. The requests are aggregated and each node is updated accordingly.
>> + *
>> + * Returns 0 on success, or an approproate error code otherwise.
>> + */
>> +int interconnect_set(struct interconnect_path *path,
>> + struct interconnect_creq *creq)
>> +{
>> + struct interconnect_node *next, *prev = NULL;
>> + size_t i;
>> + int ret = 0;
>> +
>> + for (i = 0; i < path->num_nodes; i++, prev = next) {
>> + next = path->reqs[i].node;
>> +
>> + if (!next || !prev)
>
> This needs a comment with an explanation about why you don't do
> anything in this case
Ok.
>
>> + continue;
>> +
>> + if (next->icp != prev->icp)
>
> This needs a comment with an explanation about why you don't do
> anything in this case
Ok.
>
>> + continue;
>> +
>> + /* aggregate requests from consumers */
>
> you should update the path->reqs[i].avg_bw and path->reqs[i].peak_bw
> with creq values
> before aggregating the requests from the different consumer of a node ?
>
> path->reqs[i].avg_bw = creq->avg_bw
> path->reqs[i].peak_bw = creq->peak_bw
I am updating them currently in the vendor implementation of the
aggregate() function, but this was probably not the right place,
so i will move it here instead. Thanks for the comments!
BR,
Georgi
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-06-30 12:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-27 17:49 [PATCH v1 0/3] Introduce on-chip interconnect API Georgi Djakov
2017-06-27 17:49 ` [PATCH v1 1/3] interconnect: Add generic interconnect controller API Georgi Djakov
2017-06-28 17:45 ` Vincent Guittot
[not found] ` <CAKfTPtCLf-JAKM5MD-pe-az3xUF_4nYtYvnsZpztmtaqk0C4PQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-30 12:52 ` Georgi Djakov [this message]
2017-06-27 17:49 ` [PATCH v1 2/3] interconnect: Add Qualcomm msm8916 interconnect provider driver Georgi Djakov
2017-06-27 17:49 ` [PATCH v1 3/3] dt-bindings: Interconnect device-tree bindings draft Georgi Djakov
[not found] ` <20170627174903.27978-4-georgi.djakov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-06-29 21:32 ` Rob Herring
2017-06-30 12:57 ` Georgi Djakov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=93a7ab62-8b64-a757-1b5f-9a8bdd1751a4@linaro.org \
--to=georgi.djakov-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=andy.gross-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=davidai-jfJNa2p1gH1BDgjK7y7TUQ@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
--cc=rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=seansw-Rm6X0d1/PG5y9aJCnZT0Uw@public.gmane.org \
--cc=skannan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=vincent.guittot-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).