From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx144.postini.com [74.125.245.144]) by kanga.kvack.org (Postfix) with SMTP id 45C046B006E for ; Thu, 13 Dec 2012 21:15:07 -0500 (EST) Message-ID: <50CA8B92.6070001@huawei.com> Date: Fri, 14 Dec 2012 10:14:42 +0800 From: Xishi Qiu MIME-Version: 1.0 Subject: [PATCH V4 0/3 RESEND] MCE: fix an error of mce_bad_pages statistics References: <50C7FB6A.9030209@huawei.com> In-Reply-To: <50C7FB6A.9030209@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Xishi Qiu , WuJianguo , Liujiang , Simon Jeons , Andrew Morton , Borislav Petkov , Andi Kleen , Fengguang Wu , Wanpeng Li , n-horiguchi@ah.jp.nec.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org $ echo paddr > /sys/devices/system/memory/soft_offline_page to offline a *free* page, the value of mce_bad_pages will be added, and the page is set HWPoison flag, but it is still managed by page buddy alocator. $ cat /proc/meminfo | grep HardwareCorrupted shows the value. If we offline the same page, the value of mce_bad_pages will be added *again*, this means the value is incorrect now. Assume the page is still free during this short time. soft_offline_page() get_any_page() "else if (is_free_buddy_page(p))" branch return 0 "goto done"; "atomic_long_add(1, &mce_bad_pages);" Changelog: V4: -use num_poisoned_pages instead of mce_bad_pages -remove page lock V3: -add page lock when set HWPoison flag -adjust the function structure V2 and V1: -fix the error Xishi Qiu (3): move-poisoned-page-check-at-the-beginning-of-the-function fix-function-structure use-num_poisoned_pages-instead-of-mce_bad_pages fs/proc/meminfo.c | 2 +- include/linux/mm.h | 2 +- mm/memory-failure.c | 76 ++++++++++++++++++++++++++------------------------- 3 files changed, 41 insertions(+), 39 deletions(-) . -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756098Ab2LNCP3 (ORCPT ); Thu, 13 Dec 2012 21:15:29 -0500 Received: from szxga01-in.huawei.com ([119.145.14.64]:63799 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755789Ab2LNCPY (ORCPT ); Thu, 13 Dec 2012 21:15:24 -0500 Message-ID: <50CA8B92.6070001@huawei.com> Date: Fri, 14 Dec 2012 10:14:42 +0800 From: Xishi Qiu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Xishi Qiu , WuJianguo , Liujiang , Simon Jeons , Andrew Morton , Borislav Petkov , Andi Kleen , Fengguang Wu , Wanpeng Li , , , Subject: [PATCH V4 0/3 RESEND] MCE: fix an error of mce_bad_pages statistics References: <50C7FB6A.9030209@huawei.com> In-Reply-To: <50C7FB6A.9030209@huawei.com> X-Forwarded-Message-Id: <50C7FB6A.9030209@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.135.74.196] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org $ echo paddr > /sys/devices/system/memory/soft_offline_page to offline a *free* page, the value of mce_bad_pages will be added, and the page is set HWPoison flag, but it is still managed by page buddy alocator. $ cat /proc/meminfo | grep HardwareCorrupted shows the value. If we offline the same page, the value of mce_bad_pages will be added *again*, this means the value is incorrect now. Assume the page is still free during this short time. soft_offline_page() get_any_page() "else if (is_free_buddy_page(p))" branch return 0 "goto done"; "atomic_long_add(1, &mce_bad_pages);" Changelog: V4: -use num_poisoned_pages instead of mce_bad_pages -remove page lock V3: -add page lock when set HWPoison flag -adjust the function structure V2 and V1: -fix the error Xishi Qiu (3): move-poisoned-page-check-at-the-beginning-of-the-function fix-function-structure use-num_poisoned_pages-instead-of-mce_bad_pages fs/proc/meminfo.c | 2 +- include/linux/mm.h | 2 +- mm/memory-failure.c | 76 ++++++++++++++++++++++++++------------------------- 3 files changed, 41 insertions(+), 39 deletions(-) .