Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp55993ybi; Wed, 29 May 2019 16:34:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1d8/eydLndgiQPcRXp36vje8/jUPk6tonwYW4JnJs0hrdhFT103/++ZesdM889LOEvcih X-Received: by 2002:a65:518d:: with SMTP id h13mr700332pgq.186.1559172891143; Wed, 29 May 2019 16:34:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559172891; cv=none; d=google.com; s=arc-20160816; b=p6aypA9aJUXqoePxYyo1ZDNeOLVobdE8qxKA9IIERegMXoVSK5fbx+j4yRzL0edlc3 ILZIME/ZidXuSs+59WDogpQZLFr8+9+gCC7Y83PJ28HjbLt31aekuu9iDZzsgVWPZhAF 90L95+Njl50U+s0VF6I84RaWV4lzvxeQAlkM2EnxFugaDq2cCf13uxGvl42nAOQ4N44W LelbcF38StrtdDeHkuvmFsqpHMKaUw2atzL6P/vfBBSUIz4pfAH8aOx0g2BsCIHBibHA mea36SYa36c2Z2AzchKR5tqGzESI/eqilR3abO0b2FohySes/utdvL7XhkNN8O9/TtWM 2jyg== 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:dkim-signature; bh=ZeIntJUzf6RoM7jUUPQSe8jXByDyh+4YkHIeg3GAXsQ=; b=yR8q5b+VS0Glnhz9DCy4NlVDcf5wD4BheMazDQN7oQlT7LvdoqvtP9FVupfy669NBx 2QXNB6yBP5WtD6EbHO31Vi19orrTlQihHDFvzd8KbwzdQJK2exVOmjc/ccKfagRv+IKK T8nQO4cxfuUAfmDyS9OwGfEhJ3ufjsbYunzi++Zv8dFGGuk4do5Te+hnLIq4URZCn5im daPt/zpIqeieRKCSpKVB7qaq3+kdXJwbL/fZmVA1VjGDmK7QnEI4NqMPxyxqnY4XXZLA YVW3t0zM5Jeu4OXMUJFg6dXcwUjO8TreH8fNM8PLy3U2E896bJF6Ufao3oTAzJKoI6sJ LQqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=IAaKB5qa; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p11si1321623pgm.551.2019.05.29.16.34.34; Wed, 29 May 2019 16:34:51 -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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=IAaKB5qa; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726674AbfE2XdW (ORCPT + 99 others); Wed, 29 May 2019 19:33:22 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:39476 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbfE2XdW (ORCPT ); Wed, 29 May 2019 19:33:22 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4TNSRIp080130; Wed, 29 May 2019 23:31:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=ZeIntJUzf6RoM7jUUPQSe8jXByDyh+4YkHIeg3GAXsQ=; b=IAaKB5qaUOqWsmMianN1GrQXpj9HG3cU0oz4ab6U1xB/tXO6+QR4XtP3ZMrOtiUMkOoV 4E5Psrzd26xnaBWY4KxDwMtLYLrwtpzQmCqBocQFFxj26Y0zHm7WphZ5Vy7kvikFllbw K8oaFQODFc4ZYWzCBXppsBGoVQwYQdQg2GW8EUlLymnnHNwmkbT5lBnfY5IXgtKbeuvb fRuY8+2I/DomXosaX6EOYlvf6BUj2JvvkWAYxRpc9VIrwm5f0jD27GRQgV/1zhr4IIot MQ7LFuYSpR3RENpPYFVJ87Ior67/wGNxK49Fdt541GiLuVThQPe3y929dj9OI1biQ4aK dA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2spw4tn09w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 May 2019 23:31:18 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4TNTqPs081158; Wed, 29 May 2019 23:31:17 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3030.oracle.com with ESMTP id 2srbdxp6qf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 May 2019 23:31:17 +0000 Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x4TNV3Z4032602; Wed, 29 May 2019 23:31:04 GMT Received: from [192.168.1.222] (/71.63.128.209) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 29 May 2019 16:31:03 -0700 Subject: Re: [PATCH v2] mm: hwpoison: disable memory error handling on 1GB hugepage To: Wanpeng Li Cc: Michael Ellerman , Andrew Morton , Punit Agrawal , Naoya Horiguchi , "linux-mm@kvack.org" , Michal Hocko , "Aneesh Kumar K.V" , Anshuman Khandual , "linux-kernel@vger.kernel.org" , Benjamin Herrenschmidt , "linuxppc-dev@lists.ozlabs.org" , kvm , Paolo Bonzini , Xiao Guangrong , lidongchen@tencent.com, yongkaiwu@tencent.com References: <20180130013919.GA19959@hori1.linux.bs1.fc.nec.co.jp> <1517284444-18149-1-git-send-email-n-horiguchi@ah.jp.nec.com> <87inbbjx2w.fsf@e105922-lin.cambridge.arm.com> <20180207011455.GA15214@hori1.linux.bs1.fc.nec.co.jp> <87fu6bfytm.fsf@e105922-lin.cambridge.arm.com> <20180208121749.0ac09af2b5a143106f339f55@linux-foundation.org> <87wozhvc49.fsf@concordia.ellerman.id.au> From: Mike Kravetz Message-ID: Date: Wed, 29 May 2019 16:31:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9272 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905290145 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9272 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905290146 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/28/19 2:49 AM, Wanpeng Li wrote: > Cc Paolo, > Hi all, > On Wed, 14 Feb 2018 at 06:34, Mike Kravetz wrote: >> >> On 02/12/2018 06:48 PM, Michael Ellerman wrote: >>> Andrew Morton writes: >>> >>>> On Thu, 08 Feb 2018 12:30:45 +0000 Punit Agrawal wrote: >>>> >>>>>> >>>>>> So I don't think that the above test result means that errors are properly >>>>>> handled, and the proposed patch should help for arm64. >>>>> >>>>> Although, the deviation of pud_huge() avoids a kernel crash the code >>>>> would be easier to maintain and reason about if arm64 helpers are >>>>> consistent with expectations by core code. >>>>> >>>>> I'll look to update the arm64 helpers once this patch gets merged. But >>>>> it would be helpful if there was a clear expression of semantics for >>>>> pud_huge() for various cases. Is there any version that can be used as >>>>> reference? >>>> >>>> Is that an ack or tested-by? >>>> >>>> Mike keeps plaintively asking the powerpc developers to take a look, >>>> but they remain steadfastly in hiding. >>> >>> Cc'ing linuxppc-dev is always a good idea :) >>> >> >> Thanks Michael, >> >> I was mostly concerned about use cases for soft/hard offline of huge pages >> larger than PMD_SIZE on powerpc. I know that powerpc supports PGD_SIZE >> huge pages, and soft/hard offline support was specifically added for this. >> See, 94310cbcaa3c "mm/madvise: enable (soft|hard) offline of HugeTLB pages >> at PGD level" >> >> This patch will disable that functionality. So, at a minimum this is a >> 'heads up'. If there are actual use cases that depend on this, then more >> work/discussions will need to happen. From the e-mail thread on PGD_SIZE >> support, I can not tell if there is a real use case or this is just a >> 'nice to have'. > > 1GB hugetlbfs pages are used by DPDK and VMs in cloud deployment, we > encounter gup_pud_range() panic several times in product environment. > Is there any plan to reenable and fix arch codes? I too am aware of slightly more interest in 1G huge pages. Suspect that as Intel MMU capacity increases to handle more TLB entries there will be more and more interest. Personally, I am not looking at this issue. Perhaps Naoya will comment as he know most about this code. > In addition, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/kvm/mmu.c#n3213 > The memory in guest can be 1GB/2MB/4K, though the host-backed memory > are 1GB hugetlbfs pages, after above PUD panic is fixed, > try_to_unmap() which is called in MCA recovery path will mark the PUD > hwpoison entry. The guest will vmexit and retry endlessly when > accessing any memory in the guest which is backed by this 1GB poisoned > hugetlbfs page. We have a plan to split this 1GB hugetblfs page by 2MB > hugetlbfs pages/4KB pages, maybe file remap to a virtual address range > which is 2MB/4KB page granularity, also split the KVM MMU 1GB SPTE > into 2MB/4KB and mark the offensive SPTE w/ a hwpoison flag, a sigbus > will be delivered to VM at page fault next time for the offensive > SPTE. Is this proposal acceptable? I am not sure of the error handling design, but this does sound reasonable. That block of code which potentially dissolves a huge page on memory error is hard to understand and I'm not sure if that is even the 'normal' functionality. Certainly, we would hate to waste/poison an entire 1G page for an error on a small subsection. -- Mike Kravetz