[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <abfba253-0a5f-4f4d-9921-014c3baff634@o2.pl>
Date: Fri, 25 Oct 2024 22:52:33 +0200
From: Mateusz Jończyk <mat.jonczyk@...pl>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: Mario Limonciello <mario.limonciello@....com>,
Dan Carpenter <dan.carpenter@...aro.org>,
Joy Chakraborty <joychakr@...gle.com>, linux-rtc@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rtc: cmos: avoid taking rtc_lock for extended period of
time
W dniu 25.10.2024 o 22:14, Dmitry Torokhov pisze:
> On my device reading entirety of /sys/devices/pnp0/00:03/cmos_nvram0/nvmem
> takes about 9 msec during which time interrupts are off on the CPU that
> does the read and the thread that performs the read can not be migrated
> or preempted by another higher priority thread (RT or not).
>
> Allow readers and writers be preempted by taking and releasing rtc_lock
> spinlock for each individual byte read or written rather than once per
> read/write request.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
Reviewed-by: Mateusz Jończyk <mat.jonczyk@...pl>
FWIW, there is a similar latency problem in hpet_rtc_interrupt() in arch/x86/kernel/hpet.c as mc146818_get_time() can sleep for up to 10ms. It should be possible to avoid using full
mc146818_get_time() there and implement only what's needed (including aborting early if RTC_UIP is set etc.).
Greetings,
Mateusz
Powered by blists - more mailing lists