Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp290441imb; Fri, 1 Mar 2019 00:17:49 -0800 (PST) X-Google-Smtp-Source: APXvYqyv3VvlaONvOe22TDTgWEv269gKgSYvCQ4HD0teiB2ipzbDiKWwS/faa5W36y8dPNH3jIIT X-Received: by 2002:a17:902:10e:: with SMTP id 14mr4101744plb.14.1551428269706; Fri, 01 Mar 2019 00:17:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551428269; cv=none; d=google.com; s=arc-20160816; b=ZTrdcZDJDx2fTUycik1RmOZ1Dn8rtGP4VNyfdJGb/OfUpoOWdzga+1faKlHeMpzYHc vZsNbCXlOy7tYIeOzi6eoyXOPBKCXY2NWZn1F1u5+hyOco2qvLTaoZm6KeibZvipri0v iH4Q2RYpsLJDfGIrUhnwuOqDp5fLGc/pR9Y3KBmXgruYZAYuh0vAUfFhsl82yVH71Dcv 2tuIbPpAW/VXYprtsyEJvs/VUeA5K+ImmGrrUYn9QBxWDxjNK2ZOj4HR+3vlmnYas8Io /D8ZJT6turITC5CdUbjaMlkCqxpDmlv17alP1WUuKuT62JrF9iLPvahItr8+a6XpWiIu vbYA== 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=BmTBy+EAZiuQvWEAs58q91QW2FPr7eHyeIPgjCdq61Q=; b=015b+UoCObDVlq7drGQcbBRTA6dTaT0Ce5s6qC3MnC+Hc0EaXIzk12DYu4NDYcpeKu Jlr5D1a/ljJF9COqqpAyz3WvjBs2CWEaTVLQljAuh6z8/fyEqmtU5ndOwPhJvHALoUsd Y9bPoa+0nVDdiswyrs0FIjTTXhVgOIzkQsiinTqXrcZ0rXcPQdNr81keDY8H+6/IMyux as/U9jWVUZXA9ZNBrhDLgmk8ssM3chZ8EDbYWKcVco7vn7pQjzwlJscb0xUiZGrfZQvZ j7E8a6lLI+p9tjaNx++5X3OxUaZOHh/mfbm8zwd3so6PdlfZQcruwt5YyH0SkZci56PB bHDA== 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 d35si20640293pla.48.2019.03.01.00.17.34; Fri, 01 Mar 2019 00:17:49 -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 S1732812AbfCAHql (ORCPT + 99 others); Fri, 1 Mar 2019 02:46:41 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:55522 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732630AbfCAHql (ORCPT ); Fri, 1 Mar 2019 02:46:41 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 7C2AE9FC675B8F1EC746; Fri, 1 Mar 2019 15:46:38 +0800 (CST) Received: from [127.0.0.1] (10.177.29.68) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.408.0; Fri, 1 Mar 2019 15:46:33 +0800 Message-ID: <5C78E357.5060808@huawei.com> Date: Fri, 1 Mar 2019 15:46:31 +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: "Kirill A. Shutemov" , "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "mhocko@suse.com" , "hughd@google.com" , "mhocko@kernel.org" Subject: Re: [PATCH] mm: hwpoison: fix thp split handing in soft_offline_in_use_page() References: <1551179880-65331-1-git-send-email-zhongjiang@huawei.com> <20190226135156.mifspmbdyr6m3hff@kshutemo-mobl1> <5C754E78.4050804@huawei.com> <20190301072919.GA3027@hori.linux.bs1.fc.nec.co.jp> In-Reply-To: <20190301072919.GA3027@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/1 15:29, Naoya Horiguchi wrote: > On Tue, Feb 26, 2019 at 10:34:32PM +0800, zhong jiang wrote: >> On 2019/2/26 21:51, Kirill A. Shutemov wrote: >>> On Tue, Feb 26, 2019 at 07:18:00PM +0800, zhong jiang wrote: >>>> From: zhongjiang >>>> >>>> When soft_offline_in_use_page() runs on a thp tail page after pmd is plit, >>> s/plit/split/ >>> >>>> we trigger the following VM_BUG_ON_PAGE(): >>>> >>>> Memory failure: 0x3755ff: non anonymous thp >>>> __get_any_page: 0x3755ff: unknown zero refcount page type 2fffff80000000 >>>> Soft offlining pfn 0x34d805 at process virtual address 0x20fff000 >>>> page:ffffea000d360140 count:0 mapcount:0 mapping:0000000000000000 index:0x1 >>>> flags: 0x2fffff80000000() >>>> raw: 002fffff80000000 ffffea000d360108 ffffea000d360188 0000000000000000 >>>> raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000 >>>> page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0) >>>> ------------[ cut here ]------------ >>>> kernel BUG at ./include/linux/mm.h:519! >>>> >>>> soft_offline_in_use_page() passed refcount and page lock from tail page to >>>> head page, which is not needed because we can pass any subpage to >>>> split_huge_page(). >>> I don't see a description of what is going wrong and why change will fixed >>> it. From the description, it appears as it's cosmetic-only change. >>> >>> Please elaborate. >> When soft_offline_in_use_page runs on a thp tail page after pmd is split, >> and we pass the head page to split_huge_page, Unfortunately, the tail page >> can be free or count turn into zero. > I guess that you have the similar fix on memory_failure() in your mind: > > commit c3901e722b2975666f42748340df798114742d6d > Author: Naoya Horiguchi > Date: Thu Nov 10 10:46:23 2016 -0800 > > mm: hwpoison: fix thp split handling in memory_failure() > > So it seems that I somehow missed fixing soft offline when I wrote commit > c3901e722b29, and now you find and fix that. Thank you very much. > If you resend the patch with fixing typo, can you add some reference to > c3901e722b29 in the patch description to show the linkage? > And you can add the following tags: Yep, I find that that is a similar issue. hence I refer to that description in the patch you had mentioned. I will add the above desprition you had mentioned in V2. Thanks, zhong jiang > Fixes: 61f5d698cc97 ("mm: re-enable THP") > Acked-by: Naoya Horiguchi > > Thanks, > Naoya Horiguchi > > . >