From: David Laight <David.Laight@ACULAB.COM>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: synchronise_rcu() takes 18ms on an idle system
Date: Wed, 11 Mar 2020 14:33:51 +0000 [thread overview]
Message-ID: <680f63f0c08544808061d5f37893eddf@AcuMS.aculab.com> (raw)
I'm looking into some scheduling delays in application that does
audio processing.
The code calls sys_perf_event_open() (to get a cycle counter).
After static_key_enable() has done some text_poke()s
the code calls synchronise_rcu().
This is all not unreasonable.
__wait_rcu_gp() then calls wait_for_completion().
Which sleeps in schedule_timeout().
At this point I'd expect the 'rcu' to complete pretty quickly.
However my process doesn't get scheduled again for 18ms.
The actual wakeup seems to be from smp_apic_timer_interrupt().
Probably because rcu_core_si() called wakeup_after_rcu() an
then complete().
I think I understand 'rcu', I thought any code relying on it
had to disable pre-emption - so that a process switch on
every cpu was more then enough to release the waiter.
In this case my 4 cpu are largely idle.
Waiting 18ms seems odd, I'm pretty sure I've seen softint
callbacks running for well over 1ms it isn't long enough
for a slow system - but is too long for a fast one.
This is a 5.4-rc7 kernel with CONFIG_HZ=250.
Now I can mitigate this particular case by calling
sys_perf_event_open() much earlier.
But any other calls are problematic.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
reply other threads:[~2020-03-11 14:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=680f63f0c08544808061d5f37893eddf@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=linux-kernel@vger.kernel.org \
/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®