From: "Theodore Ts'o" <tytso@mit.edu>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH] random: Optimize add_interrupt_randomness
Date: Wed, 28 Feb 2018 18:02:10 -0500 [thread overview]
Message-ID: <20180228230210.GC3862@thunk.org> (raw)
In-Reply-To: <20180228214328.23108-1-andi@firstfloor.org>
Thanks, applied.
- Ted
On Wed, Feb 28, 2018 at 01:43:28PM -0800, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> add_interrupt_randomess always wakes up
> code blocking on /dev/random. This wake up is done
> unconditionally. Unfortunately this means all interrupts
> take the wait queue spinlock, which can be rather expensive
> on large systems processing lots of interrupts.
>
> We saw 1% cpu time spinning on this on a large macro workload
> running on a large system.
>
> I believe it's a recent regression (?)
>
> Always check if there is a waiter on the wait queue
> before waking up. This check can be done without
> taking a spinlock.
>
> 1.06% 10460 [kernel.vmlinux] [k] native_queued_spin_lock_slowpath
> |
> ---native_queued_spin_lock_slowpath
> |
> --0.57%--_raw_spin_lock_irqsave
> |
> --0.56%--__wake_up_common_lock
> credit_entropy_bits
> add_interrupt_randomness
> handle_irq_event_percpu
> handle_irq_event
> handle_edge_irq
> handle_irq
> do_IRQ
> common_interrupt
>
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
prev parent reply other threads:[~2018-02-28 23:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-28 21:43 [PATCH] random: Optimize add_interrupt_randomness Andi Kleen
2018-02-28 23:02 ` Theodore Ts'o [this message]
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=20180228230210.GC3862@thunk.org \
--to=tytso@mit.edu \
--cc=ak@linux.intel.com \
--cc=andi@firstfloor.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.