Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Aug 2005 17:05:19 -0700
From:      Luigi Rizzo <rizzo@icir.org>
To:        arch@freebsd.org, net@freebsd.org
Subject:   duplicate  read/write locks in net/pfil.c and netinet/ip_fw2.c
Message-ID:  <20050816170519.A74422@xorpc.icir.org>

next in thread | raw e-mail | index | archive | help
[apologies for the cross post but it belongs both to arch and net.]

I notice that net/pfil.c and netinet/ip_fw2.c have two copies of
aisimilar but slightly different implementation of
multiple-reader/single-writer locks, which brings up the question(s):

1. should we rather put this code in the generic kernel code so that other
   subsystems could make use of it ? E.g. the routing table is certainly
   a candidate, 

and especially

2. should we implement it right ?

   Both implementations are subject to starvation for the writers
   (which is indeed a problem here, because we might want to modify
   a ruleset and be prevented from doing it because of incoming traffic
   that keeps readers active).
   Also the PFIL_TRY_WLOCK will in fact be blocking if a writer
   is already in - i have no idea how problematic is this in the
   way it is actually used.


	cheers
	luigi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050816170519.A74422>