Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH] btrfs: reschedule when cloning lots of extents
@ 2020-09-21 17:38 Johannes Thumshirn
  2020-09-21 18:28 ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Thumshirn @ 2020-09-21 17:38 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs, Johannes Thumshirn

We have several occurrences of a soft lockup from generic/175. All of these
lockup reports have the call chain btrfs_clone_files() -> btrfs_clone() in
common.

btrfs_clone_files() calls btrfs_clone() with both source and destination
extents locked and loops over the source extent to create the clones.

Conditionally reschedule in the btrfs_clone() loop, to give some time back
to other processes.

Link: https://github.com/btrfs/fstests/issues/23
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 fs/btrfs/reflink.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/btrfs/reflink.c b/fs/btrfs/reflink.c
index 39b3269e5760..99aa87c08912 100644
--- a/fs/btrfs/reflink.c
+++ b/fs/btrfs/reflink.c
@@ -520,6 +520,8 @@ static int btrfs_clone(struct inode *src, struct inode *inode,
 			ret = -EINTR;
 			goto out;
 		}
+
+		cond_resched();
 	}
 	ret = 0;
 
-- 
2.26.2


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

* Re: [PATCH] btrfs: reschedule when cloning lots of extents
  2020-09-21 17:38 [PATCH] btrfs: reschedule when cloning lots of extents Johannes Thumshirn
@ 2020-09-21 18:28 ` David Sterba
  2020-09-22  7:31   ` Johannes Thumshirn
  0 siblings, 1 reply; 3+ messages in thread
From: David Sterba @ 2020-09-21 18:28 UTC (permalink / raw)
  To: Johannes Thumshirn; +Cc: David Sterba, linux-btrfs

On Tue, Sep 22, 2020 at 02:38:10AM +0900, Johannes Thumshirn wrote:
> We have several occurrences of a soft lockup from generic/175. All of these
> lockup reports have the call chain btrfs_clone_files() -> btrfs_clone() in
> common.
> 
> btrfs_clone_files() calls btrfs_clone() with both source and destination
> extents locked and loops over the source extent to create the clones.
> 
> Conditionally reschedule in the btrfs_clone() loop, to give some time back
> to other processes.
> 
> Link: https://github.com/btrfs/fstests/issues/23

It would be better to put relevant parts of the report to the changelog,
the fstests issues are more like a todo list than a long-term bug
tracking tool.

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

* Re: [PATCH] btrfs: reschedule when cloning lots of extents
  2020-09-21 18:28 ` David Sterba
@ 2020-09-22  7:31   ` Johannes Thumshirn
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2020-09-22  7:31 UTC (permalink / raw)
  To: dsterba@suse.cz; +Cc: David Sterba, linux-btrfs@vger.kernel.org

On 21/09/2020 20:30, David Sterba wrote:
> On Tue, Sep 22, 2020 at 02:38:10AM +0900, Johannes Thumshirn wrote:
>> We have several occurrences of a soft lockup from generic/175. All of these
>> lockup reports have the call chain btrfs_clone_files() -> btrfs_clone() in
>> common.
>>
>> btrfs_clone_files() calls btrfs_clone() with both source and destination
>> extents locked and loops over the source extent to create the clones.
>>
>> Conditionally reschedule in the btrfs_clone() loop, to give some time back
>> to other processes.
>>
>> Link: https://github.com/btrfs/fstests/issues/23
> 
> It would be better to put relevant parts of the report to the changelog,
> the fstests issues are more like a todo list than a long-term bug
> tracking tool.
> 

OK, I'll add one of the stacktraces here and remove the link in v2.

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

end of thread, other threads:[~2020-09-22  7:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-21 17:38 [PATCH] btrfs: reschedule when cloning lots of extents Johannes Thumshirn
2020-09-21 18:28 ` David Sterba
2020-09-22  7:31   ` Johannes Thumshirn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox