Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752116AbdFUUat convert rfc822-to-8bit (ORCPT ); Wed, 21 Jun 2017 16:30:49 -0400 Received: from mga05.intel.com ([192.55.52.43]:18843 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751041AbdFUUas (ORCPT ); Wed, 21 Jun 2017 16:30:48 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,370,1493708400"; d="scan'208";a="100234507" From: "Luck, Tony" To: "Elliott, Robert (Persistent Memory)" , Naoya Horiguchi CC: Borislav Petkov , "Hansen, Dave" , "x86@kernel.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "linux-nvdimm@lists.01.org" , "Williams, Dan J" , "Kani, Toshimitsu" , "Vaden, Tom (HPE Server OS Architecture)" Subject: RE: [PATCH] mm/hwpoison: Clear PRESENT bit for kernel 1:1 mappings of poison pages Thread-Topic: [PATCH] mm/hwpoison: Clear PRESENT bit for kernel 1:1 mappings of poison pages Thread-Index: AQHS5tyGLdf2jBRppESVUPAeACzObaIvD0eAgACRvICAAJUsgP//k6HA Date: Wed, 21 Jun 2017 20:30:46 +0000 Message-ID: <3908561D78D1C84285E8C5FCA982C28F612DCCAF@ORSMSX114.amr.corp.intel.com> References: <20170616190200.6210-1-tony.luck@intel.com> <20170621021226.GA18024@hori1.linux.bs1.fc.nec.co.jp> <20170621175403.n5kssz32e2oizl7k@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.22.254.139] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1037 Lines: 27 > Persistent memory does have unpoisoning and would require this inverse > operation - see drivers/nvdimm/pmem.c pmem_clear_poison() and core.c > nvdimm_clear_poison(). Nice. Well this code will need to cooperate with that ... in particular if the page is in an area that can be unpoisoned ... then we should do that *instead* of marking the page not present (which breaks up huge/large pages and so affects performance). Instead of calling it "arch_unmap_pfn" it could be called something like arch_handle_poison() and do something like: void arch_handle_poison(unsigned long pfn) { if this is a pmem page && pmem_clear_poison(pfn) return if this is a nvdimm page && nvdimm_clear_poison(pfn) return /* can't clear, map out from 1:1 region */ ... code from my patch ... } I'm just not sure how those first two "if" bits work ... particularly in terms of CONFIG dependencies and system capabilities. Perhaps each of pmem and nvdimm could register their unpoison functions and this code could just call each in turn? -Tony