FreeBSD Bugzilla – Attachment 117284 Details for
Bug 159355
[kernel] [patch] unp_gc in 8.2 is once again being overly agressive in recycling port rights
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.58 KB, created by
Spencer Minear
on 2011-08-01 14:50:09 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Spencer Minear
Created:
2011-08-01 14:50:09 UTC
Size:
3.58 KB
patch
obsolete
>Index: uipc_usrreq.c >=================================================================== >RCS file: /projects/fusion/cvs/src/freebsd/sys/kern/uipc_usrreq.c,v >retrieving revision 1.24 >retrieving revision 1.25 >diff -c -r1.24 -r1.25 >*** uipc_usrreq.c 23 May 2011 16:04:40 -0000 1.24 >--- uipc_usrreq.c 26 Jul 2011 21:34:10 -0000 1.25 >*************** >*** 2106,2111 **** >--- 2106,2118 ---- > SYSCTL_INT(_net_local, OID_AUTO, recycled, CTLFLAG_RD, &unp_recycled, 0, > "Number of unreachable sockets claimed by the garbage collector."); > >+ #ifdef SCC_KERNEL >+ static int unp_recovered; >+ SYSCTL_INT(_net_local, OID_AUTO, recovered, CTLFLAG_RD, >+ &unp_recovered, 0, >+ "Number of times gc declared a socket dead but it was just externalized."); >+ #endif /* SCC_KERNEL */ >+ > static int unp_taskcount; > SYSCTL_INT(_net_local, OID_AUTO, taskcount, CTLFLAG_RD, &unp_taskcount, 0, > "Number of times the garbage collector has run."); >*************** >*** 2118,2123 **** >--- 2125,2133 ---- > struct file **unref; > struct unpcb *unp; > int i; >+ #ifdef SCC_KERNEL >+ int dead_cnt; >+ #endif /* SCC_KERNEL */ > > unp_taskcount++; > UNP_LIST_LOCK(); >*************** >*** 2156,2170 **** >--- 2166,2202 ---- > * as as unreachable and store them locally. > */ > UNP_LIST_LOCK(); >+ #ifndef SCC_KERNEL > for (i = 0, head = heads; *head != NULL; head++) >+ #else >+ for (dead_cnt = 0, head = heads; *head != NULL; head++) >+ #endif /* !SCC_KERNEL */ > LIST_FOREACH(unp, *head, unp_link) > if (unp->unp_gcflag & UNPGC_DEAD) { >+ #ifdef SCC_KERNEL >+ if (unp->unp_msgcount == 0) { >+ /* This was probably externalized >+ * between when it was marked dead >+ * by an early unp_scan and the unp >+ * that carried it could be scanned */ >+ unp_recovered++; >+ } else { >+ unref[dead_cnt++] = unp->unp_file; >+ #else > unref[i++] = unp->unp_file; >+ #endif /* SCC_KERNEL */ > fhold(unp->unp_file); > KASSERT(unp->unp_file != NULL, > ("unp_gc: Invalid unpcb.")); >+ #ifndef SCC_KERNEL > KASSERT(i <= unp_unreachable, > ("unp_gc: incorrect unreachable count.")); >+ #else >+ KASSERT(dead_cnt <= unp_unreachable, >+ ("unp_gc: incorrect unreachable count.")); >+ >+ } >+ #endif /* !SCC_KERNEL */ > } > UNP_LIST_UNLOCK(); > >*************** >*** 2173,2187 **** >--- 2205,2231 ---- > * struct files associated with these sockets but leave each socket > * with one remaining ref. > */ >+ #ifndef SCC_KERNEL > for (i = 0; i < unp_unreachable; i++) >+ #else >+ for (i = 0; i < dead_cnt; i++) >+ #endif /* !SCC_KERNEL */ > sorflush(unref[i]->f_data); > > /* > * And finally release the sockets so they can be reclaimed. > */ >+ #ifndef SCC_KERNEL > for (i = 0; i < unp_unreachable; i++) >+ #else >+ for (i = 0; i < dead_cnt; i++) >+ #endif /* !SCC_KERNEL */ > fdrop(unref[i], NULL); >+ #ifndef SCC_KERNEL > unp_recycled += unp_unreachable; >+ #else >+ unp_recycled += dead_cnt; >+ #endif /* !SCC_KERNEL */ > free(unref, M_TEMP); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 159355
: 117284