Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4848675ybl; Mon, 9 Dec 2019 18:11:22 -0800 (PST) X-Google-Smtp-Source: APXvYqx9Jo589wvbo6tEqM6mvYL6/l6nRNlxX2U4iDY0aEkPG6c//DeN2bFh1HW3z49bMS7t+HeR X-Received: by 2002:aca:db41:: with SMTP id s62mr2003893oig.87.1575943882018; Mon, 09 Dec 2019 18:11:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575943882; cv=none; d=google.com; s=arc-20160816; b=id+l6D+EfetI1OUVUP6WRkD5A8W6ZeCXTTrh01YSnUY3R74ku3+oMYeDtvQG4nUTVV JN8nmML2B6lz42f3lH2XNHA11xY1/iZr+d4IMqVYdYuTnqUhZga28DsSkXr6P58kEorZ AeG15EPFsuGGpiZXeLZZeTLJ3MNZfG5KsXi9X0iEYvzO3IRRmTBTZYkDzhG7HTbwip1c Zxi1lRtFKuFQGyt3VECny/SM17Z8t3RCq0kTh5khAuFRPfmzgWj2d9qNNLzwkW22thz2 cssmmKoNOIMl1ZyJ3qOPLbyXEZ1ClyakgrAl6+gVjzianhOleA6Rk0kbLKakkTrp3Trm O88g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=YXCrLIXHAup8oEMdeu4dma+FfsTSMS+/PPq3MB+SFtw=; b=irVsAjzPXICBnKO6wiF1rWDpHCjzOzXiKbM8m/BYkQL1l6v20nFlXpdG/r1arjLKEc ObbiU8bUQcw76oMeuOQ9NLgIn1OognuqU60d/fGAS4FexlC9cWGuQ33RyqIfev/mbGiz WzChlcSs0b1/rtUBL57gzjLQxiXAW9r7NKe92b72AeQ2oJgZDmNY4WhPkaSDLY18VQcP Sw5faSWb14x4SsTQDVxZoVXWaMp36VwXEdLzFlzHY0JC4vCzlL8vYKIYqk+frOW/OwWR hNP/D+vQT4FwofhgPwwLdKcKxbgsEREIO2mxQW2eLa6wZFYMa1ZgtEa6kzxOisTafVsG MlXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z194si1122685oia.50.2019.12.09.18.11.08; Mon, 09 Dec 2019 18:11:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726642AbfLJCJ2 (ORCPT + 99 others); Mon, 9 Dec 2019 21:09:28 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7653 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726538AbfLJCJ2 (ORCPT ); Mon, 9 Dec 2019 21:09:28 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 3727580365B3C590DBB2; Tue, 10 Dec 2019 10:09:27 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.213) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 10 Dec 2019 10:09:23 +0800 Subject: Re: [f2fs-dev] [PATCH 1/6] f2fs: call f2fs_balance_fs outside of locked page To: Jaegeuk Kim , , References: <20191209222345.1078-1-jaegeuk@kernel.org> From: Chao Yu Message-ID: <0f842142-4931-dcb8-9843-47510851e93b@huawei.com> Date: Tue, 10 Dec 2019 10:09:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20191209222345.1078-1-jaegeuk@kernel.org> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/12/10 6:23, Jaegeuk Kim wrote: > Otherwise, we can hit deadlock by waiting for the locked page in > move_data_block in GC. > > Thread A Thread B > - do_page_mkwrite > - f2fs_vm_page_mkwrite > - lock_page > - f2fs_balance_fs > - mutex_lock(gc_mutex) > - f2fs_gc > - do_garbage_collect > - ra_data_block > - grab_cache_page > - f2fs_balance_fs > - mutex_lock(gc_mutex) > > Fixes: 39a8695824510 ("f2fs: refactor ->page_mkwrite() flow") > Signed-off-by: Jaegeuk Kim Reviewed-by: Chao Yu Thanks,