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=-18.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 DEA94C64E7C for ; Wed, 2 Dec 2020 09:37:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4261F2222A for ; Wed, 2 Dec 2020 09:37:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4261F2222A 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 9D2396B005D; Wed, 2 Dec 2020 04:37:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A8986B0068; Wed, 2 Dec 2020 04:37:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 872498D0001; Wed, 2 Dec 2020 04:37:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0237.hostedemail.com [216.40.44.237]) by kanga.kvack.org (Postfix) with ESMTP id 705596B005D for ; Wed, 2 Dec 2020 04:37:30 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 34C83E0AF for ; Wed, 2 Dec 2020 09:37:30 +0000 (UTC) X-FDA: 77547839460.08.laugh55_040db5c273b2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 12F271819E798 for ; Wed, 2 Dec 2020 09:37:30 +0000 (UTC) X-HE-Tag: laugh55_040db5c273b2 X-Filterd-Recvd-Size: 4996 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Wed, 2 Dec 2020 09:37:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606901848; 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=TCvOXO+6rI+WpobdR0grh6RzWowZrpkVEaa00biUVXU=; b=QIdsgCaJSHEEhceXtowPfB0JynrKPPBPMhXbZPhLYBHMiGXdcpwpkou2U4uQGDwAciM7qb YaXPK/UeNhRrqbPvEoTlYVtUB47vMTtYXaDzvx6RdkX0FdPBt5j99z0ED59u4PG/WXhmYS eUJz1rrMukyGOKOlLf9FuxFQYCjg6Yg= 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-290-aB0pClpFO1KrIdKZsaEGcQ-1; Wed, 02 Dec 2020 04:37:27 -0500 X-MC-Unique: aB0pClpFO1KrIdKZsaEGcQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BDCE4100A651; Wed, 2 Dec 2020 09:37:25 +0000 (UTC) Received: from [10.36.113.108] (ovpn-113-108.ams2.redhat.com [10.36.113.108]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8662D6085A; Wed, 2 Dec 2020 09:37:24 +0000 (UTC) Subject: Re: [RFC PATCH v3 3/4] mm,memory_hotplug: Enable MHP_MEMMAP_ON_MEMORY when supported To: Oscar Salvador Cc: mhocko@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, vbabka@suse.cz, pasha.tatashin@soleen.com References: <20201201115158.22638-1-osalvador@suse.de> <20201201115158.22638-4-osalvador@suse.de> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Wed, 2 Dec 2020 10:37:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201201115158.22638-4-osalvador@suse.de> 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.13 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 01.12.20 12:51, Oscar Salvador wrote: > Let the callers check whether they can use MHP_MEMMAP_ON_MEMORY by > checking mhp_supports_memmap_on_memory(). > Currently, we only support MHP_MEMMAP_ON_MEMORY in case > CONFIG_SPARSEMEM_VMEMMAP is enabled, the architecture supports altmap, > and the range to be added spans a single memory block. > > Signed-off-by: Oscar Salvador > --- > arch/powerpc/platforms/pseries/hotplug-memory.c | 5 ++++- > drivers/acpi/acpi_memhotplug.c | 5 ++++- > 2 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c > index 7efe6ec5d14a..3aba817e729e 100644 > --- a/arch/powerpc/platforms/pseries/hotplug-memory.c > +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c > @@ -612,6 +612,7 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) > { > unsigned long block_sz; > int nid, rc; > + mhp_t mhp_flags = MHP_NONE; > > if (lmb->flags & DRCONF_MEM_ASSIGNED) > return -EINVAL; > @@ -629,8 +630,10 @@ static int dlpar_add_lmb(struct drmem_lmb *lmb) > if (nid < 0 || !node_possible(nid)) > nid = first_online_node; > > + if (mhp_supports_memmap_on_memory(block_sz)) > + mhp_flags |= MHP_MEMMAP_ON_MEMORY; > /* Add the memory */ > - rc = __add_memory(nid, lmb->base_addr, block_sz, MHP_NONE); > + rc = __add_memory(nid, lmb->base_addr, block_sz, mhp_flags); > if (rc) { > invalidate_lmb_associativity_index(lmb); > return rc; > diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c > index b02fd51e5589..1fe645ef0b6c 100644 > --- a/drivers/acpi/acpi_memhotplug.c > +++ b/drivers/acpi/acpi_memhotplug.c > @@ -172,6 +172,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) > int result, num_enabled = 0; > struct acpi_memory_info *info; > int node; > + mhp_t mhp_flags = MHP_NONE; > > node = acpi_get_node(handle); > /* > @@ -194,8 +195,10 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) > if (node < 0) > node = memory_add_physaddr_to_nid(info->start_addr); > > + if (mhp_supports_memmap_on_memory(info->length)) > + mhp_flags |= MHP_MEMMAP_ON_MEMORY; > result = __add_memory(node, info->start_addr, info->length, > - MHP_NONE); > + mhp_flags); > > /* > * If the memory block has been used by the kernel, add_memory() > Please split that patch into two parts, one for each subsystem. -- Thanks, David / dhildenb