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 13A2DC433EF for ; Thu, 23 Jun 2022 23:52:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7A6548E01A5; Thu, 23 Jun 2022 19:52:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 755C88E01A1; Thu, 23 Jun 2022 19:52:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 61ED18E01A5; Thu, 23 Jun 2022 19:52:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 53F3F8E01A1 for ; Thu, 23 Jun 2022 19:52:23 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 1C50732B for ; Thu, 23 Jun 2022 23:52:23 +0000 (UTC) X-FDA: 79611152166.10.4397050 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf31.hostedemail.com (Postfix) with ESMTP id B1F0820027 for ; Thu, 23 Jun 2022 23:52:22 +0000 (UTC) Received: by mail-pj1-f45.google.com with SMTP id f16so1140593pjj.1 for ; Thu, 23 Jun 2022 16:52:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DefBYaY/G33kY4Ei9AvXETroX4rt5wpVrX5H893xFe8=; b=Sy4dpBK9sxm6P1WYqg3D7g3GCUd2xUq4x6AnHGjjnZ47T/sRJJjc+j4mWPXxBkFEog UfgGJJ/C3IVk9qX/R35CfCkxoJfLiiGuDPL/CjKxCDhatzE5d6L/bId9gF/Ly1abut+j /rSa+f/H32w8OoUvMKNIRmqfV18iOSY/2h0pvrt9iba25lUmFSq7XPERVAFN+f8Jq1W4 lduN9LuS+ajFQ5q9rUIcl3i2lh09TtzIdBke9RxcDPtbwsS2kXOeUlv3R0lFsAqIcdXS 846pHtNAJS22q7crZjwXOqoAV29uCgF4ZgUC4QiV2+lzpeoVQHYZ/JtMmT7oPW8mRlO8 gcdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DefBYaY/G33kY4Ei9AvXETroX4rt5wpVrX5H893xFe8=; b=DdbdIndgMj6CUXcf34RNgcRm+8nEETATg63rslHSxW19lLZMujsmKk8aqKlXSWsEt7 Xv8faPbAGoy7Hleg/nk74N/34FRwFbCE26qe8Gvju363GGY/VXogPZc31znTsH8MEtb3 VaOTv/fGM0F/8PlGYBG4AhAxQE0k3mBqRK9uvpu2F0T2maXMl9iiPujCKW3YYGwoVTZV rxA6mzf1NsOayTjkSORLDS0l+GvI6WCDKY9eHwHR/wbET5sanifD/RDfuwuT5/5oXKMF 73+lZoUzIju5iybvaMIW1MtkzUgn70jWIOKk09UzU5yh7/oAKvs2p2UX+O5KOAkuDXJq /+/A== X-Gm-Message-State: AJIora/MPVOpXEVw5nz6d2PqHt61LpALKzmHmRFunVMlN7zwQdRZhTQo +PAkfu371GWJ98/O4cVn7kkngiqQ6w== X-Google-Smtp-Source: AGRyM1uJYsdX/CAb4fmaTrTq/2csUXOYUyJmGEi18K/Pcxpkbsb5kd+sUGMjL/8I4qf2COUNlcj3qA== X-Received: by 2002:a17:903:234e:b0:16a:2d02:add7 with SMTP id c14-20020a170903234e00b0016a2d02add7mr19621461plh.10.1656028341391; Thu, 23 Jun 2022 16:52:21 -0700 (PDT) Received: from ik1-406-35019.vs.sakura.ne.jp (ik1-406-35019.vs.sakura.ne.jp. [153.127.16.23]) by smtp.gmail.com with ESMTPSA id r10-20020a170903020a00b00168eab11f67sm362571plh.94.2022.06.23.16.52.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jun 2022 16:52:21 -0700 (PDT) From: Naoya Horiguchi X-Google-Original-From: Naoya Horiguchi To: linux-mm@kvack.org Cc: Andrew Morton , David Hildenbrand , Mike Kravetz , Miaohe Lin , Liu Shixin , Yang Shi , Oscar Salvador , Muchun Song , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: [PATCH v2 0/9] mm, hwpoison: enable 1GB hugepage support (v2) Date: Fri, 24 Jun 2022 08:51:44 +0900 Message-Id: <20220623235153.2623702-1-naoya.horiguchi@linux.dev> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656028342; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=DefBYaY/G33kY4Ei9AvXETroX4rt5wpVrX5H893xFe8=; b=5gkY3kCyuVNlSELpl7YjpCdr10VPDGcFXQxw62CpE57WmbF5S8K7WBwm4hnZcnOMG9QN63 ff2UBYqhC8oC/8LPGTP9JkGyni5iG5GVSWVJbuGk+mbzdW80VSjDmNsPLp0Cp2tmo0VSpU 2gGwsTMN3BDcR95Aq02ILcBX07ZR2C0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656028342; a=rsa-sha256; cv=none; b=jokzc5MqaaeJrVOlLrRUmC3/4wSnKw/RCuEQL7A5gdKkNEifVoXG9Q/JhfScoaNY76sRtt Ede9Vbrt8uiN1BVoGvlMvBTcFc4ZBdxmoRYNfyNerb3AWxJwdwtKQltysj3JDJQlCkgL9C uJQyHKMDdMlvvnDrmdGqWkiPCvNZcpA= ARC-Authentication-Results: i=1; imf31.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Sy4dpBK9; spf=pass (imf31.hostedemail.com: domain of nao.horiguchi@gmail.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=nao.horiguchi@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Sy4dpBK9; spf=pass (imf31.hostedemail.com: domain of nao.horiguchi@gmail.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=nao.horiguchi@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B1F0820027 X-Stat-Signature: yqwscusfptxzbhmn6cucgpzemtj4po75 X-HE-Tag: 1656028342-709594 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: Here is v2 of "enabling memory error handling on 1GB hugepage" patchset. Major updates: - (patch 3/9) I made pud_huge() and follow_huge_pud() aware of non-present pud entry (based on Miaohe's comment). - (patch 4/9 and patch 5/9) I extended the mechanism to save raw error info to support multiple error subpages in a hugepage. Additionally, I added a "unreliable" flag which prevents freeing hwpoison hugetlb if any raw error info is lost. - (patch 1/9 and 2/9) During testing some common cases for 1GB hugepage, I found a few issues in existing code, so this series starts with fixing them. The remaining patches should have only minor updates since v1. Patch dependency: - "mm/memory-failure: disable unpoison once hw error happens" (actually the conflict is not logical one, but adding MF_SIMULATED to mf_flags conflicts with patch 6/9.) v1: https://lore.kernel.org/linux-mm/20220602050631.771414-1-naoya.horiguchi@linux.dev/T/#u Thanks, Naoya Horiguchi --- Summary: Naoya Horiguchi (9): mm/hugetlb: remove checking hstate_is_gigantic() in return_unused_surplus_pages() mm/hugetlb: separate path for hwpoison entry in copy_hugetlb_page_range() mm/hugetlb: make pud_huge() and huge_pud() aware of non-present pud entry mm, hwpoison, hugetlb: support saving mechanism of raw error pages mm, hwpoison: make unpoison aware of raw error info in hwpoisoned hugepage mm, hwpoison: set PG_hwpoison for busy hugetlb pages mm, hwpoison: make __page_handle_poison returns int mm, hwpoison: skip raw hwpoison page in freeing 1GB hugepage mm, hwpoison: enable memory error handling on 1GB hugepage arch/x86/mm/hugetlbpage.c | 3 +- include/linux/hugetlb.h | 13 ++++ include/linux/mm.h | 2 +- include/linux/swapops.h | 9 +++ include/ras/ras_event.h | 1 - mm/hugetlb.c | 78 ++++++++++++++-------- mm/memory-failure.c | 163 +++++++++++++++++++++++++++++++++++++--------- 7 files changed, 209 insertions(+), 60 deletions(-)