All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Btrfs: remove wait_ordered_range in btrfs_evict_inode
@ 2018-09-11 22:06 Liu Bo
  2018-09-14 13:14 ` David Sterba
  2018-09-14 21:03 ` [PATCH v2] Btrfs: remove wait_ordered_rane " Liu Bo
  0 siblings, 2 replies; 5+ messages in thread
From: Liu Bo @ 2018-09-11 22:06 UTC (permalink / raw)
  To: linux-btrfs

As VFS has called ->invalidatepage() to get all ordered extents done
and truncated all page cache pages, wait_ordered_range() is just a
noop.

Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
---
 fs/btrfs/inode.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index ff1d2ed2dc94..d3febc3a6bc0 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -5390,9 +5390,6 @@ void btrfs_evict_inode(struct inode *inode)
 
 	if (is_bad_inode(inode))
 		goto no_delete;
-	/* do we really want it for ->i_nlink > 0 and zero btrfs_root_refs? */
-	if (!special_file(inode->i_mode))
-		btrfs_wait_ordered_range(inode, 0, (u64)-1);
 
 	btrfs_free_io_failure_record(BTRFS_I(inode), 0, (u64)-1);
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Btrfs: remove wait_ordered_range in btrfs_evict_inode
  2018-09-11 22:06 [PATCH] Btrfs: remove wait_ordered_range in btrfs_evict_inode Liu Bo
@ 2018-09-14 13:14 ` David Sterba
  2018-09-14 19:16   ` Liu Bo
  2018-09-14 21:03 ` [PATCH v2] Btrfs: remove wait_ordered_rane " Liu Bo
  1 sibling, 1 reply; 5+ messages in thread
From: David Sterba @ 2018-09-14 13:14 UTC (permalink / raw)
  To: Liu Bo; +Cc: linux-btrfs

On Wed, Sep 12, 2018 at 06:06:22AM +0800, Liu Bo wrote:
> As VFS has called ->invalidatepage() to get all ordered extents done
> and truncated all page cache pages, wait_ordered_range() is just a
> noop.

Agreed, though looking up the exact points when there are no pages to be
waited for took me some time. More references and hints in the changelog
would be good. I'll add the patch to misc-next so it can be tested, but
please send me an update if you have idea how to rephrase the changelog.
Thanks.

Reviewed-by: David Sterba <dsterba@suse.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Btrfs: remove wait_ordered_range in btrfs_evict_inode
  2018-09-14 13:14 ` David Sterba
@ 2018-09-14 19:16   ` Liu Bo
  0 siblings, 0 replies; 5+ messages in thread
From: Liu Bo @ 2018-09-14 19:16 UTC (permalink / raw)
  To: dsterba, linux-btrfs

On Fri, Sep 14, 2018 at 03:14:33PM +0200, David Sterba wrote:
> On Wed, Sep 12, 2018 at 06:06:22AM +0800, Liu Bo wrote:
> > As VFS has called ->invalidatepage() to get all ordered extents done
> > and truncated all page cache pages, wait_ordered_range() is just a
> > noop.
> 
> Agreed, though looking up the exact points when there are no pages to be
> waited for took me some time. More references and hints in the changelog
> would be good. I'll add the patch to misc-next so it can be tested, but
> please send me an update if you have idea how to rephrase the changelog.
> Thanks.
> 
> Reviewed-by: David Sterba <dsterba@suse.com>

OK, I'll add some call stack, hopefully can make it better.

thanks,
-liubo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] Btrfs: remove wait_ordered_rane in btrfs_evict_inode
  2018-09-11 22:06 [PATCH] Btrfs: remove wait_ordered_range in btrfs_evict_inode Liu Bo
  2018-09-14 13:14 ` David Sterba
@ 2018-09-14 21:03 ` Liu Bo
  2018-09-21 15:29   ` David Sterba
  1 sibling, 1 reply; 5+ messages in thread
From: Liu Bo @ 2018-09-14 21:03 UTC (permalink / raw)
  To: linux-btrfs

When we delete an inode,

btrfs_evict_inode() {
    truncate_inode_pages_final()
        truncate_inode_pages_range()
            lock_page()
            truncate_cleanup_page()
                 btrfs_invalidatepage()
                      wait_on_page_writeback
                           btrfs_lookup_ordered_range()
                 cancel_dirty_page()
           unlock_page()
     ...    
     btrfs_wait_ordered_range()
     ...

As VFS has called ->invalidatepage() to get all ordered extents done
(if there is any) and truncated all page cache pages (no dirty pages
to writeback after this step), wait_ordered_range() is just a noop.

Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
---
v2: More details in the description.

 fs/btrfs/inode.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index ff1d2ed2dc94..d3febc3a6bc0 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -5390,9 +5390,6 @@ void btrfs_evict_inode(struct inode *inode)
 
 	if (is_bad_inode(inode))
 		goto no_delete;
-	/* do we really want it for ->i_nlink > 0 and zero btrfs_root_refs? */
-	if (!special_file(inode->i_mode))
-		btrfs_wait_ordered_range(inode, 0, (u64)-1);
 
 	btrfs_free_io_failure_record(BTRFS_I(inode), 0, (u64)-1);
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] Btrfs: remove wait_ordered_rane in btrfs_evict_inode
  2018-09-14 21:03 ` [PATCH v2] Btrfs: remove wait_ordered_rane " Liu Bo
@ 2018-09-21 15:29   ` David Sterba
  0 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2018-09-21 15:29 UTC (permalink / raw)
  To: Liu Bo; +Cc: linux-btrfs

On Sat, Sep 15, 2018 at 05:03:28AM +0800, Liu Bo wrote:
> When we delete an inode,
> 
> btrfs_evict_inode() {
>     truncate_inode_pages_final()
>         truncate_inode_pages_range()
>             lock_page()
>             truncate_cleanup_page()
>                  btrfs_invalidatepage()
>                       wait_on_page_writeback
>                            btrfs_lookup_ordered_range()
>                  cancel_dirty_page()
>            unlock_page()
>      ...    
>      btrfs_wait_ordered_range()
>      ...
> 
> As VFS has called ->invalidatepage() to get all ordered extents done
> (if there is any) and truncated all page cache pages (no dirty pages
> to writeback after this step), wait_ordered_range() is just a noop.
> 
> Reviewed-by: David Sterba <dsterba@suse.com>
> Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
> ---
> v2: More details in the description.

Thanks, patch updated.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-09-21 21:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11 22:06 [PATCH] Btrfs: remove wait_ordered_range in btrfs_evict_inode Liu Bo
2018-09-14 13:14 ` David Sterba
2018-09-14 19:16   ` Liu Bo
2018-09-14 21:03 ` [PATCH v2] Btrfs: remove wait_ordered_rane " Liu Bo
2018-09-21 15:29   ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.