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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60714C433F5 for ; Mon, 30 May 2022 05:51:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8AAF38D0002; Mon, 30 May 2022 01:51:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 832108D0001; Mon, 30 May 2022 01:51:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A5F48D0002; Mon, 30 May 2022 01:51:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 574E38D0001 for ; Mon, 30 May 2022 01:51:01 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 24DE8347C2 for ; Mon, 30 May 2022 05:51:01 +0000 (UTC) X-FDA: 79521335922.28.8BB0A57 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by imf26.hostedemail.com (Postfix) with ESMTP id E1153140045 for ; Mon, 30 May 2022 05:50:54 +0000 (UTC) Received: by mail-pj1-f41.google.com with SMTP id cx11so1647529pjb.1 for ; Sun, 29 May 2022 22:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=BobJJoukDoqDMc7RsnBOslTuYcnA41bZYrPd0qFtxLo=; b=HEF7yI75q4/jLPdr8k8FIN79TtOolBn3y8oOoLyjUcQYCeEubGiOVFNCZYHOP2DodO U3Wxv75HH2hosZRM/pbXPabBahO3aYxmP0MTfPaO68wLdg/hinLanrclStogNjTTwQet TXtPyvEsQ6saNOUa+1mNKc6Jy9BktQiF2Kn9xg0R9GqRE4g7x9dMKt1nuKZKzXbP2761 E7HNl6lR5tnBzQTLUjEb3ZF82XKABWtVYbmq+1/P/ZQE4Su6qZ7HeRTiNyUXy0u4HbTt scgUx+yUTiFQ0fPdV8vmfKAUE6m7EVxKXGJUpVytEDTAHK9P1G/8K5VY6f6E7W6N0KhU 1qFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=BobJJoukDoqDMc7RsnBOslTuYcnA41bZYrPd0qFtxLo=; b=k6WYjfFpmRiEfwwGU0LNK552Y7imMMnx3BtdexJ+yO5zPd39MWsjzDtaclIpPRca8l N0QlbhCB8R8nkMLdthBHrZIdw8iErydZW34vIsB+T+6ICv2pwr6pJK+js9i3en+flQFH 5W3+8/NzlX84PVBN1keMhQ/SObW+rsGr1ysqgzaZYe0kgwWpsjQ+MPCbMsi96M2JSsQ8 AEf2YTD58QZTeCfuGYIZsD0QvovNZkVzwVZPbiUI0nNxfey8u+3RVtrYPbGKkVxBSxjX VCkVAEGuzTZt4hSQ0aPWgTjk5nl0uhna+vqH4Keaj5/wZQNVV+r+aHdDogdk6/gItY9K RsNg== X-Gm-Message-State: AOAM530LuabbL6nqCifCAVzBl+h09A9/Bv7B34U8ic0RlujR7X7BsqP9 AXQy3aaeP7Dcx7t6JIyRFWhM/g== X-Google-Smtp-Source: ABdhPJzcG+Wj6HLqctwFpGM4LHkzUb2FX/9k6M4jkgCUJI4u5NtU/hy1qSKbgIOb5h07et2CFwjE5A== X-Received: by 2002:a17:90b:224a:b0:1e2:7afb:3367 with SMTP id hk10-20020a17090b224a00b001e27afb3367mr16511516pjb.37.1653889857790; Sun, 29 May 2022 22:50:57 -0700 (PDT) Received: from [10.255.89.136] ([139.177.225.249]) by smtp.gmail.com with ESMTPSA id q11-20020a170903204b00b00163be997587sm3169891pla.100.2022.05.29.22.50.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 May 2022 22:50:57 -0700 (PDT) Message-ID: <286dbd1f-1c62-a171-7453-d772bd98332c@bytedance.com> Date: Mon, 30 May 2022 13:46:57 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: Re: [PATCH 2/3] mm/memory-failure.c: support reset PTE during unpoison Content-Language: en-US To: =?UTF-8?B?SE9SSUdVQ0hJIE5BT1lBKOWggOWPoyDnm7TkuZ8p?= Cc: "akpm@linux-foundation.org" , "mst@redhat.com" , "david@redhat.com" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "jasowang@redhat.com" , "virtualization@lists.linux-foundation.org" , "pbonzini@redhat.com" , "peterx@redhat.com" , "qemu-devel@nongnu.org" References: <20220520070648.1794132-1-pizhenwei@bytedance.com> <20220520070648.1794132-3-pizhenwei@bytedance.com> <20220530050234.GA1036127@hori.linux.bs1.fc.nec.co.jp> From: zhenwei pi In-Reply-To: <20220530050234.GA1036127@hori.linux.bs1.fc.nec.co.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=HEF7yI75; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf26.hostedemail.com: domain of pizhenwei@bytedance.com designates 209.85.216.41 as permitted sender) smtp.mailfrom=pizhenwei@bytedance.com X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: E1153140045 X-Stat-Signature: rwydnmt5ztt88ymbddtqr49qcbo45dgq X-HE-Tag: 1653889854-652280 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 5/30/22 13:02, HORIGUCHI NAOYA(堀口 直也) wrote: > On Fri, May 20, 2022 at 03:06:47PM +0800, zhenwei pi wrote: >> Origianlly, unpoison_memory() is only used by hwpoison-inject, and >> unpoisons a page which is poisoned by hwpoison-inject too. The kernel PTE >> entry has no change during software poison/unpoison. >> >> On a virtualization platform, it's possible to fix hardware corrupted page >> by hypervisor, typically the hypervisor remaps the error HVA(host virtual >> address). So add a new parameter 'const char *reason' to show the reason >> called by. >> >> Once the corrupted page gets fixed, the guest kernel needs put page to >> buddy. Reuse the page and hit the following issue(Intel Platinum 8260): >> BUG: unable to handle page fault for address: ffff888061646000 >> #PF: supervisor write access in kernel mode >> #PF: error_code(0x0002) - not-present page >> PGD 2c01067 P4D 2c01067 PUD 61aaa063 PMD 10089b063 PTE 800fffff9e9b9062 >> Oops: 0002 [#1] PREEMPT SMP NOPTI >> CPU: 2 PID: 31106 Comm: stress Kdump: loaded Tainted: G M OE 5.18.0-rc6.bm.1-amd64 #6 >> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 >> RIP: 0010:clear_page_erms+0x7/0x10 >> >> The kernel PTE entry of the fixed page is still uncorrected, kernel hits >> page fault during prep_new_page. So add 'bool reset_kpte' to get a change >> to fix the PTE entry if the page is fixed by hypervisor. >> >> Signed-off-by: zhenwei pi >> --- >> include/linux/mm.h | 2 +- >> mm/hwpoison-inject.c | 2 +- >> mm/memory-failure.c | 26 +++++++++++++++++++------- >> 3 files changed, 21 insertions(+), 9 deletions(-) >> > > Do you need undoing rate limiting here? In the original unpoison's usage, > avoiding flood of "Unpoison: Software-unpoisoned page" messages is helpful. > > And unpoison seems to be called from virtio-balloon multiple times when > the backend is 2MB hugepages. If it's right, printing out 512 lines of > "Unpoison: Unpoisoned page 0xXXX by virtio-balloon" messages might not be > so helpful? > All the suggestions(include '[PATCH 1/3] memory-failure: Introduce memory failure notifier') are reasonable, I'll fix them in the next version. Thanks a lot! -- zhenwei pi