]> git.baikalelectronics.ru Git - kernel.git/commit
spi: spi.c: Convert statistics to per-cpu u64_stats_t
authorDavid Jander <david@protonic.nl>
Tue, 24 May 2022 09:18:08 +0000 (11:18 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 6 Jun 2022 11:41:31 +0000 (12:41 +0100)
commit57abc06cc5c05e65ec7358edf9a18b0980130c4a
tree9bf8f2c1b9739bdbe5cf57ad90d6f336ceb99e09
parent793cab06dce64ec29e234fde407f2836c181ed0c
spi: spi.c: Convert statistics to per-cpu u64_stats_t

This change gives a dramatic performance improvement in the hot path,
since many costly spin_lock_irqsave() calls can be avoided.

On an i.MX8MM system with a MCP2518FD CAN controller connected via SPI,
the time the driver takes to handle interrupts, or in other words the time
the IRQ line of the CAN controller stays low is mainly dominated by the
time it takes to do 3 relatively short sync SPI transfers. The effect of
this patch is a reduction of this time from 136us down to only 98us.

Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David Jander <david@protonic.nl>
Link: https://lore.kernel.org/r/20220524091808.2269898-1-david@protonic.nl
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c
include/linux/spi/spi.h