Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6358686rwi; Sun, 23 Oct 2022 23:34:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4TldLqsUMGWxd5zaTCfS7Bb0MgBcS27eLh4xXpXVbnGYxz7P/zEIZ5mTFITAUUUaQuALZZ X-Received: by 2002:a17:907:782:b0:740:7120:c6e7 with SMTP id xd2-20020a170907078200b007407120c6e7mr26025195ejb.313.1666593245012; Sun, 23 Oct 2022 23:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666593245; cv=none; d=google.com; s=arc-20160816; b=i94sHgeiT5nrll3NWCDtHvjJwkLvU/NGujaLcpF4+7G0nKtAq5/FgvJX2vHr64i9Nq U8GwlIV6dwwsmiPVTaPBESRqRT4dhndeb1FWWADb0BFNH/D4We2RvPHgFTttJpj54RJb g3rRnilmDzFH0eZYgDGVMUaMtQCZgt4x0v5vBI0yOW4lFwnoEanTNYUeMldn9nN/43rP HnOBPj7csZOxtSz37eDL5cW4q65QVrMv9EjlGuB4n+NJO92A3QAcHxZ+cZicaGhJLB5A ngYQlp6eSvOctMSoXSbv/FV1K3i5IM/LHiV++BAI3EosBXvbdlv+DBmFEfFdSYFD3IFl cRRA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y43-20020a50bb2e000000b00459b0141076si24547300ede.465.2022.10.23.23.33.39; Sun, 23 Oct 2022 23:34:05 -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 Content-Transfer-Encoding: 8bit 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 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(-)