mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: zhoufeng <zhoufeng.zf@bytedance.com>
Cc: adobriyan@gmail.com, rppt@kernel.org,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	songmuchun@bytedance.com, zhouchengming@bytedance.com,
	chenying.kernel@bytedance.com, zhengqi.arch@bytedance.com
Subject: Re: [External] Re: [PATCH] fs/proc/kcore.c: add mmap interface
Date: Thu, 27 May 2021 15:30:55 -0700	[thread overview]
Message-ID: <20210527153055.aefeee8d8385da8152bdbacc@linux-foundation.org> (raw)
In-Reply-To: <d71a4ffa-f21e-62f5-7fa6-83ca14b3f05b@bytedance.com>

On Thu, 27 May 2021 14:13:09 +0800 zhoufeng <zhoufeng.zf@bytedance.com> wrote:

> > I'm surprised that it makes this much difference.  Has DRGN been fully
> > optimised to minimise the amount of pread()ing which it does?  Why does
> > it do so much reading?
> DRGN is a tool similar to Crash, but much lighter. It allows users to 
> obtain kernel data structures from Python scripts. Based on this, we 
> intend to use DRGN for kernel monitoring. So we used some pressure test 
> scripts to test the loss of monitoring.
> Monitoring is all about getting current real-time data, so every time 
> DRGN tries to get kernel data, it needs to read /proc/kcore. In my 
> script, I tried to loop 1000 times to obtain the information of all the 
> processes in the machine, in order to construct a scene where kernel 
> data is frequently read. So, the frequency in the default version of 
> kcore, pread is very high. In view of this situation, our optimization 
> idea is to reduce the number of context switches as much as possible 
> under the scenario of frequent kernel data acquisition, to reduce the 
> performance loss to a minimum, and then move the monitoring system to 
> the production environment.

Why would a pread() cause a context switch?

> After running for a long time in a 
> production environment, the number of kernel data reads was added as 
> time went on, and the pread number also increased. If users use mmap, 
> it's once for all.

  parent reply	other threads:[~2021-05-27 22:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26  7:51 Feng zhou
2021-05-27  0:39 ` Andrew Morton
2021-05-27  6:37   ` [External] " zhoufeng
     [not found]   ` <d71a4ffa-f21e-62f5-7fa6-83ca14b3f05b@bytedance.com>
2021-05-27 22:30     ` Andrew Morton [this message]
2021-05-28  2:10       ` zhoufeng
2021-06-01  1:23 ` Andrew Morton
2021-06-01  2:57   ` [External] " zhoufeng

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=20210527153055.aefeee8d8385da8152bdbacc@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=adobriyan@gmail.com \
    --cc=chenying.kernel@bytedance.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rppt@kernel.org \
    --cc=songmuchun@bytedance.com \
    --cc=zhengqi.arch@bytedance.com \
    --cc=zhouchengming@bytedance.com \
    --cc=zhoufeng.zf@bytedance.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®