From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Bryton Lee <brytonlee01@gmail.com>,
stephen@networkplumber.org, netdev@vger.kernel.org,
davem@davemloft.net
Cc: eric.dumazet@gmail.com
Subject: Re: [PATCH] prevent the read ahead of /proc/slabinfo in ss take 2
Date: Tue, 10 Feb 2015 15:37:42 +0300 [thread overview]
Message-ID: <54D9FB96.6080401@cogentembedded.com> (raw)
In-Reply-To: <1423536360-5298-1-git-send-email-brytonlee01@gmail.com>
Hello.
On 2/10/2015 5:46 AM, Bryton Lee wrote:
> ss reads ahead of /proc/slabinfo whatever slabstat will be used or not in future.
> this will cause huge system delay when the kernel hires SLAB allocator(SLUB allocator is ok). when program reads
> /proc/slabinfo, it will call s_show() in SLAB allocator level, and s_show() calls spin_lock_irq(&l3->list_lock)
> then iterate on whole three lists. if one slab has about 900 million objects (for example dentry),
> it will cause more than 1000ms delay.
> so this patch prevents the read ahead of /proc/slabinfo, ss runs with most parameters not using slabstat at all.
> and this patch also change slabstat and slabstat_valid to static.
> Signed-off-by: Bryton Lee <brytonlee01@gmail.com>
> ---
> misc/ss.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
> diff --git a/misc/ss.c b/misc/ss.c
> index 7fc0a99..5fa6259 100644
> --- a/misc/ss.c
> +++ b/misc/ss.c
> @@ -616,7 +616,8 @@ struct slabstat
> int skbs;
> };
>
> -struct slabstat slabstat;
> +static struct slabstat slabstat;
> +static int slabstat_valid = 0;
No need to initialize to 0.
[...]
WBR, Sergei
prev parent reply other threads:[~2015-02-10 12:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-10 2:46 [PATCH] prevent the read ahead of /proc/slabinfo in ss take 2 Bryton Lee
2015-02-10 4:49 ` Eric Dumazet
2015-02-10 5:48 ` Bryton Lee
2015-02-10 12:37 ` Sergei Shtylyov [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=54D9FB96.6080401@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=brytonlee01@gmail.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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;
as well as URLs for NNTP newsgroup(s).