From owner-cvs-all@FreeBSD.ORG Mon Jul 7 12:04:25 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D995E10656D3; Mon, 7 Jul 2008 12:04:25 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id ABA258FC25; Mon, 7 Jul 2008 12:04:25 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 1141346C40; Mon, 7 Jul 2008 08:04:25 -0400 (EDT) Date: Mon, 7 Jul 2008 13:04:24 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Andre Oppermann In-Reply-To: <48720552.9000605@freebsd.org> Message-ID: <20080707130242.Y63144@fledge.watson.org> References: <200807071057.m67Av9WD014167@repoman.freebsd.org> <20080707121042.W63144@fledge.watson.org> <48720552.9000605@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/netinet udp_usrreq.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2008 12:04:26 -0000 On Mon, 7 Jul 2008, Andre Oppermann wrote: > Caching the route in the inpcb has a number of problems: > > - any routing table change has to walk all inpcb's to invalidate > and remove outdated and invalid references. > > - adding host routes again just bloats the table again and makes > lookups more expensive. > > - host routes (cloned) do not change when the underlying route is > adjusted and packets are still routed to the old gateway (for > example new default route). > > - We have a tangled mess of cross-pointers and dependencies again > precluding optimizations to the routing table and code itself. The move towards read-write locking in UDP also complicates inpcb route caching, as there is no longer a guarantee that there's exclusive access to the inpcb in udp_output() and ip_output() -- the lock passed down may be a read lock, in which case a cached route can be used if appropriate, but not replaced if it's not the right one or otherwise inappropriate. This particular issue won't affect TCP for the forseeable future as it almost universally uses write locking on the inpcb. Robert N M Watson Computer Laboratory University of Cambridge