Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3615577imc; Thu, 14 Mar 2019 00:57:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrknV6Ie0NdFeMlldSt2HlpBK8oMjMjix7tIw5mGFlaIlnfNrGuLfleLq4SrLQSEnDWlKB X-Received: by 2002:a65:43cc:: with SMTP id n12mr42360318pgp.218.1552550237523; Thu, 14 Mar 2019 00:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552550237; cv=none; d=google.com; s=arc-20160816; b=PSUKvylG9yxa/GBAMKqTwi/NE1pHeOftAkoKgaxNOU12+Z8FYenP5EWdjs/t6cJhw3 iC0JttMWz+KgtMDG0l/sCebprVN/jzE+5WXf9CcYo6uARj/kc/zdRRamvC4FkI/R/MDW Ybh02XeQNuCC5ARWrhBO3Y5Qz7DgMDEUZo2KLb/lqrg7wC2PaQWJvK441R/eea2oeDsp /vuPgk3y6XOF2CU7h3Wd0yB/uDX9EaamVS2dBKBPuEnKY/5O6uKzBDyCn13HqiTLIsM2 ofyMqJE/JXefn8vJlJY5yJYMJMgfew33GDYIT11U7ib1cGTkNKmynPJR1U/0LR88uqKI V8tA== 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:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=ZvARq4cooloLaUlA1LL1tH8m0FIn496kVGJBlnp8BCg=; b=LcgxeQh8Mlnl5MjgHMEHnMyU9R5+YpHT74u33ughojOkXC5ExePEc1Apwqi1xeQQho XfZb6hEgC2LTy6qyypNT33HNKguVqenijaosbN3eEgDmZRDluNNxDHtO+WB4tEePXVDL aQW8TKtb0vhdRUJEOTBTNyjdugruxxCVQq2Aitb8ocARMnhV2KBIF135z8Yw/wHT2Fex 6QFs1KBSTwYmS112ZZSM/3DGBPIEQTlE+N4yk8M9IHnIDtxAeoMjU9HSNYDKxMB6t5O4 f39VveoL2op4kVyX484swhewx+idIVAaHjlxgOAQJWssummg8somGhMDSl/f+bIu4c4y lWgg== 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 u5si12051501pgh.221.2019.03.14.00.57.01; Thu, 14 Mar 2019 00:57:17 -0700 (PDT) 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 S1727161AbfCNHyS (ORCPT + 99 others); Thu, 14 Mar 2019 03:54:18 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:48244 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726606AbfCNHyR (ORCPT ); Thu, 14 Mar 2019 03:54:17 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 0EBDC5ABE2909F18C4D8; Thu, 14 Mar 2019 15:54:15 +0800 (CST) Received: from [127.0.0.1] (10.177.29.68) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.408.0; Thu, 14 Mar 2019 15:54:10 +0800 Message-ID: <5C8A08A1.3090403@huawei.com> Date: Thu, 14 Mar 2019 15:54:09 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Naoya Horiguchi CC: Minchan Kim , Michal Hocko , Vlastimil Babka , "linux-arm-kernel@lists.infradead.org" , Linux Memory Management List , LKML , Hugh Dickins Subject: Re: [Qestion] Hit a WARN_ON_ONCE in try_to_unmap_one when runing syzkaller References: <5C87D848.7030802@huawei.com> <20190314062757.GA27899@hori.linux.bs1.fc.nec.co.jp> In-Reply-To: <20190314062757.GA27899@hori.linux.bs1.fc.nec.co.jp> Content-Type: text/plain; charset="ISO-2022-JP" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/3/14 14:27, Naoya Horiguchi wrote: > Hi, > > On Wed, Mar 13, 2019 at 12:03:20AM +0800, zhong jiang wrote: > ... >> Minchan has changed the conditon check from BUG_ON to WARN_ON_ONCE in try_to_unmap_one. >> However, It is still an abnormal condition when PageSwapBacked is not equal to PageSwapCache. >> >> But Is there any case it will meet the conditon in the mainline. >> >> It is assumed that PageSwapBacked(page) is true in the anonymous page, This is to say, PageSwapcache >> is false. however, That is impossible because we will update the pte for hwpoison entry. >> >> Because page is locked , Its page flags should not be changed except for PageSwapBacked > try_to_unmap_one() from hwpoison_user_mappings() could reach the > WARN_ON_ONCE() only if TTU_IGNORE_HWPOISON is set, because PageHWPoison() > is set at the beginning of memory_failure(). > > Clearing TTU_IGNORE_HWPOISON might happen on the following two paths: > > static bool hwpoison_user_mappings(struct page *p, unsigned long pfn, > int flags, struct page **hpagep) > { > ... > > if (PageSwapCache(p)) { > pr_err("Memory failure: %#lx: keeping poisoned page in swap cache\n", > pfn); > ttu |= TTU_IGNORE_HWPOISON; > } > ... > > mapping = page_mapping(hpage); > if (!(flags & MF_MUST_KILL) && !PageDirty(hpage) && mapping && > mapping_cap_writeback_dirty(mapping)) { > if (page_mkclean(hpage)) { > SetPageDirty(hpage); > } else { > kill = 0; > ttu |= TTU_IGNORE_HWPOISON; > pr_info("Memory failure: %#lx: corrupted page was clean: dropped without side effects\n", > pfn); > } > } > ... > > unmap_success = try_to_unmap(hpage, ttu); > ... > > So either of the above "ttu |= TTU_IGNORE_HWPOISON" should be executed. > I'm not sure which one, but both paths show printk messages, so if you > could have kernel message log, that might help ... Thank you for your response. Unfortunately, I lost the printk log. I was looking for it before and support us for further analysis. It's very weird to get there. Assume that TTU_IGNORE_HWPOSISON is set. There is the two case. First, PageSwapCache is set and page has been locked. Theoretically WARN_ON_ONCE should not be triggered. Second, We should assume the page belongs to file page.:-( I will go on reproducing the issue and get the printk message log. Thanks zhong jiang > Thanks, > Naoya Horiguchi > > . >