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=-17.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 AE706C433E0 for ; Thu, 25 Feb 2021 18:27:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2F53564F21 for ; Thu, 25 Feb 2021 18:27:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F53564F21 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 8F4636B0005; Thu, 25 Feb 2021 13:27:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 87D736B0006; Thu, 25 Feb 2021 13:27:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 745F06B006C; Thu, 25 Feb 2021 13:27:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id 5A04F6B0005 for ; Thu, 25 Feb 2021 13:27:17 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 26368824556B for ; Thu, 25 Feb 2021 18:27:17 +0000 (UTC) X-FDA: 77857622514.04.B73C5D3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf24.hostedemail.com (Postfix) with ESMTP id D5303A000604 for ; Thu, 25 Feb 2021 18:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614277636; 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=aHNWIARkC6eM+jOggwpt1Qmt6zGyG+5uENA/0Jk/MHI=; b=IPYWx8Jh4HbbaU305LNp2nbVu6CUL4VMKI+ywF+JRQQKRI6UpdQBjPsKwhOBsJkqHBMwbj C6QCj+rYUYtka9nlMvGcE/PEMLlosFbmofNIm3ZsLSukYwaQXGizYvITlvPBHRRRHcW7WP zRtUhZfAXkrcIGLMiP5Sq4zj1/t81ew= 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-471-WGxbVyCePlKKVWVaZ-zzew-1; Thu, 25 Feb 2021 13:27:07 -0500 X-MC-Unique: WGxbVyCePlKKVWVaZ-zzew-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8D5D3809AC7; Thu, 25 Feb 2021 18:26:53 +0000 (UTC) Received: from [10.36.114.58] (ovpn-114-58.ams2.redhat.com [10.36.114.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A9907A39C; Thu, 25 Feb 2021 18:26:51 +0000 (UTC) Subject: Re: [PATCH v2 4/7] mm,memory_hotplug: Enforce struct page size to be multiple of PMD To: Oscar Salvador , Andrew Morton Cc: Michal Hocko , VlastimilBabkavbabka@suse.cz, pasha.tatashin@soleen.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Anshuman Khandual References: <20210209133854.17399-1-osalvador@suse.de> <20210209133854.17399-5-osalvador@suse.de> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <13253f19-d0e9-e27c-046a-c2669c5ee33d@redhat.com> Date: Thu, 25 Feb 2021 19:26:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210209133854.17399-5-osalvador@suse.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Stat-Signature: wtz56ufjo9zc1pxp66kk4k8wogga8wk3 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: D5303A000604 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf24; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614277630-657588 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 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. -- Thanks, David / dhildenb