[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Allocating buffers in ext2fs

From: Roland McGrath
Subject: Re: Allocating buffers in ext2fs
Date: Thu, 22 Nov 2001 15:10:58 -0500 (EST)

> Sure.  Do you have a suggestions on how to gather statistics,
> i.e. other than compiling.

Not particularly.  Pick some task that does the same thing every time and
does a lot of disk i/o.  Compiles are such things.

> Additionally, was changing the spinlock to a mutex the right thing to do?

Ah, yes; I knew there was something I'd forgotten to respond to.  That
should be fine.  That kind of mmap call degenerates to vm_allocate, and so
the call can block only on the kernel and the default pager (as any
non-wired memory reference might).  On a uniprocessor system, contention is
very unlikely.  On an MP system, it's sufficiently rare and short that a
spin lock would not be so bad.  But a mutex is certainly fine, and the
mutex implementation is optimized such that taking an uncontested mutex is
not significantly more expensive than just the spin lock.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]