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=-5.7 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 4B44BC47083 for ; Wed, 2 Jun 2021 12:09:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 066E7613BA for ; Wed, 2 Jun 2021 12:09:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 066E7613BA 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 69BE26B006C; Wed, 2 Jun 2021 08:09:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 64C476B006E; Wed, 2 Jun 2021 08:09:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4C5666B0070; Wed, 2 Jun 2021 08:09:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0240.hostedemail.com [216.40.44.240]) by kanga.kvack.org (Postfix) with ESMTP id 171656B006C for ; Wed, 2 Jun 2021 08:09:04 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A22C08249980 for ; Wed, 2 Jun 2021 12:09:03 +0000 (UTC) X-FDA: 78208662966.20.CA62449 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf05.hostedemail.com (Postfix) with ESMTP id 1B7E7E000240 for ; Wed, 2 Jun 2021 12:08:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622635742; 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=Nb53P46lpq0QHGo0Ib5PtqvuzN+E2xnIwefsTEFefR4=; b=YVEnaN7pz5MIcgoQ42l7Z+rpRf8UdFrdrrg3jJ1zqJixPRRZ26lYgH/4PenyLXL7DFrYi6 08IiWhTZfuZ/nJcz7oQ35ufsomGxFHmFaw7bdybx5V9Vs0iuuilDajlCd4GdnCzSjFKBw8 n79S6/fl2UNKYt4l3w7iy06SjE3SCg4= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-21-QhoVmoW3Myqgrqsck_7FAg-1; Wed, 02 Jun 2021 08:09:01 -0400 X-MC-Unique: QhoVmoW3Myqgrqsck_7FAg-1 Received: by mail-wr1-f69.google.com with SMTP id f22-20020a5d58f60000b029011634e39889so928655wrd.7 for ; Wed, 02 Jun 2021 05:09:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Nb53P46lpq0QHGo0Ib5PtqvuzN+E2xnIwefsTEFefR4=; b=PJhViCYYJBxS3II97Bd4aL3M6U9ozGRZ3cfg3mNlGzNtfVRxlvo01a0KmkAJ6zXt7w G86pEZwRTWvxYWdTG6aTGd+Hbzs+A1GBFmm04aUPki1/tdKXbUVha2Owu2acVlXt9uNp qbhOyT+xoC0/gMoLfPI27KTki2Iq8rQaON4JPrPJTfrLhjZ2LObqfYmQ+2jv52Hp85Xd WkAvHYonUWQv8zNmjww4+oPllpop0We36izbn1sEM3M+HQBgHYgjTv0s6tD4iXmgX/ak 6S3AKZvej5uDINcWt25L7Lx1SuVDPQyUtoTosb8nq6f8rKrYT2FHZKF4LCPodJdJS20F ZKGA== X-Gm-Message-State: AOAM533w3Ho9DgRz/rEKHu1J6nRedTD6168yaEkHTJbrGNwHPv6yTQMj H0apsMg0ecjT70VPT/rUUHIXOGVsTvHFKt8UBOHYWUc10yNjCmbSnafAULQM359s0EPCM8bfkXd GUQ57QfWP66U= X-Received: by 2002:adf:d234:: with SMTP id k20mr33218116wrh.82.1622635740177; Wed, 02 Jun 2021 05:09:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw58MA37jWfpzppDICXUB5EciUs4Xfx1MQed0fuQQQTrtlSOtPVp01wAzA/eKdOSmZhmGEK2A== X-Received: by 2002:adf:d234:: with SMTP id k20mr33218076wrh.82.1622635739813; Wed, 02 Jun 2021 05:08:59 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6b6d.dip0.t-ipconnect.de. [91.12.107.109]) by smtp.gmail.com with ESMTPSA id n10sm7466284wre.95.2021.06.02.05.08.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Jun 2021 05:08:59 -0700 (PDT) To: Max Gurtovoy , linux-nvme@lists.infradead.org, dan.j.williams@intel.com, logang@deltatee.com, linux-mm@kvack.org, hch@lst.de Cc: sagi@grimberg.me, oren@nvidia.com, linux-kernel@vger.kernel.org, akpm@linux-foundation.org References: <20210602111055.10480-1-mgurtovoy@nvidia.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [RFC PATCH 0/3] PCI/P2PMEM: introduce pci_p2pdma_align_size API Message-ID: <4bbb0934-384a-533f-b964-6b3695719b25@redhat.com> Date: Wed, 2 Jun 2021 14:08:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210602111055.10480-1-mgurtovoy@nvidia.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YVEnaN7p; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf05.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com X-Stat-Signature: fqmmmsqj7or6p7zibs5y9eoio167s41u X-Rspamd-Queue-Id: 1B7E7E000240 X-Rspamd-Server: rspam02 X-HE-Tag: 1622635725-72888 Content-Transfer-Encoding: quoted-printable 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 02.06.21 13:10, Max Gurtovoy wrote: > Hi all, > In hotplugged memory (from check_pfn_span function): > " > Disallow all operations smaller than a sub-section and only > allow operations smaller than a section for > SPARSEMEM_VMEMMAP. Note that check_hotplug_memory_range() > enforces a larger memory_block_size_bytes() granularity for > memory that will be marked online, so this check should only > fire for direct arch_{add,remove}_memory() users outside of > add_memory_resource() > " >=20 > This restriction will disqualify, for example, large NVMe CMBs that mig= ht have > non power of 2 number of pages (e.g. 32767 pages of 4KB). For these > devices, the CMB size will be rounded down from 0x7fff000 to 0x7e00000 > but it's better than having un-mapped CMB. Just some high-level questions: A CMB is just a PCI BAR used for communicating with the device, to be=20 mapped into physical address space, right? I assume the relevant hotplug=20 code is: drivers/pci/p2pdma.c: addr =3D devm_memremap_pages(&pdev->dev, pgmap); correct? Having a BAR span such weird sizes will most probably never be fully=20 supported. But if sub-sections work for you, great. --=20 Thanks, David / dhildenb