Stephen Tweedie writes:
> Bitmap updates _can_ be done with atomic bitops, but we
> probably don't want to --- if we have two processes allocating from
> the same block group we'll get better layout if they get serialised
> during the bitmap update.
Yes, with atomic bitops instead of a full group lock we run the risk of
having interleaved block allocations instead of sequential... If there
really is contention within a single group, you could have 1 spinlock
per 1k of bitmap...
I also just noticed that in ialloc that after ext2_find_first_zero_bit()
if ext2_set_bit() fails (i.e. the block was stolen from under us), we
go all the way back to loading the block bitmaps, rather than simply
calling ext2_find_next_zero_bit() for the same group...
> The subsequent quota update doesn't need serialising, and neither does
> the group status information if we use atomic types there.
You also need to update the superblock status information, which may be
the big point of contention. However, most of the CPU is in the per-group
allocations, so a short spinlock (or one each for inodes & blocks) on the
superblock just to update may not be too bad.
Cheers, Andreas
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]