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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 8C104C433E0 for ; Fri, 26 Feb 2021 12:14:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 05DD564F03 for ; Fri, 26 Feb 2021 12:14:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05DD564F03 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 77AB46B0072; Fri, 26 Feb 2021 07:14:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 72C2D8D0001; Fri, 26 Feb 2021 07:14:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 641116B0074; Fri, 26 Feb 2021 07:14:44 -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 4C06B6B0072 for ; Fri, 26 Feb 2021 07:14:44 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0E4E418045C0A for ; Fri, 26 Feb 2021 12:14:44 +0000 (UTC) X-FDA: 77860312488.03.EB4EFF5 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf14.hostedemail.com (Postfix) with ESMTP id 83BBBC0007D1 for ; Fri, 26 Feb 2021 12:14:35 +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 54D3BAFE5; Fri, 26 Feb 2021 12:14:42 +0000 (UTC) Date: Fri, 26 Feb 2021 13:14:40 +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 3/7] mm,memory_hotplug: Add kernel boot option to enable memmap_on_memory Message-ID: <20210226121440.GE3661@localhost.localdomain> References: <20210209133854.17399-1-osalvador@suse.de> <20210209133854.17399-4-osalvador@suse.de> <02041ab3-dcbd-9056-5571-48b84f527e42@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <02041ab3-dcbd-9056-5571-48b84f527e42@redhat.com> X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 83BBBC0007D1 X-Stat-Signature: yfbiy7q6e6yejjkyz4xjyp7eya14dazu Received-SPF: none (suse.de>: No applicable sender policy available) receiver=imf14; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1614341675-916918 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:25:58PM +0100, David Hildenbrand wrote: > > +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. > > + * User can always check whether it is enabled or not via /sys/module. > > + */ > > + if (!IS_ENABLED(CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE)) > > + return 0; > > + > > + return param_set_bool(val, kp); > > +} > > +module_param_call(memmap_on_memory, memmap_on_memory_store, > > + memmap_on_memory_show, &memmap_on_memory_enabled, 0400); > > Why are other users not allowed to read? I copied it from the shuffle one. I guess shuffle code made it 0400 for security reasons. Since we do not need that here, I will switch it to 0444. > Might want to add a MODULE_PARM_DESC(). Sure > As we fail silently already, I'd keep it simple and use a > > module_param(memmap_on_memory, bool, 0444); > > moving the IS_ENABLED(CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE) into the > runtime check. You mean moving this check into mhp_supports_memmap_on_memory() check from patch#1 right? Makes sense. -- Oscar Salvador SUSE L3