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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26021EB64DD for ; Thu, 6 Jul 2023 09:24:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BB8218D0003; Thu, 6 Jul 2023 05:24:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B68EC8D0001; Thu, 6 Jul 2023 05:24:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A30408D0003; Thu, 6 Jul 2023 05:24:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9625B8D0001 for ; Thu, 6 Jul 2023 05:24:46 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 56D8F1605E5 for ; Thu, 6 Jul 2023 09:24:46 +0000 (UTC) X-FDA: 80980652172.19.FB477A0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf29.hostedemail.com (Postfix) with ESMTP id 0F16C120005 for ; Thu, 6 Jul 2023 09:24:43 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=fybZ71fZ; spf=pass (imf29.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688635484; h=from:from:sender: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:dkim-signature; bh=Rpec4T93wDYZjo7+Z3gbFxMP0yyz1BRaLAaacEc8RdM=; b=zH3AsbksGvwLfaRxaidkOr39gf3I7MlcOazn9N1FCvn/MZcI2RoJUpig4607YamuqawEsc gPCbu/AswD1+GzSAByPtiPs5kThfY3+3V/iW1jon4qkW7+LVye877UGBmmtqOOrB8PWWsf 7zTQApQAOUBOS9CDSKYf9aLtop63Gdc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688635484; a=rsa-sha256; cv=none; b=YlIwLciRZueSn9RdZJJS2pNemjrRr9FYdxSk/HidP/3GIrTzv1Pj4QlV0jDqZr9AbqeV8v qZp/dBH2pWy7ze8wj7Jm7msdPiP0/yqWx05J6IxSsYpt67rNDZ3ElAHIwagWv0/TpY0eMe 8K6JMAtP2sl/s6RmGqpOQdBJBMLUs6k= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=fybZ71fZ; spf=pass (imf29.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688635483; 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=Rpec4T93wDYZjo7+Z3gbFxMP0yyz1BRaLAaacEc8RdM=; b=fybZ71fZuRlyGr5XjZVLQTPNvFMlAIdVmLGtvjbvKrjKupQ6it54LZgOcD88dtUpSNamKn 0qss36NI5Vm6ZYpKHUhzhCLdbwjmolagtE+d/L2nog1TD9iP9Sr2ncfco99Oj5oGb9fHok j2D0IUAu9gXTF7WJqU/G3BBqfPTvNXE= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-49-jYMB092nM8CBJfgnex-Riw-1; Thu, 06 Jul 2023 05:24:41 -0400 X-MC-Unique: jYMB092nM8CBJfgnex-Riw-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-31421c900b7so242861f8f.3 for ; Thu, 06 Jul 2023 02:24:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688635481; x=1691227481; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Rpec4T93wDYZjo7+Z3gbFxMP0yyz1BRaLAaacEc8RdM=; b=ACEolCcg0yyEVjTEWj/0K51aEE3+XJ3CTYHwo9Ffu7IbklnVchze6dPaD1GrEE4xjB ZhZxjYYMTFFozoe0+dLtcxesoEW3DriVykN8lAcMmz+/AQStMsWkMDGmp4K27XDYU+10 xgnXL4qGc1TtwkMrZ2O0flYWgOupMOcdla+HYu3kYAqbsCsfN19iRhECOBojDR3229yb P0xfuZrCDhndMMATTiccZKfIeMdODI2FI6U7Guds9XPmVYvCvGQQUgR480hj5x5KVN6O iAablR10OchA/BFSX39LvPB9xEBe0vnQp8g40MKhKvNhnr+irTmzdQ1f/gBjxXGtI8bn djMQ== X-Gm-Message-State: ABy/qLYbxceznB7zOaTftDDUalbZgOEfHwo4WpNUlXTA86SBMyBnNovt C9cQHTTsMrz8bOv+n3C/WIRpSt5hSztSOGom0zLkV7V0NRfbtM8JWF/Fiut8g4Y0tE/bUNlV5nx kt5lRrBsBogM= X-Received: by 2002:adf:fed1:0:b0:306:2e62:8d2e with SMTP id q17-20020adffed1000000b003062e628d2emr1038221wrs.1.1688635480722; Thu, 06 Jul 2023 02:24:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlF+hkoShQiUt2aK2jbP6BLI4V/XrUGB9ja8pOROo25U1Ew5hgmdJl8cZRK/1s56/OJa/fSdOg== X-Received: by 2002:adf:fed1:0:b0:306:2e62:8d2e with SMTP id q17-20020adffed1000000b003062e628d2emr1038203wrs.1.1688635480418; Thu, 06 Jul 2023 02:24:40 -0700 (PDT) Received: from ?IPV6:2a09:80c0:192:0:5dac:bf3d:c41:c3e7? ([2a09:80c0:192:0:5dac:bf3d:c41:c3e7]) by smtp.gmail.com with ESMTPSA id j7-20020a5d6187000000b00301a351a8d6sm1322911wru.84.2023.07.06.02.24.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Jul 2023 02:24:39 -0700 (PDT) Message-ID: <0efcd10b-dff8-d011-e192-5feaedc2ee2d@redhat.com> Date: Thu, 6 Jul 2023 11:24:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 3/5] mm/hotplug: Simplify the handling of MHP_MEMMAP_ON_MEMORY flag To: "Aneesh Kumar K.V" , linux-mm@kvack.org, akpm@linux-foundation.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, npiggin@gmail.com, christophe.leroy@csgroup.eu Cc: Oscar Salvador , Michal Hocko , Vishal Verma References: <20230706085041.826340-1-aneesh.kumar@linux.ibm.com> <20230706085041.826340-4-aneesh.kumar@linux.ibm.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20230706085041.826340-4-aneesh.kumar@linux.ibm.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0F16C120005 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: zi764zm67ojdnetpk4ykzfbxtz19yug3 X-HE-Tag: 1688635483-778748 X-HE-Meta: U2Fsd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y3hr4BctJCMvNVNgN2drpuHYgJ4Ol0QfbK6SBhmLN13mO/NrV1RcHvSksGpTtkEVjd6izqnGXAQYBCGlZUrgxb6YNMB5rbAdgWxzfe6FJyNEWzMzO9BOm+u3Hwp/ZQFbzLq3w9geVW2HwfcQRytE3poLbotWqhEpnPOljcF81CpTyJGw2kcRouPc4rOX3DX0a4HW023A99cNwa5Bs3Qy49oXnw4YFnM/noOyQbTCqleuKm0XkxBKKSYcQS8qdDkAOpHcMF8E4a824Nsd1wvjhZdupU/0hRGKvrGBFEC5Y3lWCl57tJiuADWXGzufMwr4q3m1VUvf2LMkqgfgd0MTR6wIG6mvdAkelII70qC5CSzuW0JUGxM7xlPsTvAYiznO0fvDAhEaRyc/8Gb 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 06.07.23 10:50, Aneesh Kumar K.V wrote: > Instead of checking for memmap on memory feature enablement within the > functions checking for alignment, use the kernel parameter to control the > memory hotplug flags. The generic kernel now enables memmap on memory > feature if the hotplug flag request for the same. > > The ACPI code now can pass the flag unconditionally because the kernel will > fallback to not using the feature if the alignment rules are not met. > > Signed-off-by: Aneesh Kumar K.V > --- > drivers/acpi/acpi_memhotplug.c | 3 +-- > include/linux/memory_hotplug.h | 14 ++++++++++++++ > mm/memory_hotplug.c | 35 +++++++++++----------------------- > 3 files changed, 26 insertions(+), 26 deletions(-) > > diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c > index 24f662d8bd39..4d0096fc4cc2 100644 > --- a/drivers/acpi/acpi_memhotplug.c > +++ b/drivers/acpi/acpi_memhotplug.c > @@ -211,8 +211,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) > if (!info->length) > continue; > > - if (mhp_supports_memmap_on_memory(info->length)) > - mhp_flags |= MHP_MEMMAP_ON_MEMORY; > + mhp_flags |= get_memmap_on_memory_flags(); > result = __add_memory(mgid, info->start_addr, info->length, > mhp_flags); > > diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h > index a769f44b8368..af7017122506 100644 > --- a/include/linux/memory_hotplug.h > +++ b/include/linux/memory_hotplug.h > @@ -358,4 +358,18 @@ bool mhp_supports_memmap_on_memory(unsigned long size); > bool __mhp_supports_memmap_on_memory(unsigned long size); > #endif /* CONFIG_MEMORY_HOTPLUG */ > > +#ifdef CONFIG_MHP_MEMMAP_ON_MEMORY > +extern bool memmap_on_memory; > +static inline unsigned long get_memmap_on_memory_flags(void) > +{ > + if (memmap_on_memory) > + return MHP_MEMMAP_ON_MEMORY; > + return 0; > +} > +#else > +static inline unsigned long get_memmap_on_memory_flags(void) > +{ > + return 0; > +} > +#endif That's kind-of ugly TBH. Why do we need this change? -- Cheers, David / dhildenb