From patchwork Mon Oct 24 06:20:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 572 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp279944wru; Sun, 23 Oct 2022 23:21:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5E3lJik/T5XLdlPgXgNm8A/EdehPVRosT4rgtrBEw6tCqdta0n/SGxesaRkfxC343XiSTa X-Received: by 2002:a05:6402:50cd:b0:45d:74d:93a2 with SMTP id h13-20020a05640250cd00b0045d074d93a2mr29111338edb.156.1666592471420; Sun, 23 Oct 2022 23:21:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666592471; cv=none; d=google.com; s=arc-20160816; b=uvX9q1oz6GKvnUPqVd65J+p3hVYzfvdG4ACZEYgRkm7GWHU7D42bzKq2KNyoQXILOM nGCBKPhtar5Q6E5HTYHTCUiOED1/DCqTCd6NNtMPlVOQltiboAkOQEW5OM4WOHi5ofcG tJ4YxwREzI52kkecPxgJYPdjZULIxVsSMmoqn4SX7DciWQiAg8zIPJ0n4pdP2X2bWdLd SXtIYFcL5CgyTrNEY2/Z6KqZBG7eQnYcT1idUnArW6H4X647LjCgwNm6gWi2z/beAtSe IVsymiS4gSo0upMWE3l3TYcHlyl2Ji7xtpZ9uiRA/nZc3wrRYA6KIWB5cd1oSjb7rSRh 1nkQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=83UJL5fJPtb/iVfLXDHgaxM+tRPdlO0Uy7hw8QI04yQ=; b=pFkbx4KZ6vXdBEz1NfWhd4s2XPrMyJ9hASITNjzir5wThE1Nu8IJTw7SzDBgCNLXZ0 r4ExCJVkjhFdRj9+nUhZBnoLu2rLHq7gzqOgJMvcre07vbmaF2naZuCBj4X/YRAWISbt cxtpWEDPrQYPLA015GFkcPDGiWOgIPXsoJyEDqstmocqrRCqrqAPcScb13yU9SQZwBFT sHJ6+4OMEvILpPoW3QXIweUoDiniqG09S1/zM6sncdzF+H+uCkrOy1FHCuk3q0X47OIN op7Ma1kXqfWQrNaZ8dgNdmpqDdNPiBEr8dLnX97voi1b+u/9NU/o2qUFeVY4aqk2tbka eeKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=CDLMPJfc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id la26-20020a170907781a00b007316843d58bsi22905171ejc.925.2022.10.23.23.20.46; Sun, 23 Oct 2022 23:21:11 -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.dev header.s=key1 header.b=CDLMPJfc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230121AbiJXGUf (ORCPT + 99 others); Mon, 24 Oct 2022 02:20:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbiJXGUa (ORCPT ); Mon, 24 Oct 2022 02:20:30 -0400 Received: from out0.migadu.com (out0.migadu.com [IPv6:2001:41d0:2:267::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B845740BF5 for ; Sun, 23 Oct 2022 23:20:27 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1666592426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=83UJL5fJPtb/iVfLXDHgaxM+tRPdlO0Uy7hw8QI04yQ=; b=CDLMPJfcld1kZNeMeqAbrlvCnzZ/OK2XZ81Y2BFtg3E0YU8IbocxFsMD5CzOStZYacCukJ M3a4vMXpeiHtj4dqkri19AtbpgFZxC4uG0JxaCObs8ntpXFZipTBuQLhbeCqoHmFAhpn4v 9T7C/Dxpmee+5B7zuqNvnFTPqx3FTKo= From: Naoya Horiguchi To: linux-mm@kvack.org Cc: Andrew Morton , Miaohe Lin , David Hildenbrand , Mike Kravetz , Yang Shi , Oscar Salvador , Muchun Song , Jane Chu , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: [PATCH v7 0/4] mm, hwpoison: improve handling workload related to hugetlb and memory_hotplug Date: Mon, 24 Oct 2022 15:20:08 +0900 Message-Id: <20221024062012.1520887-1-naoya.horiguchi@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747548867208002967?= X-GMAIL-MSGID: =?utf-8?q?1747548867208002967?= Hi, This patchset tries to solve the issue among memory_hotplug, hugetlb and hwpoison. In this patchset, memory hotplug handles hwpoison pages like below: - hwpoison pages should not prevent memory hotremove, - memory block with hwpoison pages should not be onlined. Changes in this version: - (patch 1/4) determine migratable_cleared atomically by introducing TESTCLEARHPAGEFLAG (suggested by Miaohe), - (patch 4/4) cleaned up declarations of counter API, - rebased onto akpm/mm-unstable on Oct 23. Thanks, Naoya Horiguchi v1: https://lore.kernel.org/linux-mm/20220427042841.678351-1-naoya.horiguchi@linux.dev/T v2: https://lore.kernel.org/linux-mm/20220905062137.1455537-1-naoya.horiguchi@linux.dev/T v3-5: https://lore.kernel.org/linux-mm/20220921091359.25889-1-naoya.horiguchi@linux.dev/T v6: https://lore.kernel.org/linux-mm/20221007010706.2916472-1-naoya.horiguchi@linux.dev/T --- Summary: Naoya Horiguchi (4): mm,hwpoison,hugetlb,memory_hotplug: hotremove memory section with hwpoisoned hugepage mm/hwpoison: move definitions of num_poisoned_pages_* to memory-failure.c mm/hwpoison: pass pfn to num_poisoned_pages_*() mm/hwpoison: introduce per-memory_block hwpoison counter arch/parisc/kernel/pdt.c | 5 ++-- drivers/base/memory.c | 38 ++++++++++++++++++++++++++ include/linux/hugetlb.h | 19 ++++++++++--- include/linux/memory.h | 3 +++ include/linux/mm.h | 29 ++++++++++++++++++-- include/linux/swapops.h | 24 ++--------------- mm/hugetlb.c | 9 ++++--- mm/internal.h | 8 ------ mm/memory-failure.c | 69 ++++++++++++++++++++++++++---------------------- mm/sparse.c | 2 -- 10 files changed, 130 insertions(+), 76 deletions(-)