From: Arjan van de Ven <arjan@linux.intel.com>
To: Arjan van de Ven <arjan@linux.intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [patch 3/3] LatencyTOP instrumentations part 2
Date: Fri, 18 Jan 2008 09:42:16 -0800 [thread overview]
Message-ID: <20080118094216.1bf78ff3@laptopd505.fenrus.org> (raw)
In-Reply-To: <4790E3A6.7060807@linux.intel.com>
A few more high level annotations for LatencyTOP;
split into a separate patch since they're at a higher level
than the first part (and thus hide some lower level details
potentially, but could also obsolete several other low level
instrumentations)
---
fs/read_write.c | 7 ++++++-
fs/readdir.c | 4 +++-
lib/kernel_lock.c | 3 +++
3 files changed, 12 insertions(+), 2 deletions(-)
Index: linux-2.6.24-rc7/fs/read_write.c
===================================================================
--- linux-2.6.24-rc7.orig/fs/read_write.c
+++ linux-2.6.24-rc7/fs/read_write.c
@@ -255,6 +255,7 @@ EXPORT_SYMBOL(do_sync_read);
ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
{
+ struct latency_entry reason;
ssize_t ret;
if (!(file->f_mode & FMODE_READ))
@@ -264,6 +265,7 @@ ssize_t vfs_read(struct file *file, char
if (unlikely(!access_ok(VERIFY_WRITE, buf, count)))
return -EFAULT;
+ set_latency_reason("Reading from file", &reason);
ret = rw_verify_area(READ, file, pos, count);
if (ret >= 0) {
count = ret;
@@ -281,6 +283,7 @@ ssize_t vfs_read(struct file *file, char
}
}
+ restore_latency_reason(&reason);
return ret;
}
@@ -314,6 +317,7 @@ EXPORT_SYMBOL(do_sync_write);
ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_t *pos)
{
ssize_t ret;
+ struct latency_entry reason;
if (!(file->f_mode & FMODE_WRITE))
return -EBADF;
@@ -322,6 +326,7 @@ ssize_t vfs_write(struct file *file, con
if (unlikely(!access_ok(VERIFY_READ, buf, count)))
return -EFAULT;
+ set_latency_reason("Writing to file", &reason);
ret = rw_verify_area(WRITE, file, pos, count);
if (ret >= 0) {
count = ret;
@@ -338,7 +343,7 @@ ssize_t vfs_write(struct file *file, con
inc_syscw(current);
}
}
-
+ restore_latency_reason(&reason);
return ret;
}
Index: linux-2.6.24-rc7/fs/readdir.c
===================================================================
--- linux-2.6.24-rc7.orig/fs/readdir.c
+++ linux-2.6.24-rc7/fs/readdir.c
@@ -21,6 +21,7 @@
int vfs_readdir(struct file *file, filldir_t filler, void *buf)
{
+ struct latency_entry reason;
struct inode *inode = file->f_path.dentry->d_inode;
int res = -ENOTDIR;
if (!file->f_op || !file->f_op->readdir)
@@ -29,7 +30,7 @@ int vfs_readdir(struct file *file, filld
res = security_file_permission(file, MAY_READ);
if (res)
goto out;
-
+ set_latency_reason("Unlinking file", &reason);
mutex_lock(&inode->i_mutex);
res = -ENOENT;
if (!IS_DEADDIR(inode)) {
@@ -37,6 +38,7 @@ int vfs_readdir(struct file *file, filld
file_accessed(file);
}
mutex_unlock(&inode->i_mutex);
+ restore_latency_reason(&reason);
out:
return res;
}
Index: linux-2.6.24-rc7/lib/kernel_lock.c
===================================================================
--- linux-2.6.24-rc7.orig/lib/kernel_lock.c
+++ linux-2.6.24-rc7/lib/kernel_lock.c
@@ -64,15 +64,18 @@ void __lockfunc __release_kernel_lock(vo
*/
void __lockfunc lock_kernel(void)
{
+ struct latency_entry reason;
struct task_struct *task = current;
int depth = task->lock_depth + 1;
+ set_latency_reason("Big kernel lock contention", &reason);
if (likely(!depth))
/*
* No recursion worries - we set up lock_depth _after_
*/
down(&kernel_sem);
+ restore_latency_reason(&reason);
task->lock_depth = depth;
}
next prev parent reply other threads:[~2008-01-18 17:43 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-18 17:36 [Announce] Development release 0.1 of the LatencyTOP tool Arjan van de Ven
2008-01-18 17:39 ` [patch 1/3] LatencyTOP infrastructure patch Arjan van de Ven
2008-01-20 11:34 ` Helge Deller
2008-01-20 16:47 ` Dmitry Adamushko
2008-01-20 17:18 ` Dmitry Adamushko
2008-01-21 8:06 ` KOSAKI Motohiro
2008-01-21 16:16 ` Arjan van de Ven
2008-01-18 17:40 ` [patch 2/3] Latencytop instrumentations part 1 Arjan van de Ven
2008-01-18 22:26 ` Frank Ch. Eigler
2008-01-18 22:33 ` Arjan van de Ven
2008-01-18 22:47 ` Arnaldo Carvalho de Melo
2008-01-18 23:11 ` Frank Ch. Eigler
2008-01-18 23:20 ` Arjan van de Ven
2008-01-18 17:42 ` Arjan van de Ven [this message]
2008-01-18 18:27 ` [Announce] Development release 0.1 of the LatencyTOP tool Roberto Fichera
2008-01-18 18:35 ` Arjan van de Ven
2008-01-18 18:46 ` Roberto Fichera
2008-01-18 19:02 ` Zan Lynx
2008-01-19 5:07 ` Andi Kleen
2008-01-19 5:16 ` Arjan van de Ven
2008-01-19 5:27 ` Andi Kleen
2008-01-19 5:25 ` Arjan van de Ven
2008-01-19 5:33 ` Andi Kleen
2008-01-19 5:34 ` Arjan van de Ven
2008-01-19 6:08 ` Andi Kleen
2008-01-19 5:37 ` [Announce] Development release 0.1 of the LatencyTOP tool II Andi Kleen
2008-01-21 0:52 ` Development release 0.1 of the LatencyTOP tool KOSAKI Motohiro
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=20080118094216.1bf78ff3@laptopd505.fenrus.org \
--to=arjan@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®