Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1552651rwl; Wed, 12 Apr 2023 15:03:03 -0700 (PDT) X-Google-Smtp-Source: AKy350Yd74jIh+ZwP6MgGFJoOiRQTvJ8D7GmDZnWvAOQKy881QQwztMqGyli0sO5aHJm5cFx9pQp X-Received: by 2002:a17:902:c702:b0:1a1:ee8c:eef5 with SMTP id p2-20020a170902c70200b001a1ee8ceef5mr390067plp.7.1681336983023; Wed, 12 Apr 2023 15:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681336983; cv=none; d=google.com; s=arc-20160816; b=TG5clkII60DJJqA8DzUNZ5pzsJQLdts5RyRw2YD+AkFrdXIz7VOs1a1Z8QrrySbCaO Ihw6T3lTPndS13rSqEo3xcUNViRylLaYX9RPoLz+nqUlm5CP4n31TXhl3SmoZ++25CSJ EM4RJnHYCGx++byTqvis5JNly5GWGhnx7hKOsDNy3uqMGhVDpwJn9hDbxECKp+mIMPWl UDmW/u+3GpZKQaptQ8xP0U9g9Ts5UiLpV7/fb2Zp+97r54GZ6DX/Dp9iZewAlJP6f5CX qUHrO46hzXTiP22whTKp1mJpaWU2bENLBDn2QQ7tca6N27lerXTha8ZmU9+BK2le50yb XfNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=tFZTeMGgV1QjjxECzVnoZtX9fbR3O7rZnv5Xk9piIqM=; b=kMfvd1GdyfxWCxqX2m2WLXwx/KsIxiZ6Dhn0jfs6ZZNU5QjHu545TspH39v7E9Mp/6 Vx0gQN3beuzaKi3la6uLOVDnLb1L4VamjrXQg9bAXfmoiID3EeB3XQJcVAO2O6kXubTH V4ekLb6F5/SrdfDgJIXB8zbfGmOpdDT0sFfslay5AqUlWxr1NM05uJUcSjAfMT2PZM4A DiWAWmEYHFmZ31VOGey8aqFR9aZ/YJ4p9oQFGWOkwGVkF3YMnFkf2qbss1nnZC0z5SkJ hbEerNg4uWORVK7pPz9glvTcnXGSWDAqOK3DwOKkhISouG2FuTCj4faH3V6dvE3h1mCb bbUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=NcieaChH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 19-20020a170902ee5300b001a6400e8c22si109952plo.543.2023.04.12.15.02.50; Wed, 12 Apr 2023 15:03:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=NcieaChH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229775AbjDLV5W (ORCPT + 99 others); Wed, 12 Apr 2023 17:57:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229564AbjDLV5V (ORCPT ); Wed, 12 Apr 2023 17:57:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70B912D44 for ; Wed, 12 Apr 2023 14:57:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F3F006397A for ; Wed, 12 Apr 2023 21:57:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21B1DC433EF; Wed, 12 Apr 2023 21:57:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1681336639; bh=6pRvLGc87JTXtP4muzgwevPzgBKLZDkUknq8v/ar9Ik=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NcieaChHyrNGnCn7GnJNkduQweAwfHG4D+WlMj0KByLMYkb+Yw5eawpuWpyDke/vp Jsf7xKCznL2j0yKer+6MO1ryeP1EfxxFG3yJT2IxKN0riQOmQtyzBSbL70eve4O771 taqdi4LjEi0Jks86rFGfNpz/4hB6flnEUQzCwjGY= Date: Wed, 12 Apr 2023 14:57:18 -0700 From: Andrew Morton To: Mike Kravetz Cc: Liu Shixin , Naoya Horiguchi , Tony Luck , Miaohe Lin , Muchun Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] mm: hwpoison: support recovery from HugePage copy-on-write faults Message-Id: <20230412145718.0bcb7dd98112a3010711ad0b@linux-foundation.org> In-Reply-To: <20230412181350.GA22818@monkey> References: <20230411092741.780679-1-liushixin2@huawei.com> <20230412181350.GA22818@monkey> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 Apr 2023 11:13:50 -0700 Mike Kravetz wrote: > On 04/11/23 17:27, Liu Shixin wrote: > > Patch a873dfe1032a ("mm, hwpoison: try to recover from copy-on write faults") > > introduced a new copy_user_highpage_mc() function, and fix the kernel crash > > when the kernel is copying a normal page as the result of a copy-on-write > > fault and runs into an uncorrectable error. But it doesn't work for HugeTLB. > > Andrew asked about user-visible effects. Perhaps, a better way of > stating this in the commit message might be: > > Commit a873dfe1032a ("mm, hwpoison: try to recover from copy-on write > faults") introduced the routine copy_user_highpage_mc() to gracefully > handle copying of user pages with uncorrectable errors. Previously, > such copies would result in a kernel crash. hugetlb has separate code > paths for copy-on-write and does not benefit from the changes made in > commit a873dfe1032a. > > Modify hugetlb copy-on-write code paths to use copy_mc_user_highpage() > so that they can also gracefully handle uncorrectable errors in user > pages. This involves changing the hugetlb specific routine > ?copy_user_folio()? from type void to int so that it can return an error. > Modify the hugetlb userfaultfd code in the same way so that it can return > -EHWPOISON if it encounters an uncorrectable error. Thanks, but... what are the runtime effects? What does hugetlb presently do when encountering these uncorrectable error?