public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Nikolay Borisov <nborisov@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: Relinquish CPUs in btrfs_compare_trees
Date: Thu, 5 Sep 2019 17:31:51 +0200	[thread overview]
Message-ID: <20190905153151.GC2850@twin.jikos.cz> (raw)
In-Reply-To: <20190904163358.11591-1-nborisov@suse.com>

On Wed, Sep 04, 2019 at 07:33:58PM +0300, Nikolay Borisov wrote:
> When doing any form of incremental send the parent and the child trees
> need to be compared via btrfs_compare_trees. This  can result in long
> loop chains without ever relinquishing the CPU. This causes softlockup
> detector to trigger when comparing trees with a lot of items. Example
> report:
> 
> watchdog: BUG: soft lockup - CPU#0 stuck for 24s! [snapperd:16153]
> CPU: 0 PID: 16153 Comm: snapperd Not tainted 5.2.9-1-default #1 openSUSE Tumbleweed (unreleased)
> Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015
> pstate: 40000005 (nZcv daif -PAN -UAO)
> pc : __ll_sc_arch_atomic_sub_return+0x14/0x20
> lr : btrfs_release_extent_buffer_pages+0xe0/0x1e8 [btrfs]
> sp : ffff00001273b7e0
> Call trace:
>  __ll_sc_arch_atomic_sub_return+0x14/0x20
>  release_extent_buffer+0xdc/0x120 [btrfs]
>  free_extent_buffer.part.0+0xb0/0x118 [btrfs]
>  free_extent_buffer+0x24/0x30 [btrfs]
>  btrfs_release_path+0x4c/0xa0 [btrfs]
>  btrfs_free_path.part.0+0x20/0x40 [btrfs]
>  btrfs_free_path+0x24/0x30 [btrfs]
>  get_inode_info+0xa8/0xf8 [btrfs]
>  finish_inode_if_needed+0xe0/0x6d8 [btrfs]
>  changed_cb+0x9c/0x410 [btrfs]
>  btrfs_compare_trees+0x284/0x648 [btrfs]
>  send_subvol+0x33c/0x520 [btrfs]
>  btrfs_ioctl_send+0x8a0/0xaf0 [btrfs]
>  btrfs_ioctl+0x199c/0x2288 [btrfs]
>  do_vfs_ioctl+0x4b0/0x820
>  ksys_ioctl+0x84/0xb8
>  __arm64_sys_ioctl+0x28/0x38
>  el0_svc_common.constprop.0+0x7c/0x188
>  el0_svc_handler+0x34/0x90
>  el0_svc+0x8/0xc
> 
> Fix this by adding a call to cond_resched at the beginning of the main
> loop in btrfs_compare_trees.
> 
> Fixes: 7069830a9e38 ("Btrfs: add btrfs_compare_trees function")
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

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

      parent reply	other threads:[~2019-09-05 15:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04 16:33 [PATCH] btrfs: Relinquish CPUs in btrfs_compare_trees Nikolay Borisov
2019-09-05  8:37 ` Johannes Thumshirn
2019-09-05 15:31 ` David Sterba [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190905153151.GC2850@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox