Date: Sat, 8 Nov 2014 15:39:32 +0000 (UTC) From: "Alexander V. Chernikov" <melifaro@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r274290 - projects/routing/sys/netinet Message-ID: <201411081539.sA8FdWAU077769@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: melifaro Date: Sat Nov 8 15:39:32 2014 New Revision: 274290 URL: https://svnweb.freebsd.org/changeset/base/274290 Log: Retire rtq_timeout altering code. This code was initially introduced by r6399 to enhance expiring large number of host cache routes. Since we don't have route cloning anymore and no one altered V_rtq_toomany default (which is 128) in nearly 20 years, I assume this can be safely deleted. Modified: projects/routing/sys/netinet/in_rmx.c Modified: projects/routing/sys/netinet/in_rmx.c ============================================================================== --- projects/routing/sys/netinet/in_rmx.c Sat Nov 8 14:41:32 2014 (r274289) +++ projects/routing/sys/netinet/in_rmx.c Sat Nov 8 15:39:32 2014 (r274290) @@ -129,20 +129,6 @@ SYSCTL_VNET_INT(_net_inet_ip, IPCTL_RTEX &VNET_NAME(rtq_reallyold), 0, "Default expiration time on dynamically learned routes"); -/* never automatically crank down to less */ -static VNET_DEFINE(int, rtq_minreallyold) = 10; -#define V_rtq_minreallyold VNET(rtq_minreallyold) -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_RTMINEXPIRE, rtminexpire, CTLFLAG_RW, - &VNET_NAME(rtq_minreallyold), 0, - "Minimum time to attempt to hold onto dynamically learned routes"); - -/* 128 cached routes is "too many" */ -static VNET_DEFINE(int, rtq_toomany) = 128; -#define V_rtq_toomany VNET(rtq_toomany) -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_RTMAXCACHE, rtmaxcache, CTLFLAG_RW, - &VNET_NAME(rtq_toomany), 0, - "Upper limit on dynamically learned routes"); - /* * On last reference drop, mark the route as belong to us so that it can be * timed out. @@ -258,7 +244,6 @@ in_rtqtimo_one(void *rock) { struct radix_node_head *rnh = rock; struct rtqk_arg arg; - static time_t last_adjusted_timeout = 0; arg.found = arg.killed = 0; arg.rnh = rnh; @@ -267,35 +252,6 @@ in_rtqtimo_one(void *rock) RADIX_NODE_HEAD_LOCK(rnh); rnh->rnh_walktree(rnh, in_rtqkill, &arg); RADIX_NODE_HEAD_UNLOCK(rnh); - - /* - * Attempt to be somewhat dynamic about this: - * If there are ``too many'' routes sitting around taking up space, - * then crank down the timeout, and see if we can't make some more - * go away. However, we make sure that we will never adjust more - * than once in rtq_timeout seconds, to keep from cranking down too - * hard. - */ - if ((arg.found - arg.killed > V_rtq_toomany) && - (time_uptime - last_adjusted_timeout >= V_rtq_timeout) && - V_rtq_reallyold > V_rtq_minreallyold) { - V_rtq_reallyold = 2 * V_rtq_reallyold / 3; - if (V_rtq_reallyold < V_rtq_minreallyold) { - V_rtq_reallyold = V_rtq_minreallyold; - } - - last_adjusted_timeout = time_uptime; -#ifdef DIAGNOSTIC - log(LOG_DEBUG, "in_rtqtimo: adjusted rtq_reallyold to %d\n", - V_rtq_reallyold); -#endif - arg.found = arg.killed = 0; - arg.updating = 1; - RADIX_NODE_HEAD_LOCK(rnh); - rnh->rnh_walktree(rnh, in_rtqkill, &arg); - RADIX_NODE_HEAD_UNLOCK(rnh); - } - } void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411081539.sA8FdWAU077769>