All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tomasz Moń" <tomasz.mon@camlingroup.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Sergey Organov" <sorganov@gmail.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>,
	Jiri Slaby <jirislaby@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	k.drobinski@camlintechnologies.com,
	NXP Linux Team <linux-imx@nxp.com>,
	linux-serial@vger.kernel.org, Shawn Guo <shawnguo@kernel.org>,
	Fabio Estevam <festevam@gmail.com>,
	Sascha Hauer <s.hauer@pengutronix.de>
Subject: Re: [PATCH] serial: imx: reduce RX interrupt frequency
Date: Mon, 10 Jan 2022 07:14:58 +0100	[thread overview]
Message-ID: <a6f0b0dc-da67-2488-16b2-40f5ad049fde@camlingroup.com> (raw)
In-Reply-To: <20220106150552.vdt5qabe2xj4kasg@pengutronix.de>

On 06.01.2022 16:05, Uwe Kleine-König wrote:
> On Wed, Jan 05, 2022 at 04:34:21PM +0300, Sergey Organov wrote:
>> Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:
>>> Maybe it's more sensible to make this even more dynamic: e.g. keep it at
>>> 1 as default and increase the water level when a certain irq frequency
>>> is reached?
>>
>> Too complex, and too many questions, I'm afraid. What is "irq
>> frequency", exactly? For this particular driver, or overall system?
>> Measured on what time interval? What is the threshold? Do we drop the
>> water level back to 1 when "irq frequency" is down again? Will we just
>> create re-configure storm at some conditions? Etc.....
> 
> It could be as easy as increasing the waterlevel by one if an RX irq
> happens with USR1.AGTIM = 0 and reset to 1 if USR1.AGTIM = 1.

This is indeed simple, but I fail to see the actual benefit of doing so.

> This makes sure that receiving at a low frequency makes the hardware
> interrupt the CPU early, and a burst doesn't starve the CPU.

If the communication involves multiple characters sent in burst (frame),
and includes some sort of CRC check (so only complete frames are useful,
as no partial processing can be done because checksum has to be checked
first), then it is the latency after the last character (not the first)
that matters.

RXTL upper value has to be capped. If RXTL goes above CTSTL then it
would limit throughput if hardware flow control is enabled. If hardware
flow control is not enabled, then the higher RXTL gets, the higher is
the risk of not reading RxFIFO in time. Setting RXTL to quarter of the
RxFIFO (8) seems to leave enough time for RX interrupt and at the same
time noticeably lowers the interrupt rate.

Best Regards,
Tomasz Mon


  reply	other threads:[~2022-01-10  6:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 10:32 [PATCH] serial: imx: reduce RX interrupt frequency Tomasz Moń
2022-01-04 10:43 ` Ahmad Fatoum
2022-01-04 11:05   ` Tomasz Moń
2022-01-04 10:54 ` Greg Kroah-Hartman
2022-01-04 11:13   ` Tomasz Moń
2022-01-04 11:38     ` Greg Kroah-Hartman
2022-01-04 22:49       ` Uwe Kleine-König
2022-01-05  7:59         ` Tomasz Moń
2022-01-05 10:37           ` Greg Kroah-Hartman
2022-01-05 10:56             ` Tomasz Moń
2022-01-05 10:57             ` Marc Kleine-Budde
2022-01-06 15:39               ` Sergey Organov
2022-01-05 13:34         ` Sergey Organov
2022-01-06 15:05           ` Uwe Kleine-König
2022-01-10  6:14             ` Tomasz Moń [this message]
2022-01-10  8:31               ` Uwe Kleine-König
2022-01-05 13:00   ` Sergey Organov
2022-01-05 13:04     ` Marc Kleine-Budde
2022-01-05 13:37       ` Sergey Organov
2022-01-05 13:40         ` Marc Kleine-Budde
2022-01-05 14:37           ` Sergey Organov

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=a6f0b0dc-da67-2488-16b2-40f5ad049fde@camlingroup.com \
    --to=tomasz.mon@camlingroup.com \
    --cc=festevam@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=k.drobinski@camlintechnologies.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-imx@nxp.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=sorganov@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.