[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZD01K/CP8llU/Opa@corigine.com>
Date: Mon, 17 Apr 2023 14:01:47 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Michal Schmidt <mschmidt@...hat.com>
Cc: intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
Jesse Brandeburg <jesse.brandeburg@...el.com>,
Karol Kolacinski <karol.kolacinski@...el.com>,
Tony Nguyen <anthony.l.nguyen@...el.com>,
Michal Michalik <michal.michalik@...el.com>,
Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>,
Petr Oros <poros@...hat.com>, Andrew Lunn <andrew@...n.ch>,
Brent Rowsell <browsell@...hat.com>
Subject: Re: [PATCH net-next v2 4/6] ice: sleep, don't busy-wait, for
ICE_CTL_Q_SQ_CMD_TIMEOUT
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@...hat.com>
> Signed-off-by: Michal Schmidt <mschmidt@...hat.com>
Reviewed-by: Simon Horman <simon.horman@...igine.com>
Powered by blists - more mailing lists