From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 877B4C35242 for ; Mon, 17 Feb 2020 06:37:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5A4A620718 for ; Mon, 17 Feb 2020 06:37:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726420AbgBQGhX (ORCPT ); Mon, 17 Feb 2020 01:37:23 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:38876 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725855AbgBQGhX (ORCPT ); Mon, 17 Feb 2020 01:37:23 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 540A681730E4C590B2C5; Mon, 17 Feb 2020 14:37:19 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.209) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Feb 2020 14:37:18 +0800 Subject: Re: [PATCH V2] f2fs: fix the panic in do_checkpoint() To: Sahitya Tummala , Jaegeuk Kim , CC: References: <1581911024-23660-1-git-send-email-stummala@codeaurora.org> From: Chao Yu Message-ID: <1c80288f-aea1-874b-4ca0-d18d00ed60e2@huawei.com> Date: Mon, 17 Feb 2020 14:37:17 +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: <1581911024-23660-1-git-send-email-stummala@codeaurora.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 2020/2/17 11:43, Sahitya Tummala wrote: > There could be a scenario where f2fs_sync_meta_pages() will not > ensure that all F2FS_DIRTY_META pages are submitted for IO. Thus, > resulting in the below panic in do_checkpoint() - > > f2fs_bug_on(sbi, get_pages(sbi, F2FS_DIRTY_META) && > !f2fs_cp_error(sbi)); > > This can happen in a low-memory condition, where shrinker could > also be doing the writepage operation (stack shown below) > at the same time when checkpoint is running on another core. > > schedule > down_write > f2fs_submit_page_write -> by this time, this page in page cache is tagged > as PAGECACHE_TAG_WRITEBACK and PAGECACHE_TAG_DIRTY > is cleared, due to which f2fs_sync_meta_pages() > cannot sync this page in do_checkpoint() path. > f2fs_do_write_meta_page > __f2fs_write_meta_page > f2fs_write_meta_page > shrink_page_list > shrink_inactive_list > shrink_node_memcg > shrink_node > kswapd > > Signed-off-by: Sahitya Tummala Looks good to me. Reviewed-by: Chao Yu BTW, I can't apply this based dev branch of Jaegeuk's tree, could you rebase it? Thanks,