From patchwork Mon Sep 4 12:30:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9937063 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 053DC603F9 for ; Mon, 4 Sep 2017 12:31:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E90C0287E3 for ; Mon, 4 Sep 2017 12:31:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD7E1287EC; Mon, 4 Sep 2017 12:31:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49E18287E3 for ; Mon, 4 Sep 2017 12:31:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753531AbdIDMam (ORCPT ); Mon, 4 Sep 2017 08:30:42 -0400 Received: from mx2.suse.de ([195.135.220.15]:41650 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753528AbdIDMal (ORCPT ); Mon, 4 Sep 2017 08:30:41 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id DA54BAAB9; Mon, 4 Sep 2017 12:30:40 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 71DAE1E340B; Mon, 4 Sep 2017 14:30:39 +0200 (CEST) Date: Mon, 4 Sep 2017 14:30:39 +0200 From: Jan Kara To: =?utf-8?B?0JzQuNGF0LDQuNC7INCT0LDQstGA0LjQu9C+0LI=?= Cc: Christoph Hellwig , linux-xfs@vger.kernel.org, linux-mm@kvack.org Subject: Re: kernel BUG at fs/xfs/xfs_aops.c:853! in kernel 4.13 rc6 Message-ID: <20170904123039.GA5664@quack2.suse.cz> References: <20170903074306.GA8351@infradead.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sun 03-09-17 19:08:54, Михаил Гаврилов wrote: > On 3 September 2017 at 12:43, Christoph Hellwig wrote: > > > > This is: > > > > bh = head = page_buffers(page); > > > > Which looks odd and like some sort of VM/writeback change might > > have triggered that we get a page without buffers, despite always > > creating buffers in iomap_begin/end and page_mkwrite. > > > > Ccing linux-mm if anything odd happen in that area recently. > > > > Can you tell anything about the workload you are running? > > > > On XFS partition stored launched KVM VM images, + home partition with > Google Chrome profiles. > Seems the bug triggering by high memory consumption and using swap > which two times larger than system memory. > I saw that it happens when swap has reached size of system memory. Can you reproduce this? I've seen one occurence of this on our distro 4.4-based kernel but we were never able to reproduce and find the culprit. If you can reproduce, could you run with the attached debug patch to see whether the WARN_ON triggers? Because my suspicion is that there is some subtle race in page table teardown vs writeback vs page reclaim which can result in page being dirtied without filesystem being notified about it (I have seen very similar oops for ext4 as well which leads me to suspicion this is a generic issue). Thanks! Honza From 6161b656c3c1df43bc552a60056bc12d7913a90b Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Mon, 4 Sep 2017 14:26:38 +0200 Subject: [PATCH] xfs: Debug when page can get dirty without buffers Signed-off-by: Jan Kara --- fs/xfs/xfs_aops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 6bf120bb1a17..117535086bc7 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1380,6 +1380,7 @@ xfs_vm_set_page_dirty( offset = page_offset(page); spin_lock(&mapping->private_lock); + WARN_ON_ONCE(!page_has_buffers(page)); if (page_has_buffers(page)) { struct buffer_head *head = page_buffers(page); struct buffer_head *bh = head; -- 2.12.3