lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20060801022951.GB7006@martell.zuzino.mipt.ru>
Date:	Tue, 1 Aug 2006 06:29:51 +0400
From:	Alexey Dobriyan <adobriyan@...il.com>
To:	Andrew Morton <akpm@...l.org>
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] task_struct: remove writeonly counters

Signed-off-by: Alexey Dobriyan <adobriyan@...il.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;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ