From: akpm@linux-foundation.org
To: adobriyan@gmail.com, balbir@in.ibm.com, jlan@engr.sgi.com,
mm-commits@vger.kernel.org
Subject: - ifdef-rchar-wchar-syscr-syscw-from-task_struct.patch removed from -mm tree
Date: Sun, 11 Feb 2007 14:55:38 -0800 [thread overview]
Message-ID: <200702112255.l1BMtcL9016344@shell0.pdx.osdl.net> (raw)
The patch titled
ifdef ->rchar, ->wchar, ->syscr, ->syscw from task_struct
has been removed from the -mm tree. Its filename was
ifdef-rchar-wchar-syscr-syscw-from-task_struct.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
Subject: ifdef ->rchar, ->wchar, ->syscr, ->syscw from task_struct
From: Alexey Dobriyan <adobriyan@gmail.com>
They are fat: 4x8 bytes in task_struct.
They are uncoditionally updated in every fork, read, write and sendfile.
They are used only if you have some "extended acct fields feature".
And please, please, please, read(2) knows about bytes, not characters,
why it is called "rchar"?
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Jay Lan <jlan@engr.sgi.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
fs/proc/base.c | 4 ++++
fs/read_write.c | 24 ++++++++++++------------
include/linux/sched.h | 40 ++++++++++++++++++++++++++++++++++++++++
kernel/fork.c | 2 ++
4 files changed, 58 insertions(+), 12 deletions(-)
diff -puN fs/proc/base.c~ifdef-rchar-wchar-syscr-syscw-from-task_struct fs/proc/base.c
--- a/fs/proc/base.c~ifdef-rchar-wchar-syscr-syscw-from-task_struct
+++ a/fs/proc/base.c
@@ -1810,17 +1810,21 @@ static int proc_base_fill_cache(struct f
static int proc_pid_io_accounting(struct task_struct *task, char *buffer)
{
return sprintf(buffer,
+#ifdef CONFIG_TASK_XACCT
"rchar: %llu\n"
"wchar: %llu\n"
"syscr: %llu\n"
"syscw: %llu\n"
+#endif
"read_bytes: %llu\n"
"write_bytes: %llu\n"
"cancelled_write_bytes: %llu\n",
+#ifdef CONFIG_TASK_XACCT
(unsigned long long)task->rchar,
(unsigned long long)task->wchar,
(unsigned long long)task->syscr,
(unsigned long long)task->syscw,
+#endif
(unsigned long long)task->ioac.read_bytes,
(unsigned long long)task->ioac.write_bytes,
(unsigned long long)task->ioac.cancelled_write_bytes);
diff -puN fs/read_write.c~ifdef-rchar-wchar-syscr-syscw-from-task_struct fs/read_write.c
--- a/fs/read_write.c~ifdef-rchar-wchar-syscr-syscw-from-task_struct
+++ a/fs/read_write.c
@@ -274,9 +274,9 @@ ssize_t vfs_read(struct file *file, char
ret = do_sync_read(file, buf, count, pos);
if (ret > 0) {
fsnotify_access(file->f_path.dentry);
- current->rchar += ret;
+ add_rchar(current, ret);
}
- current->syscr++;
+ inc_syscr(current);
}
}
@@ -332,9 +332,9 @@ ssize_t vfs_write(struct file *file, con
ret = do_sync_write(file, buf, count, pos);
if (ret > 0) {
fsnotify_modify(file->f_path.dentry);
- current->wchar += ret;
+ add_wchar(current, ret);
}
- current->syscw++;
+ inc_syscw(current);
}
}
@@ -675,8 +675,8 @@ sys_readv(unsigned long fd, const struct
}
if (ret > 0)
- current->rchar += ret;
- current->syscr++;
+ add_rchar(current, ret);
+ inc_syscr(current);
return ret;
}
@@ -696,8 +696,8 @@ sys_writev(unsigned long fd, const struc
}
if (ret > 0)
- current->wchar += ret;
- current->syscw++;
+ add_wchar(current, ret);
+ inc_syscw(current);
return ret;
}
@@ -779,12 +779,12 @@ static ssize_t do_sendfile(int out_fd, i
retval = in_file->f_op->sendfile(in_file, ppos, count, file_send_actor, out_file);
if (retval > 0) {
- current->rchar += retval;
- current->wchar += retval;
+ add_rchar(current, retval);
+ add_wchar(current, retval);
}
- current->syscr++;
- current->syscw++;
+ inc_syscr(current);
+ inc_syscw(current);
if (*ppos > max)
retval = -EOVERFLOW;
diff -puN include/linux/sched.h~ifdef-rchar-wchar-syscr-syscw-from-task_struct include/linux/sched.h
--- a/include/linux/sched.h~ifdef-rchar-wchar-syscr-syscw-from-task_struct
+++ a/include/linux/sched.h
@@ -1013,8 +1013,10 @@ struct task_struct {
* to a stack based synchronous wait) if its doing sync IO.
*/
wait_queue_t *io_wait;
+#ifdef CONFIG_TASK_XACCT
/* i/o counters(bytes read/written, #syscalls */
u64 rchar, wchar, syscr, syscw;
+#endif
struct task_io_accounting ioac;
#if defined(CONFIG_TASK_XACCT)
u64 acct_rss_mem1; /* accumulated rss usage */
@@ -1649,6 +1651,44 @@ extern int sched_create_sysfs_power_savi
extern void normalize_rt_tasks(void);
+#ifdef CONFIG_TASK_XACCT
+static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
+{
+ tsk->rchar += amt;
+}
+
+static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
+{
+ tsk->wchar += amt;
+}
+
+static inline void inc_syscr(struct task_struct *tsk)
+{
+ tsk->syscr++;
+}
+
+static inline void inc_syscw(struct task_struct *tsk)
+{
+ tsk->syscw++;
+}
+#else
+static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
+{
+}
+
+static inline void add_wchar(struct task_struct *tsk, ssize_t amt)
+{
+}
+
+static inline void inc_syscr(struct task_struct *tsk)
+{
+}
+
+static inline void inc_syscw(struct task_struct *tsk)
+{
+}
+#endif
+
#endif /* __KERNEL__ */
#endif
diff -puN kernel/fork.c~ifdef-rchar-wchar-syscr-syscw-from-task_struct kernel/fork.c
--- a/kernel/fork.c~ifdef-rchar-wchar-syscr-syscw-from-task_struct
+++ a/kernel/fork.c
@@ -1038,10 +1038,12 @@ static struct task_struct *copy_process(
p->utime = cputime_zero;
p->stime = cputime_zero;
p->sched_time = 0;
+#ifdef CONFIG_TASK_XACCT
p->rchar = 0; /* I/O counter: bytes read */
p->wchar = 0; /* I/O counter: bytes written */
p->syscr = 0; /* I/O counter: read syscalls */
p->syscw = 0; /* I/O counter: write syscalls */
+#endif
task_io_accounting_init(p);
acct_clear_integrals(p);
_
Patches currently in -mm which might be from adobriyan@gmail.com are
origin.patch
git-dvb.patch
megaraid-fix-warnings-when-config_proc_fs=n.patch
recognize-video=gx1fb-option.patch
reply other threads:[~2007-02-11 22:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200702112255.l1BMtcL9016344@shell0.pdx.osdl.net \
--to=akpm@linux-foundation.org \
--cc=adobriyan@gmail.com \
--cc=balbir@in.ibm.com \
--cc=jlan@engr.sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@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.