From mboxrd@z Thu Jan 1 00:00:00 1970 From: Georgi Djakov Subject: Re: [PATCH v1 1/2] interconnect: Add support for path tags Date: Wed, 20 Mar 2019 19:10:04 +0200 Message-ID: <14cafee8-0252-754b-9f2b-1855b3fdc66d@linaro.org> References: <20190208172152.1807-1-georgi.djakov@linaro.org> <20190208172152.1807-2-georgi.djakov@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Evan Green Cc: linux-pm@vger.kernel.org, daidavid1@codeaurora.org, Vincent Guittot , Bjorn Andersson , amit.kucheria@linaro.org, Doug Anderson , Sean Sweeney , Michael Turquette , Alexandre Bailon , Thierry Reding , ksitaraman@nvidia.com, sanjayc@nvidia.com, henryc.chen@mediatek.com, LKML , linux-arm-kernel@lists.infradead.org, linux-arm-msm List-Id: linux-arm-msm@vger.kernel.org Hi Evan, On 3/8/19 20:40, Evan Green wrote: > On Fri, Feb 8, 2019 at 9:21 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 | 27 +++++++++++++++++++++++---- >> drivers/interconnect/qcom/sdm845.c | 2 +- >> include/linux/interconnect-provider.h | 4 ++-- >> include/linux/interconnect.h | 5 +++++ >> 4 files changed, 31 insertions(+), 7 deletions(-) >> >> diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c >> index 6005a1c189f6..31eacd0f5349 100644 >> --- a/drivers/interconnect/core.c >> +++ b/drivers/interconnect/core.c >> @@ -42,10 +42,12 @@ struct icc_req { >> >> /** >> * struct icc_path - interconnect path structure >> + * @tag: path tag (optional) >> * @num_nodes: number of hops (nodes) >> * @reqs: array of the requests applicable to this path of nodes >> */ >> struct icc_path { >> + u32 tag; >> size_t num_nodes; >> struct icc_req reqs[]; >> }; >> @@ -206,7 +208,7 @@ static struct icc_path *path_find(struct device *dev, struct icc_node *src, >> * implementing its own aggregate() function. >> */ >> >> -static int aggregate_requests(struct icc_node *node) >> +static int aggregate_requests(struct icc_node *node, u32 tag) >> { >> struct icc_provider *p = node->provider; >> struct icc_req *r; >> @@ -215,7 +217,7 @@ static int aggregate_requests(struct icc_node *node) >> node->peak_bw = 0; > > For my suggestion in patch 2, this is where you'd need the callback to > reset the SLEEP/WAKE shadow aggregation buckets that the provider is > keeping, since the core just reset the values here. I wonder if you'd > want to pass the &node->avg_bw and &node->peak_bw in with this > callback as well... not sure if that's useful. Something like: > > if (p->begin_aggregation) > p->begin_aggregation(node); Currently this seems only Qcom specific, so i would prefer to wait and see if there are similar need for other platforms before adding a new callback. IMO the best option for now would be to reset the values in the platform driver after they are committed. >> >> hlist_for_each_entry(r, &node->req_list, req_node) >> - p->aggregate(node, r->avg_bw, r->peak_bw, >> + p->aggregate(node, tag, r->avg_bw, r->peak_bw, >> &node->avg_bw, &node->peak_bw); > > Wait I'm confused. The tag is associated with a particular path. But > now aren't you looping over all the other requests and coloring them > with whatever tag this is? Don't you need to store the tag with the > request, and then pass r->tag for each r rather than the tag from > whichever request happened to initiate the re-aggregation? Yes indeed. I think i am missing a patch here. Thanks for catching it! BR, Georgi >> >> return 0; >> @@ -396,6 +398,23 @@ struct icc_path *of_icc_get(struct device *dev, const char *name) >> } >> EXPORT_SYMBOL_GPL(of_icc_get); >> 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=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 2FB00C43381 for ; Wed, 20 Mar 2019 17:10:24 +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 EBF0F21873 for ; Wed, 20 Mar 2019 17:10:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oclxMgDz"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zz63KpC+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EBF0F21873 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.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:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7pTGDNCQHTceENCPVc9JAFaJ1SuFoO5Z9Z/6WD9T5Z4=; b=oclxMgDz7Ja09r EmcNp+dgjV8rtrT0YfUa4MCGlM7HdDPRhldtLXBj7mlsUu/ht0TbnQX155vrwdi5sV3oKyMCwcpCT EiKV5Oyz1Hm0dTsZYvj+QVKHrL1Yqs76zLlM01jMOc5t/cclaAuMDmOF7A0AEm6otqKvUOI1qtHn8 0TGo7fV17X4h7XDYvWFeSvEsbjLcDziw624fdP2XU7W8JNwZDIMvvgZXVlnIqWyfjGzKk459rGmic kacTMLVpXO8VpUEZWV/TrRgvzGYl8iMGpV6sHqABuc+VwBYvviX8Y2AUq4RZQQc9e3JJ2wwp3sBWm dgVbnUby/Os64IhEjZ3Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6ejJ-0005lD-UQ; Wed, 20 Mar 2019 17:10:17 +0000 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6ejH-0005kU-2A for linux-arm-kernel@lists.infradead.org; Wed, 20 Mar 2019 17:10:16 +0000 Received: by mail-lf1-x141.google.com with SMTP id u68so2466173lff.7 for ; Wed, 20 Mar 2019 10:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=K7Z5Oe9P8RmD90tly3iXOv2sACQpbSfPuldJEdUWiqY=; b=zz63KpC+w/A+FNE0K21DcVJm9pwDpes4knMlQ9OsboQjJBzx/e7Z+BFKQHn+hvkEwa kzlXRlERihlIqMiNZW6d6Arah4fGI5tbZCMAGVfuYalcZ+8Rc0nKUoUESoXPxLW5hw8k /QCZBdLMvW3rCZQjjui5wPFD3f8iHIxU/pRMz8krq2dIu3VwwTvcro9uPQsNFR6BTXMR 2wEw5d/w8dBP4tyg8YGUhq8Vtz0MrDJN1WGT9Junl7h6kGl4QXgnHCPSLPb+mheNGtSB gbcxuN0d69I0X/bw31wapIjaZvAVTtefapr8+BQNK0FQ7vpU2SvfM7+0lxB8D4EhDxR6 FMug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=K7Z5Oe9P8RmD90tly3iXOv2sACQpbSfPuldJEdUWiqY=; b=afSzioXTQWTEadsFjztLnTp2OkjJS1L7+xLxM7xSxgwKvmwE6XLLfnt95g3YOP3/fC KEKTYk6oOeNuEvHL8BPx0oFqsIFKnTgvIetvrTYldvJCUjuY6l0TJfz1tHybcvNMvjzZ DXu7lBfkZXcDGPgphXw0PpsGG/iNbUl0BKNNXbUs9nscrjXCVaRd6YP1Z4bT/CbonFZR jaFEAbfquzcg2QjG4MBKEDH0rwaWjfJO7gFa4cb3OHtsmiH7fujVvTo0tlvFHH8x6I/V /LurShgj/cybftFo3aOZ26wEXRIj9JBgzvYDQN65msWbRCMAGTHl6hAWTp/J47t1mMR3 rfGw== X-Gm-Message-State: APjAAAVwOLUnzHBtwzot73RRjkHq6rzZkOzE0uw4wQ9BeWoDE42Fj6OI JX0OX2oLt6DsC/UvCcZm8QsTVw== X-Google-Smtp-Source: APXvYqwUBgcwDm8oi2HnG565cPHxue2nMcDThYFNLQTEtxuYdbxnHAx/yB2KTA/zKgg1/MFZVHh2og== X-Received: by 2002:ac2:43c3:: with SMTP id u3mr16732529lfl.69.1553101811727; Wed, 20 Mar 2019 10:10:11 -0700 (PDT) Received: from [10.44.66.8] ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id f16sm462789lfa.91.2019.03.20.10.10.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Mar 2019 10:10:10 -0700 (PDT) Subject: Re: [PATCH v1 1/2] interconnect: Add support for path tags To: Evan Green References: <20190208172152.1807-1-georgi.djakov@linaro.org> <20190208172152.1807-2-georgi.djakov@linaro.org> From: Georgi Djakov Openpgp: preference=signencrypt Autocrypt: addr=georgi.djakov@linaro.org; prefer-encrypt=mutual; keydata=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UDlqnEnwf03EgjdJ 6KEh0z57lyVcy5F/EUKfTAMZweBnkPo+BF2LBYn3Qd+CS6haZAWaG7vzVJu4W/mPQzsAEQEA AYkCJQQYAQIADwUCWNO5FwIbDAUJB4TOAAAKCRCyi/eZcnWWUhlHD/0VE/2x6lKh2FGP+QHH UTKmiiwtMurYKJsSJlQx0T+j/1f+zYkY3MDX+gXa0d0xb4eFv8WNlEjkcpSPFr+pQ7CiAI33 99kAVMQEip/MwoTYvM9NXSMTpyRJ/asnLeqa0WU6l6Z9mQ41lLzPFBAJ21/ddT4xeBDv0dxM GqaH2C6bSnJkhSfSja9OxBe+F6LIAZgCFzlogbmSWmUdLBg+sh3K6aiBDAdZPUMvGHzHK3fj gHK4GqGCFK76bFrHQYgiBOrcR4GDklj4Gk9osIfdXIAkBvRGw8zg1zzUYwMYk+A6v40gBn00 OOB13qJe9zyKpReWMAhg7BYPBKIm/qSr82aIQc4+FlDX2Ot6T/4tGUDr9MAHaBKFtVyIqXBO xOf0vQEokkUGRKWBE0uA3zFVRfLiT6NUjDQ0vdphTnsdA7h01MliZLQ2lLL2Mt5lsqU+6sup Tfql1omgEpjnFsPsyFebzcKGbdEr6vySGa3Cof+miX06hQXKe99a5+eHNhtZJcMAIO89wZmj 7ayYJIXFqjl/X0KBcCbiAl4vbdBw1bqFnO4zd1lMXKVoa29UHqby4MPbQhjWNVv9kqp8A39+ E9xw890l1xdERkjVKX6IEJu2hf7X3MMl9tOjBK6MvdOUxvh1bNNmXh7OlBL1MpJYY/ydIm3B KEmKjLDvB0pePJkdTw== Message-ID: <14cafee8-0252-754b-9f2b-1855b3fdc66d@linaro.org> Date: Wed, 20 Mar 2019 19:10:04 +0200 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190320_101015_556721_CD00E301 X-CRM114-Status: GOOD ( 23.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vincent Guittot , sanjayc@nvidia.com, linux-pm@vger.kernel.org, Sean Sweeney , LKML , Michael Turquette , daidavid1@codeaurora.org, Doug Anderson , amit.kucheria@linaro.org, Bjorn Andersson , Thierry Reding , henryc.chen@mediatek.com, Alexandre Bailon , linux-arm-msm , ksitaraman@nvidia.com, linux-arm-kernel@lists.infradead.org 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 Evan, On 3/8/19 20:40, Evan Green wrote: > On Fri, Feb 8, 2019 at 9:21 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 | 27 +++++++++++++++++++++++---- >> drivers/interconnect/qcom/sdm845.c | 2 +- >> include/linux/interconnect-provider.h | 4 ++-- >> include/linux/interconnect.h | 5 +++++ >> 4 files changed, 31 insertions(+), 7 deletions(-) >> >> diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c >> index 6005a1c189f6..31eacd0f5349 100644 >> --- a/drivers/interconnect/core.c >> +++ b/drivers/interconnect/core.c >> @@ -42,10 +42,12 @@ struct icc_req { >> >> /** >> * struct icc_path - interconnect path structure >> + * @tag: path tag (optional) >> * @num_nodes: number of hops (nodes) >> * @reqs: array of the requests applicable to this path of nodes >> */ >> struct icc_path { >> + u32 tag; >> size_t num_nodes; >> struct icc_req reqs[]; >> }; >> @@ -206,7 +208,7 @@ static struct icc_path *path_find(struct device *dev, struct icc_node *src, >> * implementing its own aggregate() function. >> */ >> >> -static int aggregate_requests(struct icc_node *node) >> +static int aggregate_requests(struct icc_node *node, u32 tag) >> { >> struct icc_provider *p = node->provider; >> struct icc_req *r; >> @@ -215,7 +217,7 @@ static int aggregate_requests(struct icc_node *node) >> node->peak_bw = 0; > > For my suggestion in patch 2, this is where you'd need the callback to > reset the SLEEP/WAKE shadow aggregation buckets that the provider is > keeping, since the core just reset the values here. I wonder if you'd > want to pass the &node->avg_bw and &node->peak_bw in with this > callback as well... not sure if that's useful. Something like: > > if (p->begin_aggregation) > p->begin_aggregation(node); Currently this seems only Qcom specific, so i would prefer to wait and see if there are similar need for other platforms before adding a new callback. IMO the best option for now would be to reset the values in the platform driver after they are committed. >> >> hlist_for_each_entry(r, &node->req_list, req_node) >> - p->aggregate(node, r->avg_bw, r->peak_bw, >> + p->aggregate(node, tag, r->avg_bw, r->peak_bw, >> &node->avg_bw, &node->peak_bw); > > Wait I'm confused. The tag is associated with a particular path. But > now aren't you looping over all the other requests and coloring them > with whatever tag this is? Don't you need to store the tag with the > request, and then pass r->tag for each r rather than the tag from > whichever request happened to initiate the re-aggregation? Yes indeed. I think i am missing a patch here. Thanks for catching it! BR, Georgi >> >> return 0; >> @@ -396,6 +398,23 @@ struct icc_path *of_icc_get(struct device *dev, const char *name) >> } >> EXPORT_SYMBOL_GPL(of_icc_get); >> _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel