Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151827640
D23964.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D23964.diff
View Options
Index: head/sys/kern/sys_pipe.c
===================================================================
--- head/sys/kern/sys_pipe.c
+++ head/sys/kern/sys_pipe.c
@@ -230,6 +230,7 @@
static int pipe_paircreate(struct thread *td, struct pipepair **p_pp);
static __inline int pipelock(struct pipe *cpipe, int catch);
static __inline void pipeunlock(struct pipe *cpipe);
+static void pipe_timestamp(struct timespec *tsp);
#ifndef PIPE_NODIRECT
static int pipe_build_write_buffer(struct pipe *wpipe, struct uio *uio);
static void pipe_destroy_write_buffer(struct pipe *wpipe);
@@ -279,7 +280,7 @@
*/
rpipe = &pp->pp_rpipe;
bzero(rpipe, sizeof(*rpipe));
- vfs_timestamp(&rpipe->pipe_ctime);
+ pipe_timestamp(&rpipe->pipe_ctime);
rpipe->pipe_atime = rpipe->pipe_mtime = rpipe->pipe_ctime;
wpipe = &pp->pp_wpipe;
@@ -422,6 +423,20 @@
}
/*
+ * Get a timestamp.
+ *
+ * This used to be vfs_timestamp but the higher precision is unnecessary and
+ * can very negatively affect performance in virtualized environments (e.g., on
+ * vms running on amd64 when using the rdtscp instruction).
+ */
+static void
+pipe_timestamp(struct timespec *tsp)
+{
+
+ getnanotime(tsp);
+}
+
+/*
* The pipe system call for the DTYPE_PIPE type of pipes. If we fail, let
* the zone pick up the pieces via pipeclose().
*/
@@ -804,7 +819,7 @@
/* XXX: should probably do this before getting any locks. */
if (error == 0)
- vfs_timestamp(&rpipe->pipe_atime);
+ pipe_timestamp(&rpipe->pipe_atime);
unlocked_error:
--rpipe->pipe_busy;
@@ -1290,7 +1305,7 @@
error = 0;
if (error == 0)
- vfs_timestamp(&wpipe->pipe_mtime);
+ pipe_timestamp(&wpipe->pipe_mtime);
/*
* We have something to offer,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 11, 10:47 PM (13 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31312646
Default Alt Text
D23964.diff (1 KB)
Attached To
Mode
D23964: pipe: reduce atime precision
Attached
Detach File
Event Timeline
Log In to Comment