blkcg, writeback: Rename wbc_account_io() to wbc_account_cgroup_owner()
authorTejun Heo <tj@kernel.org>
Thu, 27 Jun 2019 20:39:49 +0000 (13:39 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 10 Jul 2019 15:00:57 +0000 (09:00 -0600)
wbc_account_io() does a very specific job - try to see which cgroup is
actually dirtying an inode and transfer its ownership to the majority
dirtier if needed.  The name is too generic and confusing.  Let's
rename it to something more specific.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Documentation/admin-guide/cgroup-v2.rst
fs/btrfs/extent_io.c
fs/buffer.c
fs/ext4/page-io.c
fs/f2fs/data.c
fs/fs-writeback.c
fs/mpage.c
include/linux/writeback.h

index a5c845338d6d70f5c0eec37b8572cd11bd0d0a9c..6223f485f7e1d9fdbd35ae4a2ca240de64f1ac5e 100644 (file)
@@ -2114,7 +2114,7 @@ following two functions.
        a queue (device) has been associated with the bio and
        before submission.
 
-  wbc_account_io(@wbc, @page, @bytes)
+  wbc_account_cgroup_owner(@wbc, @page, @bytes)
        Should be called for each data segment being written out.
        While this function doesn't care exactly when it's called
        during the writeback session, it's the easiest and most
index db337e53aab338aa2c95170ae3e94731616dcd72..5106008f5e28d8608d321e5f66450ce6aae4ea32 100644 (file)
@@ -2911,7 +2911,7 @@ static int submit_extent_page(unsigned int opf, struct extent_io_tree *tree,
                        bio = NULL;
                } else {
                        if (wbc)
-                               wbc_account_io(wbc, page, page_size);
+                               wbc_account_cgroup_owner(wbc, page, page_size);
                        return 0;
                }
        }
@@ -2924,7 +2924,7 @@ static int submit_extent_page(unsigned int opf, struct extent_io_tree *tree,
        bio->bi_opf = opf;
        if (wbc) {
                wbc_init_bio(wbc, bio);
-               wbc_account_io(wbc, page, page_size);
+               wbc_account_cgroup_owner(wbc, page, page_size);
        }
 
        *bio_ret = bio;
index e450c55f643424efcc4e992d9012378fcd602421..40547bbbea948f136cdc5b7b89b26e483e4b9d94 100644 (file)
@@ -3093,7 +3093,7 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
 
        if (wbc) {
                wbc_init_bio(wbc, bio);
-               wbc_account_io(wbc, bh->b_page, bh->b_size);
+               wbc_account_cgroup_owner(wbc, bh->b_page, bh->b_size);
        }
 
        submit_bio(bio);
index 4690618a92e93f133ba3c176b4757a9976805b32..56e287f5ee50ebb8e236c94eb9e078fc4213e388 100644 (file)
@@ -404,7 +404,7 @@ submit_and_retry:
        ret = bio_add_page(io->io_bio, page, bh->b_size, bh_offset(bh));
        if (ret != bh->b_size)
                goto submit_and_retry;
-       wbc_account_io(io->io_wbc, page, bh->b_size);
+       wbc_account_cgroup_owner(io->io_wbc, page, bh->b_size);
        io->io_next_block++;
        return 0;
 }
index eda4181d20926bd59903f9feea6e57f5108612dc..e1cab1717ac77681412fabbe523196295f95058a 100644 (file)
@@ -470,7 +470,7 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio)
        }
 
        if (fio->io_wbc && !is_read_io(fio->op))
-               wbc_account_io(fio->io_wbc, page, PAGE_SIZE);
+               wbc_account_cgroup_owner(fio->io_wbc, page, PAGE_SIZE);
 
        bio_set_op_attrs(bio, fio->op, fio->op_flags);
 
@@ -537,7 +537,7 @@ alloc_new:
        }
 
        if (fio->io_wbc)
-               wbc_account_io(fio->io_wbc, bio_page, PAGE_SIZE);
+               wbc_account_cgroup_owner(fio->io_wbc, bio_page, PAGE_SIZE);
 
        io->last_block_in_bio = fio->new_blkaddr;
        f2fs_trace_ios(fio, 0);
index a8a40bc26c2fe3b45c8f83e6499382e0b910647e..0aef79e934bbc7ce3171d5ac9f5966d567b6918d 100644 (file)
@@ -706,7 +706,7 @@ void wbc_detach_inode(struct writeback_control *wbc)
 EXPORT_SYMBOL_GPL(wbc_detach_inode);
 
 /**
- * wbc_account_io - account IO issued during writeback
+ * wbc_account_cgroup_owner - account writeback to update inode cgroup ownership
  * @wbc: writeback_control of the writeback in progress
  * @page: page being written out
  * @bytes: number of bytes being written out
@@ -715,8 +715,8 @@ EXPORT_SYMBOL_GPL(wbc_detach_inode);
  * controlled by @wbc.  Keep the book for foreign inode detection.  See
  * wbc_detach_inode().
  */
-void wbc_account_io(struct writeback_control *wbc, struct page *page,
-                   size_t bytes)
+void wbc_account_cgroup_owner(struct writeback_control *wbc, struct page *page,
+                             size_t bytes)
 {
        struct cgroup_subsys_state *css;
        int id;
@@ -753,7 +753,7 @@ void wbc_account_io(struct writeback_control *wbc, struct page *page,
        else
                wbc->wb_tcand_bytes -= min(bytes, wbc->wb_tcand_bytes);
 }
-EXPORT_SYMBOL_GPL(wbc_account_io);
+EXPORT_SYMBOL_GPL(wbc_account_cgroup_owner);
 
 /**
  * inode_congested - test whether an inode is congested
index 436a85260394d283e17242cb9b501ab7c64f0b1c..a63620cdb73a732d1a9f987c7889923c05830535 100644 (file)
@@ -647,7 +647,7 @@ alloc_new:
         * the confused fail path above (OOM) will be very confused when
         * it finds all bh marked clean (i.e. it will not write anything)
         */
-       wbc_account_io(wbc, page, PAGE_SIZE);
+       wbc_account_cgroup_owner(wbc, page, PAGE_SIZE);
        length = first_unmapped << blkbits;
        if (bio_add_page(bio, page, length, 0) < length) {
                bio = mpage_bio_submit(REQ_OP_WRITE, op_flags, bio);
index 738a0c24874f0bfd308fad36057cae71401f71f0..dda5cf2281722e250e0f6123411874c029d21fb5 100644 (file)
@@ -188,8 +188,8 @@ void wbc_attach_and_unlock_inode(struct writeback_control *wbc,
                                 struct inode *inode)
        __releases(&inode->i_lock);
 void wbc_detach_inode(struct writeback_control *wbc);
-void wbc_account_io(struct writeback_control *wbc, struct page *page,
-                   size_t bytes);
+void wbc_account_cgroup_owner(struct writeback_control *wbc, struct page *page,
+                             size_t bytes);
 void cgroup_writeback_umount(void);
 
 /**
@@ -291,8 +291,8 @@ static inline void wbc_init_bio(struct writeback_control *wbc, struct bio *bio)
 {
 }
 
-static inline void wbc_account_io(struct writeback_control *wbc,
-                                 struct page *page, size_t bytes)
+static inline void wbc_account_cgroup_owner(struct writeback_control *wbc,
+                                           struct page *page, size_t bytes)
 {
 }