From: Sean Anderson <sean.anderson@seco.com>
To: Crystal Wood <oss@buserror.net>, Li Yang <leoyang.li@nxp.com>,
linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
Camelia Groza <camelia.groza@nxp.com>,
linux-kernel@vger.kernel.org, Roy Pledge <roy.pledge@nxp.com>,
"David S . Miller" <davem@davemloft.net>,
Madalin Bucur <madalin.bucur@nxp.com>
Subject: Re: [PATCH v3 2/2] soc: fsl: qbman: Use raw spinlock for cgr_lock
Date: Tue, 4 Apr 2023 12:04:57 -0400 [thread overview]
Message-ID: <d4737c45-2bbf-d364-9768-20baa46f6af4@seco.com> (raw)
In-Reply-To: <48dacc58c7c04ba8a005d8edd56744c8455f007e.camel@buserror.net>
On 4/4/23 11:33, Crystal Wood wrote:
> On Tue, 2023-04-04 at 10:55 -0400, Sean Anderson wrote:
>
>> @@ -1456,11 +1456,11 @@ static void tqm_congestion_task(struct work_struct
>> *work)
>> union qm_mc_result *mcr;
>> struct qman_cgr *cgr;
>>
>> - spin_lock_irq(&p->cgr_lock);
>> + raw_spin_lock_irq(&p->cgr_lock);
>> qm_mc_start(&p->p);
>> qm_mc_commit(&p->p, QM_MCC_VERB_QUERYCONGESTION);
>> if (!qm_mc_result_timeout(&p->p, &mcr)) {
>> - spin_unlock_irq(&p->cgr_lock);
>> + raw_spin_unlock_irq(&p->cgr_lock);
>
> qm_mc_result_timeout() spins with a timeout of 10 ms which is very
> inappropriate for a raw lock. What is the actual expected upper bound?
Hm, maybe we can move this qm_mc stuff outside cgr_lock? In most other
places they're called without cgr_lock, which implies that its usage
here is meant to synchronize against some other function.
>> dev_crit(p->config->dev, "QUERYCONGESTION timeout\n");
>> qman_p_irqsource_add(p, QM_PIRQ_CSCI);
>> return;
>> @@ -1476,7 +1476,7 @@ static void qm_congestion_task(struct work_struct
>> *work)
>> list_for_each_entry(cgr, &p->cgr_cbs, node)
>> if (cgr->cb && qman_cgrs_get(&c, cgr->cgrid))
>> cgr->cb(p, cgr, qman_cgrs_get(&rr, cgr->cgrid));
>> - spin_unlock_irq(&p->cgr_lock);
>> + raw_spin_unlock_irq(&p->cgr_lock);
>> qman_p_irqsource_add(p, QM_PIRQ_CSCI);
>> }
>
> The callback loop is also a bit concerning...
The callbacks (in .../dpaa/dpaa_eth.c and .../caam/qi.c) look OK. The
only thing which might take a bit is dpaa_eth_refill_bpools, which
allocates memory (from the atomic pool).
--Sean
next prev parent reply other threads:[~2023-04-04 16:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-04 14:55 [PATCH v3 1/2] soc: fsl: qbman: Always disable interrupts when taking cgr_lock Sean Anderson
2023-04-04 14:55 ` [PATCH v3 2/2] soc: fsl: qbman: Use raw spinlock for cgr_lock Sean Anderson
2023-04-04 15:33 ` Crystal Wood
2023-04-04 16:04 ` Sean Anderson [this message]
2023-04-11 15:09 ` Sean Anderson
2023-04-18 6:29 ` Crystal Wood
2023-04-18 15:22 ` Sean Anderson
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=d4737c45-2bbf-d364-9768-20baa46f6af4@seco.com \
--to=sean.anderson@seco.com \
--cc=camelia.groza@nxp.com \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=leoyang.li@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=madalin.bucur@nxp.com \
--cc=oss@buserror.net \
--cc=roy.pledge@nxp.com \
--cc=vladimir.oltean@nxp.com \
/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
all inboxes | Powered by JetHome®