[OpenAFS-devel] reproducible problem during cache flush

Nickolai Zeldovich kolya@MIT.EDU
Thu, 01 Aug 2002 12:51:10 -0400


On Thu, 01 Aug 2002, chas williams <chas@cmf.nrl.navy.mil> wrote:

> just to beat this problem to death but as mentioned previously the
> current fix provides somewhat poor performance on writes.  the following
> should perform better.  its based on what the solaris client does.

Hm, afs_DoPartialWrite already checks if the cache is too full, and
doesn't do anything if there's enough cache space.  I'm curious if
you actually observed lower write performance?

Regardless, this patch looks much cleaner than fudging the #ifdef's.
Minor nit: it doesn't look like code2 is really necessary; seems
like using code for afs_DoPartialWrite's return value should just
work.  Actually, on closer inspection, you actually have two code2's,
with the one being used to store the value overshadowing the one that
is used to check the value later on :-)

> the writepage checks to see if there are too many dirty blocks and
> calls DoPartialWrite.  btw, should we grab avc->lock before the
> afs_write()?

Looks like afs_write() grabs the vcache lock by itself, so we're
fine in this case.

-- kolya