From patchwork Tue Jun 20 16:06:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edmund Nadolski X-Patchwork-Id: 9799895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C326D60329 for ; Tue, 20 Jun 2017 16:06:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4B7F205A8 for ; Tue, 20 Jun 2017 16:06:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A968D2810E; Tue, 20 Jun 2017 16:06:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF21D205A8 for ; Tue, 20 Jun 2017 16:06:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751922AbdFTQGQ (ORCPT ); Tue, 20 Jun 2017 12:06:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:60455 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751901AbdFTQGO (ORCPT ); Tue, 20 Jun 2017 12:06:14 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6E2FFAAC5 for ; Tue, 20 Jun 2017 16:06:08 +0000 (UTC) From: Edmund Nadolski To: enadolski@suse.com, linux-btrfs@vger.kernel.org Subject: [PATCH 11/13] btrfs: add cond_resched() calls when resolving backrefs Date: Tue, 20 Jun 2017 10:06:51 -0600 Message-Id: <20170620160653.19907-12-enadolski@suse.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20170620160653.19907-1-enadolski@suse.com> References: <20170620160653.19907-1-enadolski@suse.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since backref resolution is CPU-intensive, the cond_resched calls should help alleviate soft lockup occurences. Signed-off-by: Edmund Nadolski Signed-off-by: Jeff Mahoney --- fs/btrfs/backref.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 0dffd7e..e95049a 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -658,6 +658,7 @@ static int resolve_indirect_refs(struct btrfs_fs_info *fs_info, prelim_ref_insert(fs_info, &preftrees->direct, ref); ulist_reinit(parents); + cond_resched(); } out: ulist_free(parents); @@ -697,6 +698,7 @@ static int add_missing_keys(struct btrfs_fs_info *fs_info, btrfs_node_key_to_cpu(eb, &ref->key_for_search, 0); btrfs_tree_read_unlock(eb); free_extent_buffer(eb); + cond_resched(); } return 0; } @@ -1236,6 +1238,7 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans, } eie = NULL; } + cond_resched(); } out: