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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 DF5E9C433DB for ; Mon, 1 Mar 2021 10:06:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 72B4F64E37 for ; Mon, 1 Mar 2021 10:06:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72B4F64E37 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 00CAA8D005B; Mon, 1 Mar 2021 05:06:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EDA008D0019; Mon, 1 Mar 2021 05:06:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA0998D005B; Mon, 1 Mar 2021 05:06:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0140.hostedemail.com [216.40.44.140]) by kanga.kvack.org (Postfix) with ESMTP id BCB308D0019 for ; Mon, 1 Mar 2021 05:06:49 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7F9598249980 for ; Mon, 1 Mar 2021 10:06:49 +0000 (UTC) X-FDA: 77870876538.24.58BE0D2 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf08.hostedemail.com (Postfix) with ESMTP id 73DEF80192E8 for ; Mon, 1 Mar 2021 10:06:34 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A1EDEADE5; Mon, 1 Mar 2021 10:06:47 +0000 (UTC) Date: Mon, 1 Mar 2021 11:06:45 +0100 From: Oscar Salvador To: David Hildenbrand Cc: Andrew Morton , Michal Hocko , VlastimilBabkavbabka@suse.cz, pasha.tatashin@soleen.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Anshuman Khandual Subject: Re: [PATCH v2 4/7] mm,memory_hotplug: Enforce struct page size to be multiple of PMD Message-ID: <20210301100640.GA32425@linux> References: <20210209133854.17399-1-osalvador@suse.de> <20210209133854.17399-5-osalvador@suse.de> <13253f19-d0e9-e27c-046a-c2669c5ee33d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <13253f19-d0e9-e27c-046a-c2669c5ee33d@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 73DEF80192E8 X-Stat-Signature: uf3yt77acb9jgid1was6bhu33iozqctr Received-SPF: none (suse.de>: No applicable sender policy available) receiver=imf08; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1614593194-458096 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 Thu, Feb 25, 2021 at 07:26:50PM +0100, David Hildenbrand wrote: > On 09.02.21 14:38, Oscar Salvador wrote: > > When struct page's size is not multiple of PMD, these do not get > > fully populated when adding sections, hence two sections will > > intersect the same the PMD. This goes against the vmemmap-per-device > > premise, so reject it if that is the case. > > > > Signed-off-by: Oscar Salvador > > --- > > mm/memory_hotplug.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > > index 95695483a622..d3fb036d33fd 100644 > > --- a/mm/memory_hotplug.c > > +++ b/mm/memory_hotplug.c > > @@ -57,10 +57,11 @@ static __meminit int memmap_on_memory_store(const char *val, > > const struct kernel_param *kp) > > { > > /* > > - * Fail silently in case we cannot enable it due to platform constraints. > > + * Fail silently in case we cannot enable it due to system constraints. > > * User can always check whether it is enabled or not via /sys/module. > > */ > > - if (!IS_ENABLED(CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE)) > > + if (!IS_ENABLED(CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE) || > > + (PMD_SIZE % sizeof(struct page))) > > return 0; > > return param_set_bool(val, kp); > > > > Squash that into #1 - it's part of basic operation. Just to be sure we are on the same page. You mean to move this patch and patch#5 into the runtime check in mhp_supports_memmap_on_memory(), right? -- Oscar Salvador SUSE L3