Re: FD array expansion problem

Matthew Wilcox (Matthew.Wilcox@genedata.com)
Thu, 28 Oct 1999 13:35:19 +0200


On Wed, Oct 27, 1999 at 09:15:50PM +0400, Savochkin Andrey Vladimirovich wrote:
> BTW, does anyone know why fd array manipulations are performed via atomic
> operation (xchg) in some places (fd_install, expand_fdset)?
> It looks strange because
> 1) atomic operations don't cover all accesses;
> 2) these code parts are already protected by a write lock.

I'd like to just plead with people _not_ to use xchg unnecessarily.
On PA-RISC, it is going to _suck_. PA-RISC's only atomic instruction
is load-and-zero. Therefore we have to have a spinlock in our generic
xchg implementation. And disable interrupts. Ugh. It's OK if you
xchg something with zero though, and most of the xchg's in the kernel
are with zero.

-- 
Matthew Wilcox <willy@bofh.ai>
"Windows and MacOS are products, contrived by engineers in the service of
specific companies. Unix, by contrast, is not so much a product as it is a
painstakingly compiled oral history of the hacker subculture." - N Stephenson

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/