From: Simon Horman <simon.horman@corigine.com>
To: Michal Schmidt <mschmidt@redhat.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
Jesse Brandeburg <jesse.brandeburg@intel.com>,
Karol Kolacinski <karol.kolacinski@intel.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Michal Michalik <michal.michalik@intel.com>,
Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
Petr Oros <poros@redhat.com>, Andrew Lunn <andrew@lunn.ch>,
Brent Rowsell <browsell@redhat.com>
Subject: Re: [PATCH net-next v2 4/6] ice: sleep, don't busy-wait, for ICE_CTL_Q_SQ_CMD_TIMEOUT
Date: Mon, 17 Apr 2023 14:01:47 +0200 [thread overview]
Message-ID: <ZD01K/CP8llU/Opa@corigine.com> (raw)
In-Reply-To: <20230412081929.173220-5-mschmidt@redhat.com>
On Wed, Apr 12, 2023 at 10:19:27AM +0200, Michal Schmidt wrote:
> The driver polls for ice_sq_done() with a 100 µs period for up to 1 s
> and it uses udelay to do that.
>
> Let's use usleep_range instead. We know sleeping is allowed here,
> because we're holding a mutex (cq->sq_lock). To preserve the total
> max waiting time, measure the timeout in jiffies.
>
> ICE_CTL_Q_SQ_CMD_TIMEOUT is used also in ice_release_res(), but there
> the polling period is 1 ms (i.e. 10 times longer). Since the timeout was
> expressed in terms of the number of loops, the total timeout in this
> function is 10 s. I do not know if this is intentional. This patch keeps
> it.
>
> The patch lowers the CPU usage of the ice-gnss-<dev_name> kernel thread
> on my system from ~8 % to less than 1 %.
>
> I received a report of high CPU usage with ptp4l where the busy-waiting
> in ice_sq_send_cmd dominated the profile. This patch has been tested in
> that usecase too and it made a huge improvement there.
>
> Tested-by: Brent Rowsell <browsell@redhat.com>
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
next prev parent reply other threads:[~2023-04-17 12:03 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-12 8:19 [PATCH net-next v2 0/6] ice: lower CPU usage with GNSS Michal Schmidt
2023-04-12 8:19 ` [PATCH net-next v2 1/6] ice: do not busy-wait to read GNSS data Michal Schmidt
2023-04-14 17:29 ` Kubalewski, Arkadiusz
2023-04-17 11:58 ` Simon Horman
2023-04-20 20:59 ` [Intel-wired-lan] " Mekala, SunithaX D
2023-04-12 8:19 ` [PATCH net-next v2 2/6] ice: increase the GNSS data polling interval to 20 ms Michal Schmidt
2023-04-14 17:28 ` Kubalewski, Arkadiusz
2023-04-17 11:58 ` Simon Horman
2023-04-20 20:59 ` [Intel-wired-lan] " Mekala, SunithaX D
2023-04-12 8:19 ` [PATCH net-next v2 3/6] ice: remove ice_ctl_q_info::sq_cmd_timeout Michal Schmidt
2023-04-14 17:29 ` Kubalewski, Arkadiusz
2023-04-17 11:52 ` Simon Horman
2023-04-20 20:59 ` [Intel-wired-lan] " Mekala, SunithaX D
2023-04-12 8:19 ` [PATCH net-next v2 4/6] ice: sleep, don't busy-wait, for ICE_CTL_Q_SQ_CMD_TIMEOUT Michal Schmidt
2023-04-14 17:29 ` Kubalewski, Arkadiusz
2023-04-17 12:01 ` Simon Horman [this message]
2023-04-20 21:07 ` [Intel-wired-lan] " Mekala, SunithaX D
2023-04-12 8:19 ` [PATCH net-next v2 5/6] ice: remove unused buffer copy code in ice_sq_send_cmd_retry() Michal Schmidt
2023-04-14 17:29 ` Kubalewski, Arkadiusz
2023-04-17 12:02 ` Simon Horman
2023-04-20 20:59 ` [Intel-wired-lan] " Mekala, SunithaX D
2023-04-12 8:19 ` [PATCH net-next v2 6/6] ice: sleep, don't busy-wait, in the SQ send retry loop Michal Schmidt
2023-04-14 17:29 ` Kubalewski, Arkadiusz
2023-04-17 12:03 ` Simon Horman
2023-04-20 20:59 ` [Intel-wired-lan] " Mekala, SunithaX D
2023-04-14 17:29 ` [PATCH net-next v2 0/6] ice: lower CPU usage with GNSS Kubalewski, Arkadiusz
2023-04-20 20:59 ` [Intel-wired-lan] " Mekala, SunithaX D
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=ZD01K/CP8llU/Opa@corigine.com \
--to=simon.horman@corigine.com \
--cc=andrew@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=arkadiusz.kubalewski@intel.com \
--cc=browsell@redhat.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jesse.brandeburg@intel.com \
--cc=karol.kolacinski@intel.com \
--cc=michal.michalik@intel.com \
--cc=mschmidt@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=poros@redhat.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;
as well as URLs for NNTP newsgroup(s).