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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 32AFBC433E0 for ; Fri, 26 Feb 2021 12:06:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7ED7264EE7 for ; Fri, 26 Feb 2021 12:06:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7ED7264EE7 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 0166F6B0005; Fri, 26 Feb 2021 07:06:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F09826B0006; Fri, 26 Feb 2021 07:06:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1FA06B006C; Fri, 26 Feb 2021 07:06:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0192.hostedemail.com [216.40.44.192]) by kanga.kvack.org (Postfix) with ESMTP id CB0BB6B0005 for ; Fri, 26 Feb 2021 07:06:25 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 90F6062CC for ; Fri, 26 Feb 2021 12:06:25 +0000 (UTC) X-FDA: 77860291530.14.A88D750 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf28.hostedemail.com (Postfix) with ESMTP id 2AE8E200039A for ; Fri, 26 Feb 2021 12:06:25 +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 0BE13B02A; Fri, 26 Feb 2021 12:06:24 +0000 (UTC) Date: Fri, 26 Feb 2021 13:06:21 +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 5/7] mm,memory_hotplug: Enforce pageblock alignment when memmap_on_memory Message-ID: <20210226120621.GB3661@localhost.localdomain> References: <20210209133854.17399-1-osalvador@suse.de> <20210209133854.17399-6-osalvador@suse.de> <9fcd9246-8e27-2991-a32f-539d9a430514@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9fcd9246-8e27-2991-a32f-539d9a430514@redhat.com> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 2AE8E200039A X-Stat-Signature: pq439kfe7f6z9y498omenab8bgy4ret4 Received-SPF: none (suse.de>: No applicable sender policy available) receiver=imf28; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1614341185-42543 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:27:33PM +0100, David Hildenbrand wrote: > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > > index d3fb036d33fd..1a4d5dd1a2c8 100644 > > --- a/mm/memory_hotplug.c > > +++ b/mm/memory_hotplug.c > > @@ -56,12 +56,16 @@ static int memmap_on_memory_show(char *buffer, const struct kernel_param *kp) > > static __meminit int memmap_on_memory_store(const char *val, > > const struct kernel_param *kp) > > { > > + unsigned long pageblock_size = PFN_PHYS(pageblock_nr_pages); > > + > > /* > > * 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) || > > - (PMD_SIZE % sizeof(struct page))) > > + (PMD_SIZE % sizeof(struct page)) || > > + !(MIN_MEMORY_BLOCK_SIZE - PMD_SIZE) || > > + !(MIN_MEMORY_BLOCK_SIZE - PMD_SIZE) % pageblock_size) > > return 0; > > return param_set_bool(val, kp); > > > > Dito, rather squash in #1 and add a comment explaining what's happening > there. I was not sure about putting this and the PMD aligned patch as a standalone patch, but I thought it might ease the review. But I have no problem in placing them in patch#1 and put some more detail into the changelog. -- Oscar Salvador SUSE L3