|
@@ -259,9 +259,16 @@ static void inc_inflight_move_tail(struct unix_sock *u)
|
|
}
|
|
}
|
|
|
|
|
|
static bool gc_in_progress = false;
|
|
static bool gc_in_progress = false;
|
|
|
|
+#define UNIX_INFLIGHT_TRIGGER_GC 16000
|
|
|
|
|
|
void wait_for_unix_gc(void)
|
|
void wait_for_unix_gc(void)
|
|
{
|
|
{
|
|
|
|
+ /*
|
|
|
|
+ * If number of inflight sockets is insane,
|
|
|
|
+ * force a garbage collect right now.
|
|
|
|
+ */
|
|
|
|
+ if (unix_tot_inflight > UNIX_INFLIGHT_TRIGGER_GC && !gc_in_progress)
|
|
|
|
+ unix_gc();
|
|
wait_event(unix_gc_wait, gc_in_progress == false);
|
|
wait_event(unix_gc_wait, gc_in_progress == false);
|
|
}
|
|
}
|
|
|
|
|