Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jan 2021 12:16:38 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 4f2cbaf3cd59 - main - Track pipe(2) reads and writes as rusage message receives and sends, a feature misplaced during the transition from BSD 4.4's socket implementation to the optimised FreeBSD pipe implementation.
Message-ID:  <202101101216.10ACGcGr098246@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by rwatson:

URL: https://cgit.FreeBSD.org/src/commit/?id=4f2cbaf3cd5900b06d3b5ad97db1962ec4fa0ffd

commit 4f2cbaf3cd5900b06d3b5ad97db1962ec4fa0ffd
Author:     Robert Watson <rwatson@FreeBSD.org>
AuthorDate: 2021-01-01 13:04:46 +0000
Commit:     Robert Watson <rwatson@FreeBSD.org>
CommitDate: 2021-01-10 12:16:39 +0000

    Track pipe(2) reads and writes as rusage message receives and sends, a
    feature misplaced during the transition from BSD 4.4's socket implementation
    to the optimised FreeBSD pipe implementation.
    
    MFC after:              1 week
    Reviewed by:            arichardson, imp
    Differential Revision:  https://reviews.freebsd.org/D27878
---
 sys/kern/sys_pipe.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c
index 76ab7bab05f7..558337794950 100644
--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -857,6 +857,8 @@ unlocked_error:
 		pipeselwakeup(rpipe);
 
 	PIPE_UNLOCK(rpipe);
+	if (nread > 0)
+		td->td_ru.ru_msgrcv++;
 	return (error);
 }
 
@@ -1314,6 +1316,8 @@ pipe_write(struct file *fp, struct uio *uio, struct ucred *active_cred,
 
 	pipeunlock(wpipe);
 	PIPE_UNLOCK(rpipe);
+	if (uio->uio_resid != orig_resid)
+		td->td_ru.ru_msgsnd++;
 	return (error);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101101216.10ACGcGr098246>