From: Richard Yao <ryao@gentoo.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Zhang Yanfei <zhangyanfei.yes@gmail.com>,
Wanpeng Li <liwanp@linux.vnet.ibm.com>,
Johannes Weiner <hannes@cmpxchg.org>,
HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel@gentoo.org, Matthew Thode <mthode@mthode.org>
Subject: Re: [PATCH] mm/vmalloc: Introduce DEBUG_VMALLOCINFO to reduce spinlock contention
Date: Thu, 10 Apr 2014 13:09:50 -0400 [thread overview]
Message-ID: <5346D05E.2020201@gentoo.org> (raw)
In-Reply-To: <87txa1i0uq.fsf@tassilo.jf.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1833 bytes --]
On 04/10/2014 12:51 PM, Andi Kleen wrote:
> Richard Yao <ryao@gentoo.org> writes:
>
>> Performance analysis of software compilation by Gentoo portage on an
>> Intel E5-2620 with 64GB of RAM revealed that a sizeable amount of time,
>> anywhere from 5% to 15%, was spent in get_vmalloc_info(), with at least
>> 40% of that time spent in the _raw_spin_lock() invoked by it.
>
> I don't think that's the right fix. We want to be able
> to debug kernels without having to recompile them.
There are plenty of other features for debugging the VM subsystem that
are disabled in production kernels because they are too expensive. I see
no reason why this should not be one of them.
If someone reading this has a use for this functionality in production
systems, I would love to hear about it. I am having trouble finding uses
for this in production.
That being said, we are clearly spending plenty of time blocked on list
traversal. I imagine that we could use an extent tree to track free
space for even bigger gains, but I have difficulty seeing why
/proc/vmallocinfo should be available on non-debug kernels. Allowing
userland to hold a critical lock indefinitely on production systems is a
deadlock waiting to happen.
> And switching locking around dynamically like this is very
> ugly and hard to maintain.
I welcome suggestions on how to make the changes I have made in this
patch more maintainable.
> Besides are you sure the spin lock is not needed elsewhere?
>
> How are writers to the list protected?
The spinlock is needed elsewhere, but not to protect this list.
Modifications to this list are done under RCU. The only thing stopping
RCU from being enough to avoid a spinlock is /proc/vmallocinfo, which
does locking to prevent modification while userland is reading the list.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
next prev parent reply other threads:[~2014-04-10 17:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-10 16:40 Richard Yao
2014-04-10 16:51 ` Andi Kleen
2014-04-10 17:09 ` Richard Yao [this message]
2014-04-16 0:28 ` Joonsoo Kim
2014-04-17 23:18 ` Andrew Morton
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=5346D05E.2020201@gentoo.org \
--to=ryao@gentoo.org \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=d.hatayama@jp.fujitsu.com \
--cc=hannes@cmpxchg.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=kernel@gentoo.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liwanp@linux.vnet.ibm.com \
--cc=mthode@mthode.org \
--cc=zhangyanfei.yes@gmail.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