* Adjust the NFS server to check for LWP_MP_VNLRU garbage collection
requests and act on them.
This prevents excessive allocation of vnodes by the nfsd's.
}
/*
+ * Kernel threads run from user processes can also accumulate deferred
+ * actions which need to be acted upon. Callers include:
+ *
+ * nfsd - Can allocate lots of vnodes
+ */
+void
+lwpkthreaddeferred(void)
+{
+ struct lwp *lp = curthread->td_lwp;
+
+ if (lp) {
+ if (lp->lwp_mpflags & LWP_MP_VNLRU) {
+ atomic_clear_int(&lp->lwp_mpflags, LWP_MP_VNLRU);
+ allocvnode_gc();
+ }
+ }
+}
+
+/*
* Scan all processes on the allproc list. The process is automatically
* held for the callback. A return value of -1 terminates the loop.
*
void prelezomb (struct proc *);
void pstall (struct proc *, const char *, int);
void lwpuserret(struct lwp *);
+void lwpkthreaddeferred(void);
u_int32_t procrunnable (void);
error = (*(nfsrv3_procs[nd->nd_procnum]))(nd,
slp, nfsd->nfsd_td, &mreq);
/* NOT YET lwkt_gettoken(&slp->ns_token); */
+ lwpkthreaddeferred(); /* vnlru issues */
}
if (mreq == NULL)
break;