From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752222AbdGRBlU (ORCPT ); Mon, 17 Jul 2017 21:41:20 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:9782 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751530AbdGRBlS (ORCPT ); Mon, 17 Jul 2017 21:41:18 -0400 Subject: Re: [f2fs-dev] [PATCH v2] f2fs: avoid cpu lockup To: Jaegeuk Kim , Chao Yu CC: , , References: <20170715012245.24640-1-jaegeuk@kernel.org> <20170716010422.GA51202@jaegeuk-macbookpro.roam.corp.google.com> <330acf45-f218-cb85-28b6-08e12c4fb888@kernel.org> <20170717223858.GD81128@jaegeuk-macbookpro.roam.corp.google.com> From: Chao Yu Message-ID: Date: Tue, 18 Jul 2017 09:40:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170717223858.GD81128@jaegeuk-macbookpro.roam.corp.google.com> 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 X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090203.596D672E.006A,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: e91b01f497546e8ea9a7bae1ddfd9100 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017/7/18 6:38, Jaegeuk Kim wrote: > On 07/17, Chao Yu wrote: >> On 2017/7/16 9:04, Jaegeuk Kim wrote: >>> Before retrying to flush data or dentry pages, we need to release cpu in order >>> to prevent watchdog. >>> >>> Signed-off-by: Jaegeuk Kim >> >> Reviewed-by: Chao Yu >> >>> --- >>> Change log from v1: >>> - timeout more specifically >>> >>> fs/f2fs/checkpoint.c | 10 ++++++++++ >>> 1 file changed, 10 insertions(+) >>> >>> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c >>> index 56bbf592e487..5b876f6d3f6b 100644 >>> --- a/fs/f2fs/checkpoint.c >>> +++ b/fs/f2fs/checkpoint.c >>> @@ -879,6 +879,7 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type) >>> struct inode *inode; >>> struct f2fs_inode_info *fi; >>> bool is_dir = (type == DIR_INODE); >>> + unsigned long ino = 0; >>> >>> trace_f2fs_sync_dirty_inodes_enter(sbi->sb, is_dir, >>> get_pages(sbi, is_dir ? >>> @@ -901,8 +902,17 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type) >>> inode = igrab(&fi->vfs_inode); >>> spin_unlock(&sbi->inode_lock[type]); >>> if (inode) { >>> + unsigned long cur_ino = inode->i_ino; >>> + >>> filemap_fdatawrite(inode->i_mapping); >>> iput(inode); >>> + /* We need to give cpu to another writers. */ >>> + if (ino == cur_ino) { >> >> We failed to flush dirty pages of inode due to encountering -EAGAIN of writepage? > > Actually, I found this from a bug case in experimental patches which just skips > it accidently. I think WB_SYNC_ALL doesn't return EAGAIN. Alright, thanks for explanation. :) Thanks, > > Thanks, > >> >> Thanks, >> >>> + congestion_wait(BLK_RW_ASYNC, HZ/50); >>> + cond_resched(); >>> + } else { >>> + ino = cur_ino; >>> + } >>> } else { >>> /* >>> * We should submit bio, since it exists several >>> > > . >