From: Borislav Petkov <bp@alien8.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
"anish singh" <anish198519851985@gmail.com>,
"amit mehta" <gmate.amit@gmail.com>,
"Henrique Rodrigues" <henriquesilvar@gmail.com>,
"kishore kumar" <kishoreopen@gmail.com>,
"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
linux-kernel@vger.kernel.org, Kernelnewbies@kernelnewbies.org
Subject: Re: how to look for source code in kernel
Date: Sat, 29 Dec 2012 12:09:28 +0100 [thread overview]
Message-ID: <20121229110928.GA17811@x1.alien8.de> (raw)
In-Reply-To: <CAMuHMdVo67RrcencMOTJSL_=fGjDFBtczRpvW6D8QbVxNy-t3g@mail.gmail.com>
On Fri, Dec 28, 2012 at 11:03:40PM +0100, Geert Uytterhoeven wrote:
> That's the first run. Now everything is in the buffer cache (assumed
> you have enough RAM), and try again...
Right, until you do something else on the box requiring just the right
amount of memory to overflow the buffer cache working set and start
kicking out pages. Btw, the thing has 4G of RAM.
* first run:
$ time git ls-files | xargs grep -E 'struct mce\W*{'
arch/x86/include/uapi/asm/mce.h:struct mce {
arch/x86/kernel/cpu/mcheck/mce.c: if (!final || memcmp(m, final, sizeof(struct mce))) {
real 2m48.415s
user 0m2.388s
sys 0m15.668s
* second run coming from the buffer cache, search for something else:
$ time git ls-files | xargs grep -E 'struct task_struct\W*{'
include/linux/sched.h:struct task_struct {
real 0m1.651s
user 0m0.672s
sys 0m1.048s
* do something else (kernel build, git gc, some (very leaky) userspace
memory hog, whatever :)) which kicks some buffer cache pages out:
$ time git ls-files | xargs grep -E 'struct mce\W*{'
arch/x86/include/uapi/asm/mce.h:struct mce {
arch/x86/kernel/cpu/mcheck/mce.c: if (!final || memcmp(m, final, sizeof(struct mce))) {
real 0m37.360s
user 0m1.152s
sys 0m4.176s
so on a machine with a lot of memory and an SSD, you can probably safely
rely on the buffer cache but not on a laptop, in my experience.
Btw, cscope can also grep for regex patterns so you don't need the git
grep thing anymore, especially since it looks at tracked files only.
Thanks.
--
Regards/Gruss,
Boris.
next prev parent reply other threads:[~2012-12-29 11:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-27 17:31 how to look for source code in kernel kishore kumar
2012-12-27 18:40 ` Jonathan Neuschäfer
2012-12-27 19:53 ` Henrique Rodrigues
2012-12-28 4:49 ` anish singh
2012-12-28 4:49 ` anish singh
2012-12-28 5:12 ` amit mehta
2012-12-28 5:12 ` amit mehta
2012-12-28 5:19 ` anish singh
2012-12-28 5:19 ` anish singh
2012-12-28 5:37 ` Alex Belits
2012-12-28 7:36 ` Eric W. Biederman
2012-12-28 13:07 ` Borislav Petkov
2012-12-28 22:03 ` Geert Uytterhoeven
2012-12-29 11:09 ` Borislav Petkov [this message]
2012-12-28 22:23 ` Guennadi Liakhovetski
2012-12-28 22:38 ` Jesper Juhl
2012-12-28 23:08 ` [PATCH] scripts/tags.sh: Fix regex syntax for etags Andreas Schwab
2012-12-28 23:22 ` Jesper Juhl
2013-01-13 21:23 ` Michal Marek
2012-12-28 16:09 ` how to look for source code in kernel Al Viro
2012-12-28 19:49 ` Eric W. Biederman
2012-12-28 20:42 ` Jonathan Neuschäfer
2012-12-28 20:42 ` Jonathan Neuschäfer
2012-12-28 21:31 ` Joe Perches
2012-12-28 9:49 ` Mulyadi Santosa
2012-12-28 10:11 ` Arun KS
2012-12-28 5:40 ` Chen Gang F T
2012-12-28 5:49 ` Chen Gang F T
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=20121229110928.GA17811@x1.alien8.de \
--to=bp@alien8.de \
--cc=Kernelnewbies@kernelnewbies.org \
--cc=anish198519851985@gmail.com \
--cc=ebiederm@xmission.com \
--cc=geert@linux-m68k.org \
--cc=gmate.amit@gmail.com \
--cc=henriquesilvar@gmail.com \
--cc=j.neuschaefer@gmx.net \
--cc=kishoreopen@gmail.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 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.