mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mateusz Jończyk" <mat.jonczyk@o2.pl>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Mario Limonciello <mario.limonciello@amd.com>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	Joy Chakraborty <joychakr@google.com>,
	linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc: cmos: avoid taking rtc_lock for extended period of time
Date: Fri, 25 Oct 2024 22:52:33 +0200	[thread overview]
Message-ID: <abfba253-0a5f-4f4d-9921-014c3baff634@o2.pl> (raw)
In-Reply-To: <Zxv8QWR21AV4ztC5@google.com>

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@gmail.com>

Reviewed-by: Mateusz Jończyk <mat.jonczyk@o2.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


  reply	other threads:[~2024-10-25 20:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-25 20:14 Dmitry Torokhov
2024-10-25 20:52 ` Mateusz Jończyk [this message]
2024-10-31 23:19 ` Alexandre Belloni
  -- strict thread matches above, loose matches on Subject: below --
2024-10-24 20:37 Dmitry Torokhov
2024-10-25  6:01 ` Mateusz Jończyk
2024-10-25 20:07   ` Dmitry Torokhov

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=abfba253-0a5f-4f4d-9921-014c3baff634@o2.pl \
    --to=mat.jonczyk@o2.pl \
    --cc=alexandre.belloni@bootlin.com \
    --cc=dan.carpenter@linaro.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=joychakr@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=mario.limonciello@amd.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

all inboxes | Powered by JetHome®