From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751445AbdBOAZU (ORCPT ); Tue, 14 Feb 2017 19:25:20 -0500 Received: from mgwym01.jp.fujitsu.com ([211.128.242.40]:47414 "EHLO mgwym01.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751241AbdBOAZT (ORCPT ); Tue, 14 Feb 2017 19:25:19 -0500 X-SecurityPolicyCheck: OK by SHieldMailChecker v2.5.2 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20161115-1 X-SHieldMailCheckerMailID: 8cb7d1a312174856bc0a20b68ea339b8 Date: Wed, 15 Feb 2017 09:24:47 +0900 From: Masayoshi Mizuma To: Dan Williams Subject: Re: [PATCH 0/2] fix devm_memremap_pages() mem hotplug locking Cc: Andrew Morton , Michal Hocko , "linux-nvdimm@lists.01.org" , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Ben Hutchings , "Vlastimil Babka" In-Reply-To: References: <58A10B25.6030508@jp.fujitsu.com> Message-Id: <20170215092435.7EC0.61FB500B@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.73 [ja] X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 12 Feb 2017 17:35:00 -0800 Dan Williams wrote: > On Sun, Feb 12, 2017 at 5:25 PM, Masayoshi Mizuma > wrote: > > Hi Dan, > > > > On Sun, 12 Feb 2017 14:34:11 -0800 Dan Williams wrote: > >> > >> Ben notes that commit f931ab479dd2 "mm: fix devm_memremap_pages crash, > >> use mem_hotplug_{begin, done}" is incomplete and broken. Writes to > >> mem_hotplug.active_writer need to be coordinated under the device > >> hotplug lock. Otherwise, we can potentially corrupt mem_hotplug.refcount > >> leading to soft lockups. > > > > > > I think mem_hotplug_{begin,done} is not suitable to exclude > > devm_memremap_pages() > > because it seems that memory hotplug is not related to this context. > > How about using pgmap_lock instead? > > The problem with that switch is the race in > kernel_physical_mapping_init(), see commit f931ab479dd2. As far as I > can see we need all paths that call kernel_physical_mapping_init() to > agree on the same lock, and can't use a private lock in > devm_memremap_pages(). I understand. Thanks. --- Masayoshi Mizuma