Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422915AbdD0Uve (ORCPT ); Thu, 27 Apr 2017 16:51:34 -0400 Received: from mga09.intel.com ([134.134.136.24]:22532 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422860AbdD0UvY (ORCPT ); Thu, 27 Apr 2017 16:51:24 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,385,1488873600"; d="scan'208";a="81536703" From: Andi Kleen To: Michal Hocko Cc: Laurent Dufour , Naoya Horiguchi , linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org Subject: Re: [PATCH v2 1/2] mm: Uncharge poisoned pages References: <1493130472-22843-1-git-send-email-ldufour@linux.vnet.ibm.com> <1493130472-22843-2-git-send-email-ldufour@linux.vnet.ibm.com> <20170427143721.GK4706@dhcp22.suse.cz> Date: Thu, 27 Apr 2017 13:51:23 -0700 In-Reply-To: <20170427143721.GK4706@dhcp22.suse.cz> (Michal Hocko's message of "Thu, 27 Apr 2017 16:37:21 +0200") Message-ID: <87pofxk20k.fsf@firstfloor.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 903 Lines: 24 Michal Hocko writes: > On Tue 25-04-17 16:27:51, Laurent Dufour wrote: >> When page are poisoned, they should be uncharged from the root memory >> cgroup. >> >> This is required to avoid a BUG raised when the page is onlined back: >> BUG: Bad page state in process mem-on-off-test pfn:7ae3b >> page:f000000001eb8ec0 count:0 mapcount:0 mapping: (null) >> index:0x1 >> flags: 0x3ffff800200000(hwpoison) > > My knowledge of memory poisoning is very rudimentary but aren't those > pages supposed to leak and never come back? In other words isn't the > hoplug code broken because it should leave them alone? Yes that would be the right interpretation. If it was really offlined due to a hardware error the memory will be poisoned and any access could cause a machine check. hwpoison has an own "unpoison" option (only used for debugging), which I think handles this. -Andi