From patchwork Fri Nov 9 06:47:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 10675379 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AFCA913BF for ; Fri, 9 Nov 2018 06:48:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F3A42DD3D for ; Fri, 9 Nov 2018 06:48:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9358A2DD76; Fri, 9 Nov 2018 06:48:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 225CB2DD40 for ; Fri, 9 Nov 2018 06:48:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BD4506B06A8; Fri, 9 Nov 2018 01:47:53 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B0D7D6B06AA; Fri, 9 Nov 2018 01:47:53 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 95EA66B06AB; Fri, 9 Nov 2018 01:47:53 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by kanga.kvack.org (Postfix) with ESMTP id 4D0B06B06A8 for ; Fri, 9 Nov 2018 01:47:53 -0500 (EST) Received: by mail-pg1-f197.google.com with SMTP id s141-v6so607129pgs.23 for ; Thu, 08 Nov 2018 22:47:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:sender:from:to:cc:subject:date :message-id:in-reply-to:references; bh=reMxc0zME/3qnvb1lgC8fPj6wExKKId/iU2Ws7jwufo=; b=GPrY/BBGg4FjfngD0IIny/9efowWYfUy5rKcKACGw7lx9ADxFjEeJ/Gt9P6G3Wf46p mEm6lkBgClYf8oCO8M8jl7jXHuazJnZuWaOnqEmmj4WOgRUYaguvwMSFbCyb1UKzVVY2 1N+85/5wsXfP8VS+smuhH8ePZoaglzyUp7F6s081+/F4UzZl64R/lmiBDkfeCaf2gCiD 3kgalSKxnSajuY8Uz3kLO7RIXqQs56LQvT9TZPi5m9vv/j9iEHmVagB11pmFYhOAKGs0 O0OGQdsP4KDThMniVhwjodBL5XEtrnRswTyggdeoz7n2Akm1s1kyNaF+MnfcmdgKF+Dr R1JA== X-Gm-Message-State: AGRZ1gKNtIkDiCqdspJd1XZBXVNDca1Lqv+shA3oKMZgeKkU3bRHyj1+ NliaEmhftcqHU8Nz0CHQkfI/LpG47DnMAllrvQbCpooWQ/bPBbReWps/mOXnsu57DDTvajHbOSp GfD1lD6GmYZGd6SjV5QDXwVD7eeRM/vIAFT1jCV5yL6agDuIvfeRo+0NGzDrCQrEbJu8oF+x0Mz WZ8zhpRBADiXmXmoifMo3ibCaXnyclzdrFoM2Ja/WEf4pZu01KgzI4K+A4/zycBePhBCq6L7hMr KgiY/ZFqJm/8ofhhoE8j2dEc0/M0J3naan0m8rsgKUi/UKN8xQ7gIexYVk4jIMmOU3e7cbu8wG4 jBuEt933Afko2GXQpkbgrkD6DiJ66wvQQ6QsXEzEJq7HDcoCoUA1pqyO5/kc1H9W2TpZQC3nbQ= = X-Received: by 2002:a63:c141:: with SMTP id p1mr6456937pgi.424.1541746072976; Thu, 08 Nov 2018 22:47:52 -0800 (PST) X-Received: by 2002:a63:c141:: with SMTP id p1mr6456914pgi.424.1541746072131; Thu, 08 Nov 2018 22:47:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541746072; cv=none; d=google.com; s=arc-20160816; b=tOGZwun4o6DEuc82mcVuSuMmyQPtdd7Do5RQFmga2uo1FVepMtY1n8Nvd9SeRknRhq FrFDHEUvW/dg4/56H0ZXminRtuxhPSzQAl4JkhqXB2zuFwK/FcU2ykie0DI8n1vFigjp wFFNRE/7jBnGfOX28jBzy8d2zPZFiylcKXA6l3VKnjO89rEckDydSB1MUK8oXLrEHHEP AOEw5qmSzUR27p8/2Cxym9TnANN6Ba70d5dDrbSKMmdAyFIpvUhqkxnmI5daIDbrDvFr DwjGf2PNKVyAxWUClpjCNc61ze793jd4WxSeScQ8+K/GOhK1YP2gKhw/5/Z/4SymwN87 RZ/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=reMxc0zME/3qnvb1lgC8fPj6wExKKId/iU2Ws7jwufo=; b=yBrUAnB4WBPv7q07/qBOd7RI/iPw2CTLsFz0/fYXnARM8vwND+2UilNn7DpFLRVgN3 2HzldkIRuxYbMWjBjiuoo5n/sQ7iiFYjDCrXQF5uCqjxS9f2nIhrfxbeCfVfjVNc0HnS ZP0AuddEp98bn+YMFKUx+EdVXiwUNEkbDKidJ2zpHQmktpG5zOkMx1qieTygwbs61TzS 4oBdN+qPIgfczziB3WhJeSf34Bfjt/7sDEs1Wn7kDXKf30SegXwMtsHqttj2lxQ5KQVl E7qcZD7cu2AlVbXFx8rZ8LTgG5avtsvNzkGKhgduyAPcwaQPCMuBNXp3YWeHjgOXn2r5 r1KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sX4Na+DO; spf=pass (google.com: domain of nao.horiguchi@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=nao.horiguchi@gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id z10-v6sor7712035pln.16.2018.11.08.22.47.52 for (Google Transport Security); Thu, 08 Nov 2018 22:47:52 -0800 (PST) Received-SPF: pass (google.com: domain of nao.horiguchi@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sX4Na+DO; spf=pass (google.com: domain of nao.horiguchi@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=nao.horiguchi@gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=reMxc0zME/3qnvb1lgC8fPj6wExKKId/iU2Ws7jwufo=; b=sX4Na+DOIkEp8+jX1RN+XNnQhGy5F6jH9jm1540XiJ8QHjfVWTav7yF30BP24Im3eA VtWXF2EYY/5OnwdFfRFACh1uDZ9h6tEEPrw7UN3TXxByip33AO+cAGeA4ya8agN16JTd ymjkgXnVOa10zlcfD2526ggxsjZfoOGzkJpe48BZM0hNcZNLqJXUh/ZmQYE6sReI/QMc +A7KbCfDIhTB+uinSlk/F6oNYEWPPQBhObLkyTSEjBC+SSyGRgnm9UBm4L20YXKQOBbL yyrzuSut9vo+5DjD0eZ72yyIeX8Km5kLYl6Sj5HTiU/f7NefBPtQdax7RK71UmxTFTC6 YaZA== X-Google-Smtp-Source: AJdET5e2fP/t1Qu1zfXBkpc+PbootYxSvNp2FUi3S7keZeteohCfTl2hA/2vrBx+uO25u70WowANVw== X-Received: by 2002:a17:902:443:: with SMTP id 61-v6mr7536198ple.216.1541746071478; Thu, 08 Nov 2018 22:47:51 -0800 (PST) Received: from www9186uo.sakura.ne.jp (www9186uo.sakura.ne.jp. [153.121.56.200]) by smtp.gmail.com with ESMTPSA id c70-v6sm6808355pfg.97.2018.11.08.22.47.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Nov 2018 22:47:50 -0800 (PST) From: Naoya Horiguchi To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Michal Hocko , Andrew Morton , Mike Kravetz , xishi.qiuxishi@alibaba-inc.com, Laurent Dufour Subject: [RFC][PATCH v1 10/11] mm: clear PageHWPoison in memory hotremove Date: Fri, 9 Nov 2018 15:47:14 +0900 Message-Id: <1541746035-13408-11-git-send-email-n-horiguchi@ah.jp.nec.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1541746035-13408-1-git-send-email-n-horiguchi@ah.jp.nec.com> References: <1541746035-13408-1-git-send-email-n-horiguchi@ah.jp.nec.com> 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: X-Virus-Scanned: ClamAV using ClamSMTP One hopeful usecase of memory hotplug is to replace half-broken DIMMs with new ones, so it makes sense to clear hwpoison info at the time of memory hotremove. I hope that this patch covers the topic discussed in https://lkml.org/lkml/2018/1/17/1228 Signed-off-by: Naoya Horiguchi --- mm/page_alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git v4.19-mmotm-2018-10-30-16-08/mm/page_alloc.c v4.19-mmotm-2018-10-30-16-08_patched/mm/page_alloc.c index 970d6ff..27826b3 100644 --- v4.19-mmotm-2018-10-30-16-08/mm/page_alloc.c +++ v4.19-mmotm-2018-10-30-16-08_patched/mm/page_alloc.c @@ -8139,8 +8139,9 @@ __offline_isolated_pages(unsigned long start_pfn, unsigned long end_pfn) * The HWPoisoned page may be not in buddy system, and * page_count() is not 0. */ - if (unlikely(!PageBuddy(page) && PageHWPoison(page))) { + if (unlikely(!PageBuddy(page) && TestClearPageHWPoison(page))) { pfn++; + num_poisoned_pages_dec(); SetPageReserved(page); continue; }