From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_RED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B9DBC433DB for ; Tue, 19 Jan 2021 12:28:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C456F23104 for ; Tue, 19 Jan 2021 12:28:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C456F23104 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 48FE46B01A1; Tue, 19 Jan 2021 07:28:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 468086B01B3; Tue, 19 Jan 2021 07:28:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 37CBE6B01FC; Tue, 19 Jan 2021 07:28:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0002.hostedemail.com [216.40.44.2]) by kanga.kvack.org (Postfix) with ESMTP id 23C4D6B01A1 for ; Tue, 19 Jan 2021 07:28:10 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id DB0653651 for ; Tue, 19 Jan 2021 12:28:09 +0000 (UTC) X-FDA: 77722451898.05.fight08_5f0bea227551 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id B6F3918016C81 for ; Tue, 19 Jan 2021 12:28:09 +0000 (UTC) X-HE-Tag: fight08_5f0bea227551 X-Filterd-Recvd-Size: 5384 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Tue, 19 Jan 2021 12:28:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611059288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AhjCwJFmaF4VoVFL0RJQTcNJ5s76fuD8bDbj/NSCKEs=; b=Tr6h6vtHMVoBg0k5AvN6Q2bBCIkKRqQyLlgc36WoAcwLlFzxGx+typj6pL7WAS+HeAOXmR xrdV+Xtpe1xl3mJ28ttUQptRGoqmGqWGNGyzIwQ3hCTQORKsfgRkkl89+3m/qU6ZZ8bdc3 rStv4nSYjZVQUCutXCKfAwQqZBVg/m8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-81-nrkVVke_PFu7qpYui4RBcQ-1; Tue, 19 Jan 2021 07:28:04 -0500 X-MC-Unique: nrkVVke_PFu7qpYui4RBcQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A7B5B10054FF; Tue, 19 Jan 2021 12:28:01 +0000 (UTC) Received: from [10.36.114.143] (ovpn-114-143.ams2.redhat.com [10.36.114.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1DE255D9F8; Tue, 19 Jan 2021 12:27:53 +0000 (UTC) Subject: Re: [PATCH RFC] virtio-mem: check against memhp_get_pluggable_range() which memory we can hotplug To: Anshuman Khandual , 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 References: <1610975582-12646-1-git-send-email-anshuman.khandual@arm.com> <1610975582-12646-5-git-send-email-anshuman.khandual@arm.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <630a8785-222d-26ed-a57a-ac5b58d7a04d@redhat.com> Date: Tue, 19 Jan 2021 13:27:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. I'll give it a churn on x86-64, where not that much should change. It will be interesting to test with arm64 in such corner cases in the future. Thanks -- Thanks, David / dhildenb