mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-07 23:11:27 +00:00
fs: Convert nr_inodes and nr_unused to per-cpu counters
The number of inodes allocated does not need to be tied to the addition or removal of an inode to/from a list. If we are not tied to a list lock, we could update the counters when inodes are initialised or destroyed, but to do that we need to convert the counters to be per-cpu (i.e. independent of a lock). This means that we have the freedom to change the list/locking implementation without needing to care about the counters. Based on a patch originally from Eric Dumazet. [AV: cleaned up a bit, fixed build breakage on weird configs Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
be1a16a0ae
commit
cffbc8aa33
5 changed files with 52 additions and 25 deletions
|
@ -723,7 +723,7 @@ static long wb_check_old_data_flush(struct bdi_writeback *wb)
|
|||
wb->last_old_flush = jiffies;
|
||||
nr_pages = global_page_state(NR_FILE_DIRTY) +
|
||||
global_page_state(NR_UNSTABLE_NFS) +
|
||||
(inodes_stat.nr_inodes - inodes_stat.nr_unused);
|
||||
get_nr_dirty_inodes();
|
||||
|
||||
if (nr_pages) {
|
||||
struct wb_writeback_work work = {
|
||||
|
@ -1090,8 +1090,7 @@ void writeback_inodes_sb(struct super_block *sb)
|
|||
|
||||
WARN_ON(!rwsem_is_locked(&sb->s_umount));
|
||||
|
||||
work.nr_pages = nr_dirty + nr_unstable +
|
||||
(inodes_stat.nr_inodes - inodes_stat.nr_unused);
|
||||
work.nr_pages = nr_dirty + nr_unstable + get_nr_dirty_inodes();
|
||||
|
||||
bdi_queue_work(sb->s_bdi, &work);
|
||||
wait_for_completion(&done);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue