Commit Graph

10 Commits

Author SHA1 Message Date
Zach Brown
7a565a69df scoutfs: add percpu coutners with sysfs files
Add percpu counters that will let us track all manner of things.

To report them we add a sysfs directory full of attribute files in a
sysfs dir for each mount:

    # (cd /sys/fs/scoutfs/loop0/counters && grep . *)
    skip_delete:0
    skip_insert:3218
    skip_lookup:8439
    skip_next:1190
    skip_search:156

The implementation is careful to define each counter in only one place.
We don't have to make sure that a bunch of defintions and arrays are in
sync.

This builds off of Ben's initial patches that added sysfs dirs.

Signed-off-by: Zach Brown <zab@versity.com>
Signed-off-by: Ben McClelland <ben.mcclelland@versity.com>
2016-03-31 16:44:37 -07:00
Zach Brown
402dd2969f scoutfs: add tracepoint support with bloom example
Add the intrastucture for tracepoints.  We include an example user that
traces bloom filter hits and misses.

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-26 20:58:31 -07:00
Zach Brown
9cf87ee571 scoutfs: add basic file page cache read and write
Add basic file data support by implementing the address space file and
page read and write methods.  This passis basic read/write tests but is
only the seed of a final implementation.

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-26 10:58:06 -07:00
Zach Brown
1270553f1f scoutfs: mega item access omnibus commit 9000
Initially items were stored in memory with an rbtree.  That let us build
up the API above items without worrying about their storage.  That gave
us dirty items in memory and we could start working on writing them to
and reading them from the log segment blocks.

Now that we have the code on either side we can get rid of the item
cache in between.  It had some nice properties but it's fundamentally
duplicating the item storage in cached log segment blocks.  We'd also
have to teach it to differentiate between negative cache entries and
missing entries that need to be filled from blocks.  And the giant item
index becomes a bottleneck.

We have to index items in log segments anyway so we rewrite the item
APIs to read and write the items in the log segments directly.  Creation
writes to dirty blocks in memory and reading and iteration walk through
the cached blocks in the buffer cache.

I've tried to comment the files and functions appropriately so most of
the commentary for the new methods is in the body of the commit.

The overall theme is making it relatively efficient to operate on
individual items in log segments.  Previously we could only walk all the
items in an existing segment or write all the dirty items to a new
segment.  Now we have bloom filters and sorted item headers to let us
test for the presence of an item's key with progressively more expensive
methods.   We hold on to a dirty segment and fill it as we create new
items.

This needs more fleshing out and testing but this is a solid first pass
and it passes our existing tests.

Signed-off-by: Zach Brown <zab@versity.com>
2016-03-24 17:40:14 -07:00
Zach Brown
16abddb46a scoutfs: add basic segment reading
Add the most basic ability to read items from log segment blocks.  If
an item isn't in the cache then we walk segments in the manifest and
check for the item in each one.

This is just the core fundamental code.  There's still a lot to do:
basic corruption validation, multi-block segments, bloom filters and
arrays to optimize segment misses, and some day the ability to read file
data items directly into page cache pages.  The manifest locking is also
super broken.

But this is enough to let us mount and stat the root inode!

Signed-off-by: Zach Brown <zab@versity.com>
2016-02-28 17:45:44 -08:00
Zach Brown
8604c85486 scoutfs: add basic reing replay on mount
Read the ring described by the super block and replay its entries to
rebuild the in-memory state of the chunk allocator and log segment
manifest.

We add just enough of the chunk allocator to set the free bits to the
contents of the ring bitmap entries.

We start to build out the basic manifest data structure.  It'll
certainly evolve when we later add code to actually query it.

Signed-off-by: Zach Brown <zab@versity.com>
2016-02-26 17:00:19 -08:00
Zach Brown
28521e8c45 scoutfs: add block read helper
Add a trivial helper function which verifies the block header in
metadata blocks.

Signed-off-by: Zach Brown <zab@versity.com>
2016-02-23 21:13:56 -08:00
Zach Brown
6686ca191a scoutfs: remove the prototype log writing
The sync implementation was a quick demonstration of packing items in to
large log blocks.  We'll be doing things very differently in the actual
system.  So tear this code out so we can build up more functional
structures.  It'll still be in revision control so we'll be able
to reuse the parts that make sense in the new code.

Signed-off-by: Zach Brown <zab@versity.com>
2016-02-23 19:33:56 -08:00
Zach Brown
3483133cdf Read super brick instead of mkfs
Now that we have a working userspace mkfs we can read the supers on
mount instead of always initializing a new file system.  We still don't
know how to read items from blocks so mount fails when it can't find the
root dir inode.

Signed-off-by: Zach Brown <zab@versity.com>
2016-02-12 19:37:48 -08:00
Zach Brown
25a1e8d1b7 Initial commit
This is the initial commit of the repo that will track development
against distro kernels.

This is an import of a prototype branch in the upstream kernel that only
had a few initial commits.  It needed to move to the old readdir
interface and use find_or_create_page() instead of pagecache_get_page()
to build in older distro kernels.
2016-02-05 14:12:14 -08:00