Re: NVFS XFS metadata (was: [PATCH] pmem: export the symbols __copy_user_flushcache and __copy_from_user_flushcache)
From: Jan Kara
Date: Wed Sep 23 2020 - 05:57:50 EST
On Tue 22-09-20 12:46:05, Mikulas Patocka wrote:
> > mapping 2^21 blocks requires a 5 level indirect tree. Which one if going
> > to be faster to truncate away - a single record or 2 million individual
> > blocks?
> >
> > IOWs, we can take afford to take an extra cacheline miss or two on a
> > tree block search, because we're accessing and managing orders of
> > magnitude fewer records in the mapping tree than an indirect block
> > tree.
> >
> > PMEM doesn't change this: extents are more time and space efficient
> > at scale for mapping trees than indirect block trees regardless
> > of the storage medium in use.
>
> PMEM doesn't have to be read linearly, so the attempts to allocate large
> linear space are not needed. They won't harm but they won't help either.
>
> That's why NVFS has very simple block allocation alrogithm - it uses a
> per-cpu pointer and tries to allocate by a bit scan from this pointer. If
> the group is full, it tries a random group with above-average number of
> free blocks.
I agree with Dave here. People are interested in 2MB or 1GB contiguous
allocations for DAX so that files can be mapped at PMD or event PUD levels
thus saving a lot of CPU time on page faults and TLB.
> EXT4 uses bit scan for allocations and people haven't complained that it's
> inefficient, so it is probably OK.
Yes, it is more or less OK but once you get to 1TB filesystem size and
larger, the number of block groups grows enough that it isn't that great
anymore. We are actually considering new allocation schemes for ext4 for
this large filesystems...
> If you think that the lack of journaling is show-stopper, I can implement
> it. But then, I'll have something that has complexity of EXT4 and
> performance of EXT4. So that there will no longer be any reason why to use
> NVFS over EXT4. Without journaling, it will be faster than EXT4 and it may
> attract some users who want good performance and who don't care about GID
> and UID being updated atomically, etc.
I'd hope that your filesystem offers more performance benefits than just
what you can get from a lack of journalling :). ext4 can be configured to
run without a journal as well - mkfs.ext4 -O ^has_journal. And yes, it does
significantly improve performance for some workloads but you have to have
some way to recover from crashes so it's mostly used for scratch
filesystems (e.g. in build systems, Google uses this feature a lot for some
of their infrastructure as well).
Honza
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR