From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com ([217.140.110.172]:55122 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726492AbhAVDdZ (ORCPT ); Thu, 21 Jan 2021 22:33:25 -0500 Subject: Re: [PATCH RFC] virtio-mem: check against memhp_get_pluggable_range() which memory we can hotplug References: <1610975582-12646-1-git-send-email-anshuman.khandual@arm.com> <1610975582-12646-5-git-send-email-anshuman.khandual@arm.com> <36a10a6f-a2c7-b108-5054-5e4f3e1a1daf@redhat.com> From: Anshuman Khandual Message-ID: <99c20d27-b759-73b3-c8a0-68365a3ef943@arm.com> Date: Fri, 22 Jan 2021 09:02:51 +0530 MIME-Version: 1.0 In-Reply-To: <36a10a6f-a2c7-b108-5054-5e4f3e1a1daf@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-ID: To: David Hildenbrand , linux-mm@kvack.org, akpm@linux-foundation.org, hca@linux.ibm.com, catalin.marinas@arm.com Cc: Oscar Salvador , Vasily Gorbik , Will Deacon , Ard Biesheuvel , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, "Michael S. Tsirkin" , Jason Wang , Pankaj Gupta , Michal Hocko , Wei Yang , teawater , Pankaj Gupta , Jonathan Cameron On 1/21/21 3:27 PM, David Hildenbrand wrote: > On 18.01.21 14:21, Anshuman Khandual wrote: >> >> >> On 1/18/21 6:43 PM, Anshuman Khandual wrote: >>> From: David Hildenbrand >>> >>> Right now, we only check against MAX_PHYSMEM_BITS - but turns out there >>> are more restrictions of which memory we can actually hotplug, especially >>> om arm64 or s390x once we support them: we might receive something like >>> -E2BIG or -ERANGE from add_memory_driver_managed(), stopping device >>> operation. >>> >>> So, check right when initializing the device which memory we can add, >>> warning the user. Try only adding actually pluggable ranges: in the worst >>> case, no memory provided by our device is pluggable. >>> >>> In the usual case, we expect all device memory to be pluggable, and in >>> corner cases only some memory at the end of the device-managed memory >>> region to not be pluggable. >>> >>> Cc: "Michael S. Tsirkin" >>> Cc: Jason Wang >>> Cc: Pankaj Gupta >>> Cc: Michal Hocko >>> Cc: Oscar Salvador >>> Cc: Wei Yang >>> Cc: Andrew Morton >>> Cc: catalin.marinas@arm.com >>> Cc: teawater >>> Cc: Anshuman Khandual >>> Cc: Pankaj Gupta >>> Cc: Jonathan Cameron >>> Cc: hca@linux.ibm.com >>> Cc: Vasily Gorbik >>> Cc: Will Deacon >>> Cc: Ard Biesheuvel >>> Cc: Mark Rutland >>> Cc: Heiko Carstens >>> Cc: Michal Hocko >>> Signed-off-by: David Hildenbrand >>> Signed-off-by: Anshuman Khandual >> >> Hello David, >> >> As your original patch was in the RFC state, I have just maintained >> the same here as well. But once you test this patch along with the >> new series, please do let me know if this needs to be converted to >> a normal PATCH instead. Thank you. > > Yes, you can drop the RFC part. I assume you'll send another revision, > I'll do another test there, thanks! Sure, will drop the RFC in next version.