summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authormohans <mohans@FreeBSD.org>2007-03-09 04:02:38 +0000
committermohans <mohans@FreeBSD.org>2007-03-09 04:02:38 +0000
commita332cb00d57e6d307a6d08a69b4d5430b20c7850 (patch)
tree24b2e714c624eb1b06a4af38fe8eb04bc9f63660 /sys/i386
parent088212ae5d87f38b2e7890e8e1a608a268db0add (diff)
downloadFreeBSD-src-a332cb00d57e6d307a6d08a69b4d5430b20c7850.zip
FreeBSD-src-a332cb00d57e6d307a6d08a69b4d5430b20c7850.tar.gz
Over NFS, an open() call could result in multiple over-the-wire
GETATTRs being generated - one from lookup()/namei() and the other from nfs_open() (for cto consistency). This change eliminates the GETATTR in nfs_open() if an otw GETATTR was done from the namei() path. Instead of extending the vop interface, we timestamp each attr load, and use this to detect whether a GETATTR was done from namei() for this syscall. Introduces a thread-local variable that counts the syscalls made by the thread and uses <pid, tid, thread syscalls> as the attrload timestamp. Thanks to jhb@ and peter@ for a discussion on thread state that could be used as the timestamp with minimal overhead.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/trap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c
index 409ac0a..cf25f9f 100644
--- a/sys/i386/i386/trap.c
+++ b/sys/i386/i386/trap.c
@@ -996,6 +996,8 @@ syscall(struct trapframe *frame)
CTR4(KTR_SYSC, "syscall enter thread %p pid %d proc %s code %d", td,
td->td_proc->p_pid, td->td_proc->p_comm, code);
+ td->td_syscalls++;
+
if (error == 0) {
td->td_retval[0] = 0;
td->td_retval[1] = frame->tf_edx;
OpenPOWER on IntegriCloud