Re: [PATCH v5 02/11] xfs, dax: introduce xfs_dax_aops

2018-03-10 Thread Christoph Hellwig
> +int dax_set_page_dirty(struct page *page) > +{ > + /* > + * Unlike __set_page_dirty_no_writeback that handles dirty page > + * tracking in the page object, dax does all dirty tracking in > + * the inode address_space in response to mkwrite faults. In the > + * dax case

Re: [PATCH v5 11/11] xfs, dax: introduce xfs_break_dax_layouts()

2018-03-10 Thread Christoph Hellwig
> +static int xfs_wait_dax_page( > + atomic_t*count, > + unsigned intmode) > +{ Normal XFS style would be: static int xfs_wait_dax_page( atomic_t*count, unsigned intmode) { > + struct page

Re: [PATCH 4/5] firmware: dmi: Add function to look up a handle and return DIMM size

2018-03-10 Thread Jean Delvare
Hi Tony, On Fri, 9 Mar 2018 15:03:58 -0800, Luck, Tony wrote: > I got side-tracked reading the standard with the ancient ways > used to report size back in the day when kilobytes was a > plausible unit. So I wrote code that covers all the crazy > cases. Persistant DIMMs have sizes measured in

Re: [PATCH v5 10/11] xfs: prepare xfs_break_layouts() for another layout type

2018-03-10 Thread Christoph Hellwig
> > +int > +xfs_break_layouts( > + struct inode*inode, > + uint*iolock, > + unsigned long flags) > +{ > + struct xfs_inode*ip = XFS_I(inode); > + uintiolock_assert = 0; > + int ret =

[RFC v2 72/83] File operation: fallocate.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Fallocate works similar as writes, allocating zeroed blocked for the holes in the request region. Signed-off-by: Andiry Xu --- fs/nova/file.c | 148 + fs/nova/nova.h | 5 ++ 2

[RFC v2 55/83] Namei: mkdir

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA mkdir is similar to create. The difference is NOVA will allocate log page for the newly created directory, and append init dentries. Signed-off-by: Andiry Xu --- fs/nova/namei.c | 74

Re: [PATCH v5 02/11] xfs, dax: introduce xfs_dax_aops

2018-03-10 Thread Dan Williams
On Sat, Mar 10, 2018 at 1:46 AM, Christoph Hellwig wrote: >> +int dax_set_page_dirty(struct page *page) >> +{ >> + /* >> + * Unlike __set_page_dirty_no_writeback that handles dirty page >> + * tracking in the page object, dax does all dirty tracking in >> + * the

[RFC v2 46/83] Dir: Add Directory radix tree insert/remove methods.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA uses Hash to quickly locate dentry in the directory inode log. The key is the hash of the filename, the value is the dentry. Currently hash collision is ignored, and the radix tree may occupy large memory space with huge directories. Considering

[RFC v2 80/83] Failure recovery: bitmap operations.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Upon system failure, NOVA needs to scan all the inode logs to rebuild the allocator. During the scanning, NOVA stores allocated log/data pages in a bitmap, and uses the bitmap to rebuild the allocator once scan finishes. Signed-off-by: Andiry Xu

[RFC v2 74/83] File operation: Mmap.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA uses the iomap framework to support mmap operation. Currently it does not support huge page mmap. Signed-off-by: Andiry Xu --- fs/nova/dax.c | 53 + fs/nova/file.c | 25

[RFC v2 79/83] Normal recovery.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Upon umount, NOVA stores the allocator information and the inuse inode list in reserved inodes. During remount, NOVA reads these information and rebuild the allocator and inuse inode list DRAM data structures. Signed-off-by: Andiry Xu ---

[RFC v2 81/83] Failure recovery: Inode pages recovery routines.

2018-03-10 Thread Andiry Xu
From: Andiry Xu For each inode, NOVA traverses the inode log and records the pages allocated in the bitmap. For directory inode, NOVA only set the log pages. For file and symlink inodes, NOVA needs to set the data pages. NOVA divides the file into 1GB zones, and records the

[RFC v2 83/83] Sysfs support.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Sysfs support allows user to get/post information of running NOVA instance. After mount, NOVA creates four entries under proc directory /proc/fs/nova/pmem#/: timing_statsIO_statsallocator gc Show NOVA file operation timing statistics: cat

[RFC v2 70/83] File operation: Inplace write.

2018-03-10 Thread Andiry Xu
From: Andiry Xu If the user specifies inplace updates, or the file is mmaped, NOVA performs inplace writes. The trick is dax page fault can occur concurrently with inplace writes, and allocate new blocks. Also, inplace write memcpy may trigger page fault (xfstests 248).

[RFC v2 75/83] File operation: read/write iter.

2018-03-10 Thread Andiry Xu
From: Andiry Xu They use the iomap framework to do read/write. Due to software overheads they are slower than dax read/write. Signed-off-by: Andiry Xu --- fs/nova/file.c | 65 ++ 1 file changed, 65

[RFC v2 64/83] File operation: open, fsync, flush.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA persists file metadata and data before returning to the user space. Hence, fsync is a no-op if the file is not mmaped. Signed-off-by: Andiry Xu --- fs/nova/file.c | 50 ++ 1 file

[RFC v2 60/83] Add special inode operations.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Signed-off-by: Andiry Xu --- fs/nova/inode.c | 2 ++ fs/nova/namei.c | 5 + fs/nova/nova.h | 1 + 3 files changed, 8 insertions(+) diff --git a/fs/nova/inode.c b/fs/nova/inode.c index 2092a55..0e9ab4b 100644 --- a/fs/nova/inode.c

[RFC v2 76/83] Ioctl support.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA appends link change entry to the inode log to implement SETFLAGS and SETVERSION. Signed-off-by: Andiry Xu --- fs/nova/Makefile | 4 +- fs/nova/dir.c| 4 ++ fs/nova/file.c | 4 ++ fs/nova/inode.h | 2 + fs/nova/ioctl.c

[RFC v2 78/83] GC: Thorough garbage collection.

2018-03-10 Thread Andiry Xu
From: Andiry Xu After fast gc, if the valid log entries still account for less than the half of the log size, NOVA starts thorough garbage collection, allocates a new log, copies the live log entries to it, and switches to the new log atomically. The radix tree needs to be

[RFC v2 66/83] Super: Add file write item cache.

2018-03-10 Thread Andiry Xu
From: Andiry Xu nova_file_write_item combines a file write item with a list head. NOVA uses a linked list of file write items to describe a write operation. Signed-off-by: Andiry Xu --- fs/nova/super.c | 43 ++-

[RFC v2 67/83] Dax: commit list of file write items to log.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Given a list of file write items, NOVA commits them by appending each file write entry to the log, and then updates the radix tree to point to these new entries, and updates log tail pointer to commit all the writes atomically. If the items are allocated on

[RFC v2 61/83] Super: Add nova_export_ops.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Signed-off-by: Andiry Xu --- fs/nova/super.c | 48 1 file changed, 48 insertions(+) diff --git a/fs/nova/super.c b/fs/nova/super.c index daf3270..0847e57 100644 --- a/fs/nova/super.c +++

[RFC v2 38/83] Journal: NOVA lite journal initialization.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA uses per-CPU spinlock to protect the journals. Lite journal initialization consists of two parts: for a new NOVA instance, hard_init allocates the journal pages. soft_init initializes the locks and performs journal recovery. Signed-off-by: Andiry Xu

[RFC v2 77/83] GC: Fast garbage collection.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA cleans and compacts the log when the log is full. The log is a linked list of 4KB pmem pages, and NOVA performs fast garbage collection by deleting dead log pages (all the entries are invalid) from the linked list. Example: I = Invalid, V = Valid VIIV

[RFC v2 71/83] Symlink support.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA alloates two blocks for symlink inode: One for inode log, and the other one is a data block, storing symname. Signed-off-by: Andiry Xu --- fs/nova/Makefile | 2 +- fs/nova/inode.c | 2 + fs/nova/namei.c | 70

[RFC v2 56/83] Namei: link and unlink.

2018-03-10 Thread Andiry Xu
From: Andiry Xu For link change operations, NOVA appends a link change entry to the affected inode's log, and uses lite transaction to atomically commit changes to multiple logs. Signed-off-by: Andiry Xu --- fs/nova/namei.c | 159

[RFC v2 43/83] Log operation: in-place update log entry

2018-03-10 Thread Andiry Xu
From: Andiry Xu To in-place update a log entry, NOVA starts a lite transaction to journal the log entry, then performs update and commits the transaction. Signed-off-by: Andiry Xu --- fs/nova/inode.h | 12 fs/nova/log.c | 183

[RFC v2 51/83] Rebuild: directory inode.

2018-03-10 Thread Andiry Xu
From: Andiry Xu When vfs issues a read inode command, or when the inode is newly allocated, walk through the inode log to rebuild inode information and the radix tree. Signed-off-by: Andiry Xu --- fs/nova/inode.h | 15 +++ fs/nova/nova.h| 21

[RFC v2 53/83] Namei: lookup.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA lookup the inode number by searching the radix tree with the filename hash value and locating the corresponding dentry on the log. Signed-off-by: Andiry Xu --- fs/nova/Makefile | 3 +- fs/nova/inode.c | 2 ++ fs/nova/namei.c |

[RFC v2 63/83] File operation: llseek.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Search the file radix tree to find hold or data. Signed-off-by: Andiry Xu --- fs/nova/file.c | 47 +++ fs/nova/inode.c | 113 fs/nova/inode.h | 1 +

[RFC v2 32/83] Add log entry definitions.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA appends log entries to the inode log upon metadata change. NOVA has four kinds of log entries: File write entry describes a write to a contiguous range of pmem pages, Dentry describes a file/directory being added or removed from a directory, Setattr

[RFC v2 68/83] File operation: copy-on-write write.

2018-03-10 Thread Andiry Xu
From: Andiry Xu If the file is not mmaped, NOVA performs copy-on-write. The CoW is composed of parts: 1. Allocate contiguous data pages. 2. Copy data from user buffer to the data pages. If the write is not aligned to page size, also copy data from existing pmem pages.

[RFC v2 54/83] Namei: create and mknod.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA allocates and initializes a new inode, and appends a dentry to the directory's log. Then NOVA creates a transaction to commit both changes atomically: update the directory log tail pointer and validate the new inode. Signed-off-by: Andiry Xu

[RFC v2 59/83] Namei: setattr

2018-03-10 Thread Andiry Xu
From: Andiry Xu Add notify_change for setattr operations. Truncate the file blocks if the file is shrunk. Signed-off-by: Andiry Xu --- fs/nova/inode.c | 180 fs/nova/inode.h | 1 +

[RFC v2 45/83] Log operation: file inode log lookup and assign

2018-03-10 Thread Andiry Xu
From: Andiry Xu After NOVA appends file write entry to commit new writes, it updates the file offset radix tree, finds the old entries (if overwrite) and reclaims the stale data blocks. Signed-off-by: Andiry Xu --- fs/nova/log.c | 108

[RFC v2 42/83] Log operation: link change append.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA appends link change entries to atomically update link count and ctime. This occurs in link, unlink and rmdir. Signed-off-by: Andiry Xu --- fs/nova/log.c | 52 fs/nova/log.h | 3

[RFC v2 52/83] Rebuild: file inode.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Rebuild file inode metadata and radix tree on read_inode. Signed-off-by: Andiry Xu --- fs/nova/log.h | 4 ++ fs/nova/rebuild.c | 124 ++ 2 files changed, 128 insertions(+) diff

[RFC v2 41/83] Log operation: setattr entry append

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA appends a setattr entry to the log upon inode modification operations: set size, chmod, etc. Signed-off-by: Andiry Xu --- fs/nova/log.c | 64 +++ 1 file changed, 64

[RFC v2 44/83] Log operation: invalidate log entries

2018-03-10 Thread Andiry Xu
From: Andiry Xu After new log entries are appended to the log, old log entries can be marked invalid to faciliate garbage collection. Signed-off-by: Andiry Xu --- fs/nova/log.c | 160 +

[RFC v2 48/83] Dir: Readdir operation.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA reads the directory by traversing the log and reports the valid dentries. Valid dentris have inode number greater than zero, meaning it's a create dentry. Signed-off-by: Andiry Xu --- fs/nova/dir.c | 153

[RFC v2 40/83] Log operation: file write entry append.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA performs writes by appending file write entries to the log. A file write entry is the metadata of a write operation, and contains pointers to the data blocks. A single write operation may append multiple file write entries to the log, if the allocator

[RFC v2 69/83] Super: Add module param inplace_data_updates.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Provide inplace data updates option if people prefer inplace updates to copy-on-write. Signed-off-by: Andiry Xu --- fs/nova/nova.h | 1 + fs/nova/super.c | 7 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git

[RFC v2 58/83] Namei: rename

2018-03-10 Thread Andiry Xu
From: Andiry Xu Rename is the most cpmplex namei operation. The target dir may be different from the source dir, and the target inode may exist. Rename involves up to four inodes, and NOVA uses rename transation to atomically update all the affected inodes. Signed-off-by:

[RFC v2 33/83] Inode log and entry printing for debug purpose.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Signed-off-by: Andiry Xu --- fs/nova/nova.h | 3 + fs/nova/stats.c | 234 2 files changed, 237 insertions(+) diff --git a/fs/nova/nova.h b/fs/nova/nova.h index bf4b6ac..03c4991

[RFC v2 36/83] Journal: Lite journal recovery.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Signed-off-by: Andiry Xu --- fs/nova/journal.c | 55 +++ 1 file changed, 55 insertions(+) diff --git a/fs/nova/journal.c b/fs/nova/journal.c index 75d590f..f31de97 100644 ---

[RFC v2 31/83] Add new vfs inode allocation.

2018-03-10 Thread Andiry Xu
From: Andiry Xu This routine allocates and initializes a new vfs inode, and setup the attributes of corresponding NOVA inode and inode_info. inode operations are missing now. Signed-off-by: Andiry Xu --- fs/nova/inode.c | 144

[RFC v2 34/83] Journal: NOVA light weight journal definitions.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA uses per-CPU lite journals to provide fast atomicity guarantees for multi-log appending and multi-word inplace updates. NOVA uses undo journaling. Each journal is a circular buffer of 4KB pmem page. Two pointers, journal_head and journal_tail reside in

[RFC v2 47/83] Dir: Add initial dentries when initializing a directory inode log.

2018-03-10 Thread Andiry Xu
From: Andiry Xu For root directory and newly created directory via mkdir(), we append . and .. dentries to the directory inode log. Signed-off-by: Andiry Xu --- fs/nova/dir.c | 82 +

[RFC v2 37/83] Journal: Lite journal create and commit.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA uses lite journal to perform light weight transaction. Instead of journaling metadata/data changes directly, NOVA first append updates to each inode's log, and then journal the log tail pointers to make sure all the logs are updated atomically. For inode

[RFC v2 50/83] Inode: Add nova_evict_inode.

2018-03-10 Thread Andiry Xu
From: Andiry Xu If the inode still have links, release the DRAM resource (radix tree, etc). Otherwise reclaim data pages and log pages. Signed-off-by: Andiry Xu --- fs/nova/inode.c | 257 +++-

[RFC v2 29/83] Add write_inode and dirty_inode routines.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Signed-off-by: Andiry Xu --- fs/nova/inode.c | 33 + fs/nova/inode.h | 2 ++ fs/nova/super.c | 2 ++ 3 files changed, 37 insertions(+) diff --git a/fs/nova/inode.c b/fs/nova/inode.c index

[RFC v2 13/83] Add remount_fs and show_options methods.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Signed-off-by: Andiry Xu --- fs/nova/super.c | 55 +++ 1 file changed, 55 insertions(+) diff --git a/fs/nova/super.c b/fs/nova/super.c index 3efb560..f41cc04 100644 ---

[RFC v2 07/83] Initialize inode_info and rebuild inode information in nova_iget().

2018-03-10 Thread Andiry Xu
From: Andiry Xu Incomplete nova_rebuild_inode() implemenation. nova_rebuild_inode() will go through the inode log and rebuild radix tree and metadata. Leave for later patches. Signed-off-by: Andiry Xu --- fs/nova/bbuild.c | 53

[RFC v2 11/83] Add timing and I/O statistics for performance analysis and profiling.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Signed-off-by: Andiry Xu --- fs/nova/Makefile | 2 +- fs/nova/nova.h | 12 +++ fs/nova/stats.c | 263 +++ fs/nova/stats.h | 178 +

[RFC v2 24/83] Initialize and allocate inode table.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Inode table is a singly linked list of 2MB pages. Each CPU has one inode table with initial size 2MB. The inode table addresses are stored in the INODE_TABLE_START of the pmem range. Signed-off-by: Andiry Xu --- fs/nova/inode.c | 55

[RFC v2 25/83] Support get normal inode address and inode table extentsion.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Inodes are assigned to per-CPU inode tables in a round-robin way: If there are four cores, then CPU 0's inode table contains inode 0, inode 4, inode 8, ... CPU 1's inode table contains inode 1, inode 5, inode 9, ... CPU 2's inode table contains inode 2,

[RFC v2 03/83] Add super.h.

2018-03-10 Thread Andiry Xu
From: Andiry Xu This header file defines NOVA persistent and volatile superblock data structures. It also defines NOVA block layout: Page 0: Superblock Page 1: Reserved inodes Page 2 - 15: Reserved Page 16 - 31: Inode table pointers Page 32 - 47: Journal address pointers

[RFC v2 16/83] Initialize block map and free lists in nova_init().

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA divides the pmem range equally among per-CPU free lists, and format the red-black trees by inserting the initial free range. Signed-off-by: Andiry Xu --- fs/nova/balloc.c | 161 +++

[RFC v2 08/83] NOVA superblock operations.

2018-03-10 Thread Andiry Xu
From: Andiry Xu This is the entry point for NOVA filesystem mount and umount. NOVA works on DAX devices. During initialization it gets the device information, such as physical/virtual addresses and device size. It does not access the DAX device during runtime. During

[RFC v2 00/83] NOVA: a new file system for persistent memory

2018-03-10 Thread Andiry Xu
From: Andiry Xu This is the second version of RFC patch series that impements NOVA (NOn-Volatile memory Accelerated file system), a new file system built for PMEM. NOVA's goal is to provide a high performance, production-ready file system tailored for byte-addressable

[RFC v2 18/83] Add freelist statistics printing.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Signed-off-by: Andiry Xu --- fs/nova/nova.h | 1 + fs/nova/stats.c | 103 2 files changed, 104 insertions(+) diff --git a/fs/nova/nova.h b/fs/nova/nova.h index c4abdd8..404e133

[RFC v2 22/83] Inode log pages allocation and reclaimation.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA allocates one log page for each new inode. When the log is full, NOVA allocates new log pages, extends the log by either doubling the log size or increasing by fixed length, depends on log size. Signed-off-by: Andiry Xu ---

[RFC v2 26/83] Add inode_map to track inuse inodes.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA uses per-CPU inode map to track inuse inodes. It works in the same way as the allocator, the only difference is that inode map tracks in-use inodes, while free list contains free ranges. NOVA always try to allocate the first available inode number.

[RFC v2 04/83] NOVA inode definition.

2018-03-10 Thread Andiry Xu
From: Andiry Xu inode.h defines the non-volatile and volatile NOVA inode data structures. The non-volatile NOVA inode (nova_inode) is aligned to 128 bytes and contains file/directory metadata information. The most important fields are log_head and log_tail. log_head points

[RFC v2 05/83] Add NOVA filesystem definitions and useful helper routines.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA stores offset rather than absolute addresses in pmem. nova_get_block() and nova_get_addr_off() provide transitions between these two kinds of addresses. Signed-off-by: Andiry Xu --- fs/nova/nova.h | 299

[RFC v2 01/83] Introduction and documentation of NOVA filesystem.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA is a log-structured file system tailored for byte-addressable non-volatile memories. It was designed and developed at the Non-Volatile Systems Laboratory in the Computer Science and Engineering Department at the University of California, San Diego. Its

[RFC v2 09/83] Add Kconfig and Makefile

2018-03-10 Thread Andiry Xu
From: Andiry Xu Signed-off-by: Andiry Xu --- fs/Kconfig | 2 ++ fs/Makefile | 1 + fs/nova/Kconfig | 15 +++ fs/nova/Makefile | 7 +++ 4 files changed, 25 insertions(+) create mode 100644 fs/nova/Kconfig create mode

[RFC v2 23/83] Save allocator to pmem in put_super.

2018-03-10 Thread Andiry Xu
From: Andiry Xu We allocate log pages and append free range node to the log of the reserved blocknode inode. We can recover the allocator status by reading the log upon normal recovery. Signed-off-by: Andiry Xu --- fs/nova/bbuild.c | 114

[RFC v2 21/83] Add log structure.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA log is a singly linked list of 4KB pmem pages. Each log page consists of two parts: 4064 bytes for log entries, and 32 bytes for page tail structure. Page tail contains metadata about the log page and the address of the next log page in the linked list.

[RFC v2 15/83] Add free list data structure.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Free list is the data structure that NOVA uses to manage free pmem blocks. Each CPU has its own free list to avoid contention. Free list manages free pmem blocks (represented in range node) with red-black tree. Signed-off-by: Andiry Xu

[RFC v2 14/83] Add range node kmem cache.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Range node specifies a range of [start, end]. and is managed by a red-black tree. NOVA uses range node to manage NVM allocator and inodes being used. Signed-off-by: Andiry Xu --- fs/nova/nova.h | 8 fs/nova/super.c | 45

[RFC v2 12/83] Add timing for mount and init.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Signed-off-by: Andiry Xu --- fs/nova/super.c | 25 ++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/fs/nova/super.c b/fs/nova/super.c index 9295d23..3efb560 100644 --- a/fs/nova/super.c +++

[RFC v2 28/83] Add NOVA address space operations

2018-03-10 Thread Andiry Xu
From: Andiry Xu direct_IO and writepages support. Signed-off-by: Andiry Xu --- fs/nova/inode.c | 24 fs/nova/inode.h | 1 + 2 files changed, 25 insertions(+) diff --git a/fs/nova/inode.c b/fs/nova/inode.c index

[RFC v2 06/83] Add inode get/read methods.

2018-03-10 Thread Andiry Xu
From: Andiry Xu These routines are incomplete and currently only support reserved inodes, whose addresses are fixed. This is necessary for fill_super to work. File/dir operations are left NULL. Signed-off-by: Andiry Xu --- fs/nova/inode.c | 176

[RFC v2 30/83] New NOVA inode allocation.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Allocate the new inode in a round-robin way. Extend the inode table if needed. Signed-off-by: Andiry Xu --- fs/nova/inode.c | 40 fs/nova/inode.h | 1 + 2 files changed, 41 insertions(+) diff

[RFC v2 27/83] Save the inode inuse list to pmem upon umount

2018-03-10 Thread Andiry Xu
From: Andiry Xu Signed-off-by: Andiry Xu --- fs/nova/bbuild.c | 48 fs/nova/bbuild.h | 1 + fs/nova/super.c | 1 + 3 files changed, 50 insertions(+) diff --git a/fs/nova/bbuild.c b/fs/nova/bbuild.c

[RFC v2 19/83] Add pmem block free routines.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA allocates/frees log pages and data pages in the same way. For block free, NOVA first gets the corresponding free list by checking the block number, and then inserts the freed range in the red-black tree. NOVA always merge adjacent free ranges if possible.

[RFC v2 02/83] Add nova_def.h.

2018-03-10 Thread Andiry Xu
From: Andiry Xu This file defines NOVA filesystem macros and routines to persist updates by using Intel persistent memory instruction CLWB or clflush. Signed-off-by: Andiry Xu --- fs/nova/nova_def.h | 128

[RFC v2 10/83] Add superblock integrity check.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Repair broken primary superblock with redundant superblock. Signed-off-by: Andiry Xu --- fs/nova/super.c | 102 1 file changed, 102 insertions(+) diff --git a/fs/nova/super.c

[RFC v2 17/83] Add statfs support.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Signed-off-by: Andiry Xu --- fs/nova/balloc.c | 18 ++ fs/nova/balloc.h | 1 + fs/nova/super.c | 19 +++ 3 files changed, 38 insertions(+) diff --git a/fs/nova/balloc.c b/fs/nova/balloc.c index

[RFC v2 20/83] Pmem block allocation routines.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Upon a allocation request, NOVA first try the free list on current CPU. If there are not enough blocks to allocate, NOVA will go to the free list with the most free blocks. Caller can specify allocation direction: from low address or from high address.

[RFC v2 39/83] Log operation: dentry append.

2018-03-10 Thread Andiry Xu
From: Andiry Xu NOVA performs atomic log appending by first appending the entry to the tail of the log, and then atomically update the log tail pointer. Signed-off-by: Andiry Xu --- fs/nova/log.c | 162

[RFC v2 35/83] Journal: Lite journal helper routines.

2018-03-10 Thread Andiry Xu
From: Andiry Xu Signed-off-by: Andiry Xu --- fs/nova/Makefile | 2 +- fs/nova/journal.c | 108 ++ 2 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 fs/nova/journal.c diff --git