Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9411457imu; Wed, 5 Dec 2018 04:30:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/V/y1dmjbF9s6pdYGwOTTTL2sRlxblfVx7HWpqwPUB/0o1fD4N6ljVK4nhJixVKU8S1f0x/ X-Received: by 2002:a63:ee4c:: with SMTP id n12mr19683596pgk.21.1544013056776; Wed, 05 Dec 2018 04:30:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544013056; cv=none; d=google.com; s=arc-20160816; b=qyBwnLlofu5ST7PbXD2xYUKQiiR2G/KSfyIH4b/FHNegSmG6hQB55zdM7gFLh1v/Ah XNZ+a6gjqB2SS4hNNdsCO3avn45iyzGJFFVi86hJmU2YnzuFAoLC/wEAdhCJ9u7pXCA0 aQsBz5QoRif+5QT0/qve/9+6KefG5SKUEIexG16bzXFs3aV4YO+JA2dPuHGu9g6Pvl13 6AkYp9R60saQsXpMtFPS+Zd29z4ZvTd6QRoNVvmEn0xozZlJHU/iHitW2bI6/QN+YgR4 PTPSz5ZYIiG/R/nzEC+CWFnyK/MVj3Tq9HXNGRAiZ1jeyWUjl9Ql84KSvZURn3bTEQPZ 8+8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=boWnavxaqnQMDXg4rprOuhgoDS66PC2v9nYXsf1nEXM=; b=H257/ZrkfjV+YyfSNfGwrkm06ItVs0W8PrNb9ZU4tHjhGwNay4BjtzCbIyUnHkxhpl toSINdWQk4ADTsFHkMduJRvtTzKm7A7PD8ApZqw760br94fJrluPyZ1MSKFti7ZsamVK YBleKeBjPXA5YeCOR4PbWzGy1l4Ucmmn1tKECsbNJI2FnOV8p0oQHJQuz7GgKMXZtLps B2pK73768smfB5RlCzUf4/ibjoB5W2S4DgpKhGMehP3DsIaacF/Mz1wrUUfp7/DWmNmD AEgm0372YgXlUzc+SckK7LTu/ti+qX4LJ6VJzwZV7w8+QEX9R5073jmUa3teF3aK2FAj Xsdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s5si20335662pfi.134.2018.12.05.04.30.40; Wed, 05 Dec 2018 04:30:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727852AbeLEM3W (ORCPT + 99 others); Wed, 5 Dec 2018 07:29:22 -0500 Received: from mx2.suse.de ([195.135.220.15]:48608 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727138AbeLEM3W (ORCPT ); Wed, 5 Dec 2018 07:29:22 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 10752ADA9; Wed, 5 Dec 2018 12:29:20 +0000 (UTC) Date: Wed, 5 Dec 2018 13:29:18 +0100 From: Michal Hocko To: Naoya Horiguchi , Oscar Salvador Cc: Andrew Morton , Dan Williams , Pavel Tatashin , linux-mm@kvack.org, LKML , Stable tree Subject: Re: [RFC PATCH] hwpoison, memory_hotplug: allow hwpoisoned pages to be offlined Message-ID: <20181205122918.GL1286@dhcp22.suse.cz> References: <20181203100309.14784-1-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181203100309.14784-1-mhocko@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 03-12-18 11:03:09, Michal Hocko wrote: > From: Michal Hocko > > We have received a bug report that an injected MCE about faulty memory > prevents memory offline to succeed. The underlying reason is that the > HWPoison page has an elevated reference count and the migration keeps > failing. There are two problems with that. First of all it is dubious > to migrate the poisoned page because we know that accessing that memory > is possible to fail. Secondly it doesn't make any sense to migrate a > potentially broken content and preserve the memory corruption over to a > new location. > > Oscar has found out that it is the elevated reference count from > memory_failure that is confusing the offlining path. HWPoisoned pages > are isolated from the LRU list but __offline_pages might still try to > migrate them if there is any preceding migrateable pages in the pfn > range. Such a migration would fail due to the reference count but > the migration code would put it back on the LRU list. This is quite > wrong in itself but it would also make scan_movable_pages stumble over > it again without any way out. > > This means that the hotremove with hwpoisoned pages has never really > worked (without a luck). HWPoisoning really needs a larger surgery > but an immediate and backportable fix is to skip over these pages during > offlining. Even if they are still mapped for some reason then > try_to_unmap should turn those mappings into hwpoison ptes and cause > SIGBUS on access. Nobody should be really touching the content of the > page so it should be safe to ignore them even when there is a pending > reference count. After some more thinking I am not really sure the above reasoning is still true with the current upstream kernel. Maybe I just managed to confuse myself so please hold off on this patch for now. Testing by Oscar has shown this patch is helping but the changelog might need to be updated. -- Michal Hocko SUSE Labs