Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp10645pxa; Mon, 3 Aug 2020 20:55:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIT5f9Wpavhfe+4+SzV4j96IW6ApFCSZLHBXywdxHWtdVOIaGL2+pr05TGm7Zz2zrdxiFn X-Received: by 2002:aa7:c682:: with SMTP id n2mr18434853edq.248.1596513309484; Mon, 03 Aug 2020 20:55:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596513309; cv=none; d=google.com; s=arc-20160816; b=ifnHiZZfdbARHZy0iDR7aBd4NE2RR+MJ7YFaIHmT72I7JRB1zqzOVPnRoibHKvlye1 3+U9JB4tvlVLwAVU751oel6I34CXYC5G2X5Ldru/R4xT+jLjpVS3sM0oeGEPBC2C3bNi BUgeApCr2mSVOQpHmMM9DSGW306l0bLSpGy8Lva8qSshp2Ku9VhREQ17wp332g/VB4tf s2TcnZCQWCm0/wZo/ygMfM6IVgjG4YubHEWouoY8NoFZqAhhSds15Q5aUqOjMU6drul9 O3D0RhnLPJhYmEnNCCAEiEMv/TMcKKyytnDo8NnQqJhNN0vJ/uJkw3Zw3d1aZHLZpasp 8zmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=TpI9IhCEHthKGTZrHCMr/VHf05i3WRZPRjEWFD/sgMs=; b=Jyhs54slsy/iT2TcUtrLNbaJ7UetdFvZP4KUvH3y77GLje1otE7k2uIJxg1TD5HYXb dIQxWbYp2ZJWXPpDU4dSyIOdMj6yvBUPPwK+I3ex6Y0QgeCLxG9nzkXqNDwzeOO5ZMCJ xUsSeL31pOE58XtpNxbAaeeQpwaavMetS2STkVR3yKWN94ReeyF5fRKcghe1qhXW1lKE uiy7XMCrr5GoXCK6xyDgtTIhvXa39wB5FHJY7FG40jwqJaEmgoAlQNF/7Ltdj274fhkP fC0sDALP/omlv8TPAUkJbM28G4sjtnDNLfss1n5Zn1HV/vHRv2l5RjR/Dta1+uzAz6oH 2fLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qEbXUgW3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c26si12135890edj.540.2020.08.03.20.54.47; Mon, 03 Aug 2020 20:55:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qEbXUgW3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729656AbgHDDyk (ORCPT + 99 others); Mon, 3 Aug 2020 23:54:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:50878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728867AbgHDDyk (ORCPT ); Mon, 3 Aug 2020 23:54:40 -0400 Received: from localhost (unknown [104.132.1.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DB9DD206F6; Tue, 4 Aug 2020 03:54:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596513280; bh=1wIRTKIibHj2cuI0fbbKzQxUIbvtAf6aPbLlnn72kQE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qEbXUgW3AcpI2xod1XByY6z3bwg8Y/HzIsjplM1wVG4q6mFuvd1L2OpV6Lnza4GpY +1tgSWn0K6UAVPxO0/NMjLZRxD38usgw0MvkfHrpzeDM+qTH/uEchteYXOu4xotkSv GuCwsksVXLhfcmLfkXVamKL3a/P4sHSVUaddoUmQ= Date: Mon, 3 Aug 2020 20:54:39 -0700 From: Jaegeuk Kim To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong Subject: Re: [f2fs-dev] [PATCH] f2fs: fix deadlock between quota writes and checkpoint Message-ID: <20200804035439.GA903802@google.com> References: <20200729070244.584518-1-jaegeuk@kernel.org> <670f35e1-872b-6602-320c-dd73bcb62510@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <670f35e1-872b-6602-320c-dd73bcb62510@huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/04, Chao Yu wrote: > On 2020/7/29 15:02, Jaegeuk Kim wrote: > > f2fs_write_data_pages(quota_mapping) > > __f2fs_write_data_pages f2fs_write_checkpoint > > * blk_start_plug(&plug); > > * add bio in write_io[DATA] > > - block_operations > > - skip syncing quota by > > >DEFAULT_RETRY_QUOTA_FLUSH_COUNT > > - down_write(&sbi->node_write); > > f2fs_flush_merged_writes() will be called after block_operations(), why this doesn't > help? Well, I think bio can be added after f2fs_flush_merged_writes() as well. > > > - f2fs_write_single_data_page > > - f2fs_do_write_data_page > > - f2fs_outplace_write_data > > - do_write_page > > - f2fs_allocate_data_block > > - down_write(node_write) > > - f2fs_wait_on_all_pages(F2FS_WB_CP_DATA); > > > > Signed-off-by: Daeho Jeong > > Signed-off-by: Jaegeuk Kim > > --- > > fs/f2fs/checkpoint.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c > > index 8c782d3f324f0..99c8061da55b9 100644 > > --- a/fs/f2fs/checkpoint.c > > +++ b/fs/f2fs/checkpoint.c > > @@ -1269,6 +1269,8 @@ void f2fs_wait_on_all_pages(struct f2fs_sb_info *sbi, int type) > > if (type == F2FS_DIRTY_META) > > f2fs_sync_meta_pages(sbi, META, LONG_MAX, > > FS_CP_META_IO); > > + else if (type == F2FS_WB_CP_DATA) > > + f2fs_submit_merged_write(sbi, DATA); > > io_schedule_timeout(DEFAULT_IO_TIMEOUT); > > } > > finish_wait(&sbi->cp_wait, &wait); > >