Date: Thu, 16 Aug 2007 13:18:51 -0700 (PDT) From: Jeff Roberson <jroberson@chesapeake.net> To: John Baldwin <jhb@freebsd.org> Cc: freebsd-arch@freebsd.org Subject: Re: file locking. Message-ID: <20070816131327.J568@10.0.0.1> In-Reply-To: <200708161056.31494.jhb@freebsd.org> References: <20070815233852.X568@10.0.0.1> <200708161056.31494.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 16 Aug 2007, John Baldwin wrote: > On Thursday 16 August 2007 03:01:18 am Jeff Roberson wrote: >> I have been looking at file locking for 8.0 and have come up with a way to >> completely eliminate the file lock, reduce the size of struct file by >> ~4 pointers (22%), remove the global list of files and associated lock, >> and restrict the scope of unp_gc while removing several race conditions. > Thanks for the review. > I like finit(). I would maybe change socketpair() to pass so1 and so2 to > finit() rather than setting f_data twice. I'm not sure what you mean? > > Did you consider using refcount_* for f_count rather than using the atomic > operations directly? Yes, I may change it. I was investigating some schemes where it may not have been sufficient but I think it will work fine for what I've settled on. I also think I'll wrap some atomics for manipulating f_type in macros. > > It appears you never call unp_discard() and thus 'closef()' on the sockets in > unp_gc() now. Perhaps the fdrop()'s in the end of the loop should be > unp_discard()'s instead? unp_discard() happens as a side-effect of sorflush(). > > Also, it's a bit of a shame to lose 'show files' from ddb. Yes, I can re-implement that using the same technique as sysctl kern.file. What's more troubling is the continued erosion of support for libkvm as it uses filelist. I don't think libkvm is a strong enough case to keep filelist around. I guess I will have to hack it to work similarly to sysctl as well. Do we have an official stance on libkvm? Now that we have sysctl for run-time it's only useful for crashdump debugging. Really in most cases it could be replaced with a reasonable set of gcc scripts. Jeff > > -- > John Baldwin >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070816131327.J568>