From patchwork Mon Jun 14 02:12:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 12318027 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE351C48BDF for ; Mon, 14 Jun 2021 02:12:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 72AE1613AB for ; Mon, 14 Jun 2021 02:12:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72AE1613AB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DB4B46B006C; Sun, 13 Jun 2021 22:12:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D8C4B6B006E; Sun, 13 Jun 2021 22:12:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C2D1B6B0070; Sun, 13 Jun 2021 22:12:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0141.hostedemail.com [216.40.44.141]) by kanga.kvack.org (Postfix) with ESMTP id 904976B006C for ; Sun, 13 Jun 2021 22:12:27 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2E0194DBD for ; Mon, 14 Jun 2021 02:12:27 +0000 (UTC) X-FDA: 78250705134.25.E9694D0 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by imf21.hostedemail.com (Postfix) with ESMTP id 358ECE000240 for ; Mon, 14 Jun 2021 02:12:16 +0000 (UTC) Received: by mail-pj1-f44.google.com with SMTP id go18-20020a17090b03d2b029016e4ae973f7so8135551pjb.0 for ; Sun, 13 Jun 2021 19:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SQnybCIkX2nlwJQ89tO2iOaMNTDW/dZcZ/YUuyKE+JM=; b=dboEhjcUsrGWHDsB4gZx0K17gVrE8vYYHbocPhRD1C+3zDTTZoYiM7y5R/I+lKxBpq dPiBvn+5PF3B4IY7xy79asZZEvTj92v85KGjQFsJMrp83/xeYmODXycgIoDkDqePs8Bz LSzxwcsmXZS9MBUSsqUcxGvHyC6sENC1YN1uHqOCIABgUGdAuDKrEZR4YCmEYod+LY75 1alzg5gyNGCpioQL4AOmoxa4pcTHb27GaYPX92BLObuUzzzTkP3nUfbExvvtii1AEdvO Ii2TE0tdpQfrGV0p27go35g6fxfCF02Jd5CgENt5C5TSrBgZl08D5pXusmD9rGTm7zwf 0QQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SQnybCIkX2nlwJQ89tO2iOaMNTDW/dZcZ/YUuyKE+JM=; b=Vh4Pkv1Pu7eNvMa/Zgd6jFqP0JLH9gQEisEzUNf05S7OePCnSIs1xDpEnCgbgi8FJP jy08paeOF7/0caA5vyYjFnXdkFIJJ9lH7Cn6kEfxGb5lBgAiitTxNiTbkifwS1WuGW9H shCxT1Vm4+szxRPVTs8NyKc61t4KyUF3rW2xC1psCUqLRcHSs+78bqU6KGUlqrRugDKb nBqA1Mq0brmgNZRntnD8y+tAISjK2y2bTrr00fCCRysTftBZUE8eJSgc7znUOw2X9qNx sGKF570uz5pGO2BmUgupUpSxp3rc1MtmAA5reTx2vvcLsXFt2/lLmQTxwJWVamSro7kX a8/A== X-Gm-Message-State: AOAM530SkOcyXQkQ3jWyfVB6MbFCWGKKbdGXIPGNwQkFvGlbvCPIIIgB Tk8Qk5o2ORV4Q1ml9bbXx5ZlN2TyTqWX X-Google-Smtp-Source: ABdhPJyhzSQEB1ODo82x1PnndemLBZxpkBIIv8tiryw0zjoY7SA5yX4sOfXeuyewMRHwrmY4TGhCTQ== X-Received: by 2002:a17:902:d4d0:b029:113:fb3d:3644 with SMTP id o16-20020a170902d4d0b0290113fb3d3644mr14578776plg.58.1623636745667; Sun, 13 Jun 2021 19:12:25 -0700 (PDT) Received: from localhost.localdomain (h175-177-040-153.catv02.itscom.jp. [175.177.40.153]) by smtp.gmail.com with ESMTPSA id z14sm10952986pfn.11.2021.06.13.19.12.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Jun 2021 19:12:25 -0700 (PDT) From: Naoya Horiguchi To: linux-mm@kvack.org Cc: Andrew Morton , David Hildenbrand , Oscar Salvador , Michal Hocko , Ding Hui , Tony Luck , "Aneesh Kumar K.V" , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: [PATCH v1 0/6] mm/hwpoison: fix unpoison_memory() Date: Mon, 14 Jun 2021 11:12:06 +0900 Message-Id: <20210614021212.223326-1-nao.horiguchi@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 358ECE000240 X-Stat-Signature: t7earik7b8cwrnwf5hgku1x8ae8zr9cr Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=dboEhjcU; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf21.hostedemail.com: domain of naohoriguchi@gmail.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=naohoriguchi@gmail.com X-HE-Tag: 1623636736-372293 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: Hi, This patchset is suggesting to adjust unpoison_memory() to the new way of isolation and refcounting of hwpoisoned pages. As mentioned in [1], NR_FREE_PAGES is incremented via newly added function undoing take_page_off_buddy(), so the counter is consistent with this series. It depends on some other hwpoison-related patches (not mainlined but in linux-mm), so I listed the dependencies here: - mm/hwpoison: do not lock page again when me_huge_page() successfully recovers - mm/memory-failure: make sure wait for page writeback in memory_failure - mm,hwpoison: make get_hwpoison_page() call get_any_page() - mm,hwpoison: fix race with hugetlb page allocation - mm,hwpoison: Send SIGBUS with error virutal address - mm,hwpoison: Return -EHWPOISON to denote that the page has already been poisoned - mm/memory-failure: Use a mutex to avoid memory_failure() races Or GitHub branch I pushed for easy patch access might be helpful for reviewers. git fetch https://github.com/nhoriguchi/linux hwpoison [1] https://lore.kernel.org/linux-mm/20210527003436.GA3543069@hori.linux.bs1.fc.nec.co.jp/ Thanks, Naoya Horiguchi --- Summary: Naoya Horiguchi (6): mm/hwpoison: mf_mutex for soft offline and unpoison mm/hwpoison: remove race consideration mm/hwpoison: introduce MF_MSG_PAGETABLE mm/hwpoison: remove MF_MSG_BUDDY_2ND and MF_MSG_POISONED_HUGE mm/hwpoison: make some kernel pages handlable mm/hwpoison: fix unpoison_memory() include/linux/mm.h | 4 +- include/linux/page-flags.h | 4 ++ include/ras/ras_event.h | 3 +- mm/memory-failure.c | 176 +++++++++++++++++++++++++-------------------- mm/page_alloc.c | 19 +++++ 5 files changed, 126 insertions(+), 80 deletions(-)