Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4442869ybv; Sun, 16 Feb 2020 22:37:42 -0800 (PST) X-Google-Smtp-Source: APXvYqymQ6OuWb7j3oLwJow1vTUcR8SjSUZCTvXVwdTqk+mfDqBB+ZbxZQ4adrDrs/wuc1Qf/nhG X-Received: by 2002:a05:6830:2154:: with SMTP id r20mr11676257otd.131.1581921461881; Sun, 16 Feb 2020 22:37:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581921461; cv=none; d=google.com; s=arc-20160816; b=qEAqNflHfy+nOjeQ+FQZ5t5vWpjkyaEYASlLYLZd+v9DPqb8uUr/9g9edE5z6X6ni7 J37TQsl4T+3iReowjDdRzuCOSPYqVKFr9jPBC2WAYRG35D+elrrmIv51IrRriMc2Y91P M+VY1t+K3rkjn7Dd8Ggn4+m9DOB73qRtXvHTdGb52E1rc8tKQWCYeB+XG8I1IuPnrb+i VanmiPmtAZD5TqTDd+2oVL5izbzg893pQplpZbhW1KZdl5mV72QFW6DFq7a8Xq4zDerx RVwLBevf7jrlwaitb4nvSLVSfsXQrNjBYUadkeLLp4MeUcwpfOMXBbUDWO7ixJBRAU8b tFQQ== 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:cc:to:subject; bh=+0dhuygXD6u28l92mCIZtlNTTOE+lFikNOkdlJQdYMw=; b=HMUdCuenCukwi3QA8LZOu/k7ebuLomZLiRljpmmV9xPu98N5Tk7gi3rzNwvX36INIf TOwcseIHMGOIyErNPzacERwgPVNSO41M47zzfu5Cj5vBlKr8QvwgvBug0ssIndNUAvk5 QShKyNzc96wCRm7I/3F1dngETs25f9gep+PKkddL9F4ROESAyqAnls/CHL8tpO5vA0oD cFxkE9C9de8i8y14LUFNO7SKXkfMZ+jRah6K6NGCBT+GA69O+paWch71oXHlCR+OFVRo iwYEJKXoAAy1vAWgreKvByhPr4Lp6exGtXsqgZ1w7Lk4uGw9dNBNZS99mzjqEyGLSvz9 NE5g== 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 k6si6470037otn.172.2020.02.16.22.37.30; Sun, 16 Feb 2020 22:37:41 -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 S1726397AbgBQGhX (ORCPT + 99 others); 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,