* [PATCH] task_struct: remove writeonly counters
@ 2006-08-01 2:29 Alexey Dobriyan
2006-08-01 4:01 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Alexey Dobriyan @ 2006-08-01 2:29 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
fs/read_write.c | 23 ++---------------------
include/linux/sched.h | 2 --
kernel/fork.c | 4 ----
3 files changed, 2 insertions(+), 27 deletions(-)
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -264,11 +264,8 @@ ssize_t vfs_read(struct file *file, char
ret = file->f_op->read(file, buf, count, pos);
else
ret = do_sync_read(file, buf, count, pos);
- if (ret > 0) {
+ if (ret > 0)
fsnotify_access(file->f_dentry);
- current->rchar += ret;
- }
- current->syscr++;
}
}
@@ -316,11 +313,8 @@ ssize_t vfs_write(struct file *file, con
ret = file->f_op->write(file, buf, count, pos);
else
ret = do_sync_write(file, buf, count, pos);
- if (ret > 0) {
+ if (ret > 0)
fsnotify_modify(file->f_dentry);
- current->wchar += ret;
- }
- current->syscw++;
}
}
@@ -609,9 +603,6 @@ sys_readv(unsigned long fd, const struct
fput_light(file, fput_needed);
}
- if (ret > 0)
- current->rchar += ret;
- current->syscr++;
return ret;
}
@@ -630,9 +621,6 @@ sys_writev(unsigned long fd, const struc
fput_light(file, fput_needed);
}
- if (ret > 0)
- current->wchar += ret;
- current->syscw++;
return ret;
}
@@ -713,13 +701,6 @@ 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;
- }
- current->syscr++;
- current->syscw++;
-
if (*ppos > max)
retval = -EOVERFLOW;
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -962,8 +962,6 @@ #endif
* to a stack based synchronous wait) if its doing sync IO.
*/
wait_queue_t *io_wait;
-/* i/o counters(bytes read/written, #syscalls */
- u64 rchar, wchar, syscr, syscw;
#if defined(CONFIG_BSD_PROCESS_ACCT)
u64 acct_rss_mem1; /* accumulated rss usage */
u64 acct_vm_mem1; /* accumulated virtual memory usage */
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1024,10 +1024,6 @@ #endif
p->utime = cputime_zero;
p->stime = cputime_zero;
p->sched_time = 0;
- 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 */
acct_clear_integrals(p);
p->it_virt_expires = cputime_zero;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] task_struct: remove writeonly counters
2006-08-01 2:29 [PATCH] task_struct: remove writeonly counters Alexey Dobriyan
@ 2006-08-01 4:01 ` Andrew Morton
2006-08-01 4:12 ` Alexey Dobriyan
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2006-08-01 4:01 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: linux-kernel, Jay Lan
On Tue, 1 Aug 2006 06:29:51 +0400
Alexey Dobriyan <adobriyan@gmail.com> wrote:
> ...
>
> +++ b/include/linux/sched.h
> @@ -962,8 +962,6 @@ #endif
> * to a stack based synchronous wait) if its doing sync IO.
> */
> wait_queue_t *io_wait;
> -/* i/o counters(bytes read/written, #syscalls */
> - u64 rchar, wchar, syscr, syscw;
This is kinda funny. These fields were added a year and a half ago, with
the intention that the info be made available to userspace. But then
things got horridly stuck. It's only in the past couple of weeks that we've
gained appropriate reporting-to-userspace infrastructure to be able to use
these fields.
And lo, on the very day when you propose removing these fields, Jay posts a
new patchset ("add CSA accounting to taskstats") which finally gets around to
using them.
So.. we should keep these fields for now - we can perhaps remove them (in
less than 1.5 years) if for some reason the CSA patches crash and burn (I
don't think they will).
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] task_struct: remove writeonly counters
2006-08-01 4:01 ` Andrew Morton
@ 2006-08-01 4:12 ` Alexey Dobriyan
0 siblings, 0 replies; 3+ messages in thread
From: Alexey Dobriyan @ 2006-08-01 4:12 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, Jay Lan
On Mon, Jul 31, 2006 at 09:01:07PM -0700, Andrew Morton wrote:
> On Tue, 1 Aug 2006 06:29:51 +0400
> Alexey Dobriyan <adobriyan@gmail.com> wrote:
>
> > ...
> >
> > +++ b/include/linux/sched.h
> > @@ -962,8 +962,6 @@ #endif
> > * to a stack based synchronous wait) if its doing sync IO.
> > */
> > wait_queue_t *io_wait;
> > -/* i/o counters(bytes read/written, #syscalls */
> > - u64 rchar, wchar, syscr, syscw;
>
> This is kinda funny. These fields were added a year and a half ago, with
> the intention that the info be made available to userspace. But then
> things got horridly stuck. It's only in the past couple of weeks that we've
> gained appropriate reporting-to-userspace infrastructure to be able to use
> these fields.
>
> And lo, on the very day when you propose removing these fields, Jay posts a
> new patchset ("add CSA accounting to taskstats") which finally gets around to
> using them.
[checks archives]
*cough* That was a coincidence, I assure you.
> So.. we should keep these fields for now - we can perhaps remove them (in
> less than 1.5 years) if for some reason the CSA patches crash and burn (I
> don't think they will).
Perhaps, Jay can properly ifdef them with CONFIG_CSA_ACCT or something?
And remove in-file changelogs 'cause there is git?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-08-01 4:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-01 2:29 [PATCH] task_struct: remove writeonly counters Alexey Dobriyan
2006-08-01 4:01 ` Andrew Morton
2006-08-01 4:12 ` Alexey Dobriyan
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®