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.5 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,USER_AGENT_SANE_1 autolearn=unavailable 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 8FA3EC48BE0 for ; Wed, 9 Jun 2021 10:55:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7946C61287 for ; Wed, 9 Jun 2021 10:55:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238448AbhFIK5I (ORCPT ); Wed, 9 Jun 2021 06:57:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:39653 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238454AbhFIK5G (ORCPT ); Wed, 9 Jun 2021 06:57:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623236110; 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=benEkoYiyJABYdMW95hQGiXtSU/C1XePwCmkHhtvx1g=; b=PaNnjs6ibUg2dwjRwpZK3wVXVNgdJHJo6Ls5EGV6lHp3DQ9yO5eOStmU5wCgwGweoio8QG CJQaEbBRek6Ew6+zPEVH9PpFrqaz9dmXafmSuP8+e3qLB4csy0S8Bj48mBLaQnj5JjIfVE T6lD5VDbMtCrSW04O05+VWQYQ48tDIQ= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-164-ZHSuqmoeMk-MtHNNWbOLeg-1; Wed, 09 Jun 2021 06:55:09 -0400 X-MC-Unique: ZHSuqmoeMk-MtHNNWbOLeg-1 Received: by mail-wr1-f72.google.com with SMTP id n4-20020a5d42040000b0290119fef97609so760552wrq.18 for ; Wed, 09 Jun 2021 03:55:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=benEkoYiyJABYdMW95hQGiXtSU/C1XePwCmkHhtvx1g=; b=ADW3nCeRSlkpomzTRvCgkuesevN3AOdjHzktBzHYferlhkI/kJ/Rguj7F/0HTKOKzn D6Ss7p7xvpK9pHzJz0ATVTKD3FwYZGWomDhPyPEPz23n9O1gwEVN8vSFXQwUEgS1nTVt 2S6UFozAUcEMaq40TCKRawZkgCy0CGLQB6bSe5Y7FTD8labUk7csrHmoBr3BCxVV+sQX 0i+kIUNqKFnfivUrcXM/iq3gWbNssF3d7DJf4MgNR3NfvZkh2uV756Ug2XY4GitsyloG 0rk5jBUoE5xPoVNL+WyL7vhF4n18/iqq3D4E1mgzc4M4SZbv+rXEPTUUfX9N+0xA+QVF pygw== X-Gm-Message-State: AOAM530Z4nidZQ0N6F2De+7DXx7jUyy2IUHGDhXqex2HfSqIitFoA2KF QxveWECqAPe/wi7sLneLDeJQgE5EjgMfUlt2UFJh53b8Id82kRLXNYjsMEHdj3FOUu3gcIo3gF/ kMNINgdT7QhLazFzZjf8= X-Received: by 2002:adf:a195:: with SMTP id u21mr27273827wru.367.1623236108239; Wed, 09 Jun 2021 03:55:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjnCkAcBENrkqMTB70+rs2Nob4xVwaz0WEFyYcAGQK8OJcQbAHNdq4EvIJiX07BLGSW1YWbw== X-Received: by 2002:adf:a195:: with SMTP id u21mr27273781wru.367.1623236107908; Wed, 09 Jun 2021 03:55:07 -0700 (PDT) Received: from [192.168.3.132] (p5b0c611d.dip0.t-ipconnect.de. [91.12.97.29]) by smtp.gmail.com with ESMTPSA id j1sm20561498wmi.44.2021.06.09.03.55.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 03:55:07 -0700 (PDT) Subject: Re: [PATCH 5/9] mm: remove CONFIG_DISCONTIGMEM To: Mike Rapoport , Andrew Morton Cc: Arnd Bergmann , Geert Uytterhoeven , Ivan Kokshaysky , Jonathan Corbet , Matt Turner , Mike Rapoport , Richard Henderson , Vineet Gupta , kexec@lists.infradead.org, linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org References: <20210602105348.13387-1-rppt@kernel.org> <20210602105348.13387-6-rppt@kernel.org> From: David Hildenbrand Organization: Red Hat Message-ID: Date: Wed, 9 Jun 2021 12:55:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210602105348.13387-6-rppt@kernel.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org On 02.06.21 12:53, Mike Rapoport wrote: > From: Mike Rapoport > > There are no architectures that support DISCONTIGMEM left. > > Remove the configuration option and the dead code it was guarding in the > generic memory management code. > > Signed-off-by: Mike Rapoport > --- > include/asm-generic/memory_model.h | 37 ++++-------------------------- > include/linux/mmzone.h | 4 ++-- > mm/Kconfig | 25 +++----------------- > mm/memory.c | 3 +-- > mm/page_alloc.c | 13 ----------- > 5 files changed, 10 insertions(+), 72 deletions(-) > > diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h > index 7637fb46ba4f..a2c8ed60233a 100644 > --- a/include/asm-generic/memory_model.h > +++ b/include/asm-generic/memory_model.h > @@ -6,47 +6,18 @@ > > #ifndef __ASSEMBLY__ > > +/* > + * supports 3 memory models. > + */ > #if defined(CONFIG_FLATMEM) > > #ifndef ARCH_PFN_OFFSET > #define ARCH_PFN_OFFSET (0UL) > #endif > > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#ifndef arch_pfn_to_nid > -#define arch_pfn_to_nid(pfn) pfn_to_nid(pfn) > -#endif > - > -#ifndef arch_local_page_offset > -#define arch_local_page_offset(pfn, nid) \ > - ((pfn) - NODE_DATA(nid)->node_start_pfn) > -#endif > - > -#endif /* CONFIG_DISCONTIGMEM */ > - > -/* > - * supports 3 memory models. > - */ > -#if defined(CONFIG_FLATMEM) > - > #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET)) > #define __page_to_pfn(page) ((unsigned long)((page) - mem_map) + \ > ARCH_PFN_OFFSET) > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#define __pfn_to_page(pfn) \ > -({ unsigned long __pfn = (pfn); \ > - unsigned long __nid = arch_pfn_to_nid(__pfn); \ > - NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ > -}) > - > -#define __page_to_pfn(pg) \ > -({ const struct page *__pg = (pg); \ > - struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ > - (unsigned long)(__pg - __pgdat->node_mem_map) + \ > - __pgdat->node_start_pfn; \ > -}) > > #elif defined(CONFIG_SPARSEMEM_VMEMMAP) > > @@ -70,7 +41,7 @@ > struct mem_section *__sec = __pfn_to_section(__pfn); \ > __section_mem_map_addr(__sec) + __pfn; \ > }) > -#endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ > +#endif /* CONFIG_FLATMEM/SPARSEMEM */ > > /* > * Convert a physical address to a Page Frame Number and back > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 0d53eba1c383..2b41e252a995 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -738,8 +738,8 @@ struct zonelist { > struct zoneref _zonerefs[MAX_ZONES_PER_ZONELIST + 1]; > }; > > -#ifndef CONFIG_DISCONTIGMEM > -/* The array of struct pages - for discontigmem use pgdat->lmem_map */ > +#ifdef CONFIG_FLATMEM > +/* The array of struct pages for flatmem */ > extern struct page *mem_map; > #endif > > diff --git a/mm/Kconfig b/mm/Kconfig > index 02d44e3420f5..218b96ccc84a 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -19,7 +19,7 @@ choice > > config FLATMEM_MANUAL > bool "Flat Memory" > - depends on !(ARCH_DISCONTIGMEM_ENABLE || ARCH_SPARSEMEM_ENABLE) || ARCH_FLATMEM_ENABLE > + depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE > help > This option is best suited for non-NUMA systems with > flat address space. The FLATMEM is the most efficient > @@ -32,21 +32,6 @@ config FLATMEM_MANUAL > > If unsure, choose this option (Flat Memory) over any other. > > -config DISCONTIGMEM_MANUAL > - bool "Discontiguous Memory" > - depends on ARCH_DISCONTIGMEM_ENABLE > - help > - This option provides enhanced support for discontiguous > - memory systems, over FLATMEM. These systems have holes > - in their physical address spaces, and this option provides > - more efficient handling of these holes. > - > - Although "Discontiguous Memory" is still used by several > - architectures, it is considered deprecated in favor of > - "Sparse Memory". > - > - If unsure, choose "Sparse Memory" over this option. > - > config SPARSEMEM_MANUAL > bool "Sparse Memory" > depends on ARCH_SPARSEMEM_ENABLE > @@ -62,17 +47,13 @@ config SPARSEMEM_MANUAL > > endchoice > > -config DISCONTIGMEM > - def_bool y > - depends on (!SELECT_MEMORY_MODEL && ARCH_DISCONTIGMEM_ENABLE) || DISCONTIGMEM_MANUAL > - > config SPARSEMEM > def_bool y > depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL > > config FLATMEM > def_bool y > - depends on (!DISCONTIGMEM && !SPARSEMEM) || FLATMEM_MANUAL > + depends on !SPARSEMEM || FLATMEM_MANUAL > > config FLAT_NODE_MEM_MAP > def_bool y > @@ -85,7 +66,7 @@ config FLAT_NODE_MEM_MAP > # > config NEED_MULTIPLE_NODES > def_bool y > - depends on DISCONTIGMEM || NUMA > + depends on NUMA > > # > # SPARSEMEM_EXTREME (which is the default) does some bootmem > diff --git a/mm/memory.c b/mm/memory.c > index 730daa00952b..7c7b6ea02504 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -90,8 +90,7 @@ > #warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid. > #endif > > -#ifndef CONFIG_NEED_MULTIPLE_NODES > -/* use the per-pgdat data instead for discontigmem - mbligh */ > +#ifdef CONFIG_FLATMEM > unsigned long max_mapnr; > EXPORT_SYMBOL(max_mapnr); > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index aaa1655cf682..6fc22482eaa8 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -331,20 +331,7 @@ compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS] = { > > int min_free_kbytes = 1024; > int user_min_free_kbytes = -1; > -#ifdef CONFIG_DISCONTIGMEM > -/* > - * DiscontigMem defines memory ranges as separate pg_data_t even if the ranges > - * are not on separate NUMA nodes. Functionally this works but with > - * watermark_boost_factor, it can reclaim prematurely as the ranges can be > - * quite small. By default, do not boost watermarks on discontigmem as in > - * many cases very high-order allocations like THP are likely to be > - * unsupported and the premature reclaim offsets the advantage of long-term > - * fragmentation avoidance. > - */ > -int watermark_boost_factor __read_mostly; > -#else > int watermark_boost_factor __read_mostly = 15000; > -#endif > int watermark_scale_factor = 10; > > static unsigned long nr_kernel_pages __initdata; > Nice Acked-by: David Hildenbrand -- Thanks, David / dhildenb 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.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable 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 12036C48BCD for ; Wed, 9 Jun 2021 10:55:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D41A8613AE for ; Wed, 9 Jun 2021 10:55:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D41A8613AE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gzopd4VN+sYpIMZS1rg3PHCakttsbF06bh8GZpIMdx8=; b=diGZc4gobG5RdrWyApHJwx3A4u SgrTbiZVdr5PJ0lLHFyhVKq2ZY5ull5lna7UXK64+yOLaMJeFuZAPbruG29VdlFZ2Lgr7dXuNVLIr 3HLsqszLncMBx9N0vpf43YNv/nj40p4qGLRcmozWvyhgkpwpWAjj9VP/Xt+m9O+GpG46UEZSY6vLg rH/PO+fU1KqNt68j8RoDpb9dZVg3KqWVMO+dJQAhwmY7ML7E+WuDzPZidU9aR0j0Y43YTtjXMb5cY pRRJwYgPWjiZiNhr51Fw0c6Kqk6RD7wFEUfyI9af0k+Co/vd40fdilrb3PNurZmLAWzhAH535m1A+ MXd6xe0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqvs5-00DAi8-Q3; Wed, 09 Jun 2021 10:55:41 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqvrb-00DATX-OB for linux-riscv@lists.infradead.org; Wed, 09 Jun 2021 10:55:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623236110; 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=benEkoYiyJABYdMW95hQGiXtSU/C1XePwCmkHhtvx1g=; b=PaNnjs6ibUg2dwjRwpZK3wVXVNgdJHJo6Ls5EGV6lHp3DQ9yO5eOStmU5wCgwGweoio8QG CJQaEbBRek6Ew6+zPEVH9PpFrqaz9dmXafmSuP8+e3qLB4csy0S8Bj48mBLaQnj5JjIfVE T6lD5VDbMtCrSW04O05+VWQYQ48tDIQ= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-546-YT3TXrfkPW6VrYEJqF086A-1; Wed, 09 Jun 2021 06:55:09 -0400 X-MC-Unique: YT3TXrfkPW6VrYEJqF086A-1 Received: by mail-wr1-f71.google.com with SMTP id s8-20020adff8080000b0290114e1eeb8c6so10590452wrp.23 for ; Wed, 09 Jun 2021 03:55:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=benEkoYiyJABYdMW95hQGiXtSU/C1XePwCmkHhtvx1g=; b=mP6QMbDZ2e8ao86rSwKWniyvE788Lssn/NEAPziWqnlHD7dPKL5cC+UK/ZgNpCJwGG Nw/K0+Z9Lo1I7cqJt35I//Eev5TPNqznI4tcyqImnuSYvZIB0kIPftiCkXuM2k7wf4r+ Lv7xmQSAkieo42Ety3lZyRBQ3PJce9Z1lLL7t5fLA96sZSXJnRYyVWlFa1uBcn16vrYE QlpXUQCmSXd3GB4sQ+0dC4O3uui3YKh8puz6PxOsuAWAP15+x4EbujW1JYG7sgTuQhqd lsxDHz7pFf66A5YUBPJwrt5tuQYQh8RKNkgZykp70l++5KKGQ+EJcaJXT+ji1qQIez4/ i+6Q== X-Gm-Message-State: AOAM530b28Ue/T/gyEcplrdZc1rwqFTsEMqS1ympxO3MXC8PMCH6Ft64 NuksfzK2aB0B8XV6K5PtWCBKseaOMQvR0KRzAsxrRgd1IcgAhY1Ir39xc++5J3bGIckjg+Lskme bFF7FYEEuFAC5dLxqCcapVoZGqspg X-Received: by 2002:adf:a195:: with SMTP id u21mr27273830wru.367.1623236108239; Wed, 09 Jun 2021 03:55:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjnCkAcBENrkqMTB70+rs2Nob4xVwaz0WEFyYcAGQK8OJcQbAHNdq4EvIJiX07BLGSW1YWbw== X-Received: by 2002:adf:a195:: with SMTP id u21mr27273781wru.367.1623236107908; Wed, 09 Jun 2021 03:55:07 -0700 (PDT) Received: from [192.168.3.132] (p5b0c611d.dip0.t-ipconnect.de. [91.12.97.29]) by smtp.gmail.com with ESMTPSA id j1sm20561498wmi.44.2021.06.09.03.55.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 03:55:07 -0700 (PDT) Subject: Re: [PATCH 5/9] mm: remove CONFIG_DISCONTIGMEM To: Mike Rapoport , Andrew Morton Cc: Arnd Bergmann , Geert Uytterhoeven , Ivan Kokshaysky , Jonathan Corbet , Matt Turner , Mike Rapoport , Richard Henderson , Vineet Gupta , kexec@lists.infradead.org, linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org References: <20210602105348.13387-1-rppt@kernel.org> <20210602105348.13387-6-rppt@kernel.org> From: David Hildenbrand Organization: Red Hat Message-ID: Date: Wed, 9 Jun 2021 12:55:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210602105348.13387-6-rppt@kernel.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210609_035511_894242_4AC98FCD X-CRM114-Status: GOOD ( 33.94 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On 02.06.21 12:53, Mike Rapoport wrote: > From: Mike Rapoport > > There are no architectures that support DISCONTIGMEM left. > > Remove the configuration option and the dead code it was guarding in the > generic memory management code. > > Signed-off-by: Mike Rapoport > --- > include/asm-generic/memory_model.h | 37 ++++-------------------------- > include/linux/mmzone.h | 4 ++-- > mm/Kconfig | 25 +++----------------- > mm/memory.c | 3 +-- > mm/page_alloc.c | 13 ----------- > 5 files changed, 10 insertions(+), 72 deletions(-) > > diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h > index 7637fb46ba4f..a2c8ed60233a 100644 > --- a/include/asm-generic/memory_model.h > +++ b/include/asm-generic/memory_model.h > @@ -6,47 +6,18 @@ > > #ifndef __ASSEMBLY__ > > +/* > + * supports 3 memory models. > + */ > #if defined(CONFIG_FLATMEM) > > #ifndef ARCH_PFN_OFFSET > #define ARCH_PFN_OFFSET (0UL) > #endif > > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#ifndef arch_pfn_to_nid > -#define arch_pfn_to_nid(pfn) pfn_to_nid(pfn) > -#endif > - > -#ifndef arch_local_page_offset > -#define arch_local_page_offset(pfn, nid) \ > - ((pfn) - NODE_DATA(nid)->node_start_pfn) > -#endif > - > -#endif /* CONFIG_DISCONTIGMEM */ > - > -/* > - * supports 3 memory models. > - */ > -#if defined(CONFIG_FLATMEM) > - > #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET)) > #define __page_to_pfn(page) ((unsigned long)((page) - mem_map) + \ > ARCH_PFN_OFFSET) > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#define __pfn_to_page(pfn) \ > -({ unsigned long __pfn = (pfn); \ > - unsigned long __nid = arch_pfn_to_nid(__pfn); \ > - NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ > -}) > - > -#define __page_to_pfn(pg) \ > -({ const struct page *__pg = (pg); \ > - struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ > - (unsigned long)(__pg - __pgdat->node_mem_map) + \ > - __pgdat->node_start_pfn; \ > -}) > > #elif defined(CONFIG_SPARSEMEM_VMEMMAP) > > @@ -70,7 +41,7 @@ > struct mem_section *__sec = __pfn_to_section(__pfn); \ > __section_mem_map_addr(__sec) + __pfn; \ > }) > -#endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ > +#endif /* CONFIG_FLATMEM/SPARSEMEM */ > > /* > * Convert a physical address to a Page Frame Number and back > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 0d53eba1c383..2b41e252a995 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -738,8 +738,8 @@ struct zonelist { > struct zoneref _zonerefs[MAX_ZONES_PER_ZONELIST + 1]; > }; > > -#ifndef CONFIG_DISCONTIGMEM > -/* The array of struct pages - for discontigmem use pgdat->lmem_map */ > +#ifdef CONFIG_FLATMEM > +/* The array of struct pages for flatmem */ > extern struct page *mem_map; > #endif > > diff --git a/mm/Kconfig b/mm/Kconfig > index 02d44e3420f5..218b96ccc84a 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -19,7 +19,7 @@ choice > > config FLATMEM_MANUAL > bool "Flat Memory" > - depends on !(ARCH_DISCONTIGMEM_ENABLE || ARCH_SPARSEMEM_ENABLE) || ARCH_FLATMEM_ENABLE > + depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE > help > This option is best suited for non-NUMA systems with > flat address space. The FLATMEM is the most efficient > @@ -32,21 +32,6 @@ config FLATMEM_MANUAL > > If unsure, choose this option (Flat Memory) over any other. > > -config DISCONTIGMEM_MANUAL > - bool "Discontiguous Memory" > - depends on ARCH_DISCONTIGMEM_ENABLE > - help > - This option provides enhanced support for discontiguous > - memory systems, over FLATMEM. These systems have holes > - in their physical address spaces, and this option provides > - more efficient handling of these holes. > - > - Although "Discontiguous Memory" is still used by several > - architectures, it is considered deprecated in favor of > - "Sparse Memory". > - > - If unsure, choose "Sparse Memory" over this option. > - > config SPARSEMEM_MANUAL > bool "Sparse Memory" > depends on ARCH_SPARSEMEM_ENABLE > @@ -62,17 +47,13 @@ config SPARSEMEM_MANUAL > > endchoice > > -config DISCONTIGMEM > - def_bool y > - depends on (!SELECT_MEMORY_MODEL && ARCH_DISCONTIGMEM_ENABLE) || DISCONTIGMEM_MANUAL > - > config SPARSEMEM > def_bool y > depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL > > config FLATMEM > def_bool y > - depends on (!DISCONTIGMEM && !SPARSEMEM) || FLATMEM_MANUAL > + depends on !SPARSEMEM || FLATMEM_MANUAL > > config FLAT_NODE_MEM_MAP > def_bool y > @@ -85,7 +66,7 @@ config FLAT_NODE_MEM_MAP > # > config NEED_MULTIPLE_NODES > def_bool y > - depends on DISCONTIGMEM || NUMA > + depends on NUMA > > # > # SPARSEMEM_EXTREME (which is the default) does some bootmem > diff --git a/mm/memory.c b/mm/memory.c > index 730daa00952b..7c7b6ea02504 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -90,8 +90,7 @@ > #warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid. > #endif > > -#ifndef CONFIG_NEED_MULTIPLE_NODES > -/* use the per-pgdat data instead for discontigmem - mbligh */ > +#ifdef CONFIG_FLATMEM > unsigned long max_mapnr; > EXPORT_SYMBOL(max_mapnr); > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index aaa1655cf682..6fc22482eaa8 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -331,20 +331,7 @@ compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS] = { > > int min_free_kbytes = 1024; > int user_min_free_kbytes = -1; > -#ifdef CONFIG_DISCONTIGMEM > -/* > - * DiscontigMem defines memory ranges as separate pg_data_t even if the ranges > - * are not on separate NUMA nodes. Functionally this works but with > - * watermark_boost_factor, it can reclaim prematurely as the ranges can be > - * quite small. By default, do not boost watermarks on discontigmem as in > - * many cases very high-order allocations like THP are likely to be > - * unsupported and the premature reclaim offsets the advantage of long-term > - * fragmentation avoidance. > - */ > -int watermark_boost_factor __read_mostly; > -#else > int watermark_boost_factor __read_mostly = 15000; > -#endif > int watermark_scale_factor = 10; > > static unsigned long nr_kernel_pages __initdata; > Nice Acked-by: David Hildenbrand -- Thanks, David / dhildenb _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 79436C48BCF for ; Wed, 9 Jun 2021 10:55:43 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1C8A4613AE for ; Wed, 9 Jun 2021 10:55:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C8A4613AE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4G0PCf1BJ7z3byb for ; Wed, 9 Jun 2021 20:55:42 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PaNnjs6i; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cnLaeVjC; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=216.205.24.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=david@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PaNnjs6i; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cnLaeVjC; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4G0PC61bLHz2xff for ; Wed, 9 Jun 2021 20:55:13 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623236110; 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=benEkoYiyJABYdMW95hQGiXtSU/C1XePwCmkHhtvx1g=; b=PaNnjs6ibUg2dwjRwpZK3wVXVNgdJHJo6Ls5EGV6lHp3DQ9yO5eOStmU5wCgwGweoio8QG CJQaEbBRek6Ew6+zPEVH9PpFrqaz9dmXafmSuP8+e3qLB4csy0S8Bj48mBLaQnj5JjIfVE T6lD5VDbMtCrSW04O05+VWQYQ48tDIQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623236111; 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=benEkoYiyJABYdMW95hQGiXtSU/C1XePwCmkHhtvx1g=; b=cnLaeVjCX4QVt+iHltgH6O9O7ikqpZNeP3szvuiwBCJ5ZUI+8ZpUelIdZZ8xCxBdZ1Q3oX 7g162fj7pFNVvHGvmuD0HOeq2gPkCy8bViBg7cN0ufrcNBu4rpFptPsQaHZGf8X5tXfUce zEOaDz3qnULFChiGuiObK9TFgSyErXw= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-491-gLU28RkkNm6lNdrFhaogZg-1; Wed, 09 Jun 2021 06:55:09 -0400 X-MC-Unique: gLU28RkkNm6lNdrFhaogZg-1 Received: by mail-wr1-f71.google.com with SMTP id q15-20020adfc50f0000b0290111f48b865cso10594096wrf.4 for ; Wed, 09 Jun 2021 03:55:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=benEkoYiyJABYdMW95hQGiXtSU/C1XePwCmkHhtvx1g=; b=uWxWJGcY+U3e3MXMEpq4NekYA0LByay/NHEkyjFzhlW6r0CRDAnUXGn+btL3WiWd3a gJzZuUiXlQGmb7Dp43v6pvtk83fqfKoab8VGvKmPcFyG91jXScovwbuzDlV2CNqyNZeR ouJAlxlmYnH0MiuKNaM3uD8GI+1ITmHGA3/3MBuBUpN63R7eLWnlUefF72isIhDpmqAQ hJfVVjWEkQWkp26MKLh5jzoPBR9vpdliMKNI6aF1jpDbTB249xRxNdyB+MfX1h0ynVII WiCN4zvorYAu/iU0du4Ct+7Kbhvk0sTlLSaoo6Nzqe891iVMb9x/yRi7YNO/ddAx8YuJ 5ZdA== X-Gm-Message-State: AOAM533Ji+8e/YeKj1f+2Yg4evDMJ343A28XHNBLbYdtRn4+ojYKcgeq U49kFq2qgUD8KoPlKwff1YICT9dCQaMi6lCGSfLop5R63CMGB8CQOZlSZVNr1dF0pLBT96/ES7X rLRohHX8VLmn9X4PjvaOxT3c3FA== X-Received: by 2002:adf:a195:: with SMTP id u21mr27273825wru.367.1623236108239; Wed, 09 Jun 2021 03:55:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjnCkAcBENrkqMTB70+rs2Nob4xVwaz0WEFyYcAGQK8OJcQbAHNdq4EvIJiX07BLGSW1YWbw== X-Received: by 2002:adf:a195:: with SMTP id u21mr27273781wru.367.1623236107908; Wed, 09 Jun 2021 03:55:07 -0700 (PDT) Received: from [192.168.3.132] (p5b0c611d.dip0.t-ipconnect.de. [91.12.97.29]) by smtp.gmail.com with ESMTPSA id j1sm20561498wmi.44.2021.06.09.03.55.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 03:55:07 -0700 (PDT) Subject: Re: [PATCH 5/9] mm: remove CONFIG_DISCONTIGMEM To: Mike Rapoport , Andrew Morton References: <20210602105348.13387-1-rppt@kernel.org> <20210602105348.13387-6-rppt@kernel.org> From: David Hildenbrand Organization: Red Hat Message-ID: Date: Wed, 9 Jun 2021 12:55:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210602105348.13387-6-rppt@kernel.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org, Mike Rapoport , Geert Uytterhoeven , Matt Turner , linux-snps-arc@lists.infradead.org, linux-xtensa@linux-xtensa.org, Arnd Bergmann , linux-m68k@lists.linux-m68k.org, Ivan Kokshaysky , linux-arm-kernel@lists.infradead.org, Richard Henderson , Vineet Gupta , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 02.06.21 12:53, Mike Rapoport wrote: > From: Mike Rapoport > > There are no architectures that support DISCONTIGMEM left. > > Remove the configuration option and the dead code it was guarding in the > generic memory management code. > > Signed-off-by: Mike Rapoport > --- > include/asm-generic/memory_model.h | 37 ++++-------------------------- > include/linux/mmzone.h | 4 ++-- > mm/Kconfig | 25 +++----------------- > mm/memory.c | 3 +-- > mm/page_alloc.c | 13 ----------- > 5 files changed, 10 insertions(+), 72 deletions(-) > > diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h > index 7637fb46ba4f..a2c8ed60233a 100644 > --- a/include/asm-generic/memory_model.h > +++ b/include/asm-generic/memory_model.h > @@ -6,47 +6,18 @@ > > #ifndef __ASSEMBLY__ > > +/* > + * supports 3 memory models. > + */ > #if defined(CONFIG_FLATMEM) > > #ifndef ARCH_PFN_OFFSET > #define ARCH_PFN_OFFSET (0UL) > #endif > > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#ifndef arch_pfn_to_nid > -#define arch_pfn_to_nid(pfn) pfn_to_nid(pfn) > -#endif > - > -#ifndef arch_local_page_offset > -#define arch_local_page_offset(pfn, nid) \ > - ((pfn) - NODE_DATA(nid)->node_start_pfn) > -#endif > - > -#endif /* CONFIG_DISCONTIGMEM */ > - > -/* > - * supports 3 memory models. > - */ > -#if defined(CONFIG_FLATMEM) > - > #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET)) > #define __page_to_pfn(page) ((unsigned long)((page) - mem_map) + \ > ARCH_PFN_OFFSET) > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#define __pfn_to_page(pfn) \ > -({ unsigned long __pfn = (pfn); \ > - unsigned long __nid = arch_pfn_to_nid(__pfn); \ > - NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ > -}) > - > -#define __page_to_pfn(pg) \ > -({ const struct page *__pg = (pg); \ > - struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ > - (unsigned long)(__pg - __pgdat->node_mem_map) + \ > - __pgdat->node_start_pfn; \ > -}) > > #elif defined(CONFIG_SPARSEMEM_VMEMMAP) > > @@ -70,7 +41,7 @@ > struct mem_section *__sec = __pfn_to_section(__pfn); \ > __section_mem_map_addr(__sec) + __pfn; \ > }) > -#endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ > +#endif /* CONFIG_FLATMEM/SPARSEMEM */ > > /* > * Convert a physical address to a Page Frame Number and back > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 0d53eba1c383..2b41e252a995 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -738,8 +738,8 @@ struct zonelist { > struct zoneref _zonerefs[MAX_ZONES_PER_ZONELIST + 1]; > }; > > -#ifndef CONFIG_DISCONTIGMEM > -/* The array of struct pages - for discontigmem use pgdat->lmem_map */ > +#ifdef CONFIG_FLATMEM > +/* The array of struct pages for flatmem */ > extern struct page *mem_map; > #endif > > diff --git a/mm/Kconfig b/mm/Kconfig > index 02d44e3420f5..218b96ccc84a 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -19,7 +19,7 @@ choice > > config FLATMEM_MANUAL > bool "Flat Memory" > - depends on !(ARCH_DISCONTIGMEM_ENABLE || ARCH_SPARSEMEM_ENABLE) || ARCH_FLATMEM_ENABLE > + depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE > help > This option is best suited for non-NUMA systems with > flat address space. The FLATMEM is the most efficient > @@ -32,21 +32,6 @@ config FLATMEM_MANUAL > > If unsure, choose this option (Flat Memory) over any other. > > -config DISCONTIGMEM_MANUAL > - bool "Discontiguous Memory" > - depends on ARCH_DISCONTIGMEM_ENABLE > - help > - This option provides enhanced support for discontiguous > - memory systems, over FLATMEM. These systems have holes > - in their physical address spaces, and this option provides > - more efficient handling of these holes. > - > - Although "Discontiguous Memory" is still used by several > - architectures, it is considered deprecated in favor of > - "Sparse Memory". > - > - If unsure, choose "Sparse Memory" over this option. > - > config SPARSEMEM_MANUAL > bool "Sparse Memory" > depends on ARCH_SPARSEMEM_ENABLE > @@ -62,17 +47,13 @@ config SPARSEMEM_MANUAL > > endchoice > > -config DISCONTIGMEM > - def_bool y > - depends on (!SELECT_MEMORY_MODEL && ARCH_DISCONTIGMEM_ENABLE) || DISCONTIGMEM_MANUAL > - > config SPARSEMEM > def_bool y > depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL > > config FLATMEM > def_bool y > - depends on (!DISCONTIGMEM && !SPARSEMEM) || FLATMEM_MANUAL > + depends on !SPARSEMEM || FLATMEM_MANUAL > > config FLAT_NODE_MEM_MAP > def_bool y > @@ -85,7 +66,7 @@ config FLAT_NODE_MEM_MAP > # > config NEED_MULTIPLE_NODES > def_bool y > - depends on DISCONTIGMEM || NUMA > + depends on NUMA > > # > # SPARSEMEM_EXTREME (which is the default) does some bootmem > diff --git a/mm/memory.c b/mm/memory.c > index 730daa00952b..7c7b6ea02504 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -90,8 +90,7 @@ > #warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid. > #endif > > -#ifndef CONFIG_NEED_MULTIPLE_NODES > -/* use the per-pgdat data instead for discontigmem - mbligh */ > +#ifdef CONFIG_FLATMEM > unsigned long max_mapnr; > EXPORT_SYMBOL(max_mapnr); > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index aaa1655cf682..6fc22482eaa8 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -331,20 +331,7 @@ compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS] = { > > int min_free_kbytes = 1024; > int user_min_free_kbytes = -1; > -#ifdef CONFIG_DISCONTIGMEM > -/* > - * DiscontigMem defines memory ranges as separate pg_data_t even if the ranges > - * are not on separate NUMA nodes. Functionally this works but with > - * watermark_boost_factor, it can reclaim prematurely as the ranges can be > - * quite small. By default, do not boost watermarks on discontigmem as in > - * many cases very high-order allocations like THP are likely to be > - * unsupported and the premature reclaim offsets the advantage of long-term > - * fragmentation avoidance. > - */ > -int watermark_boost_factor __read_mostly; > -#else > int watermark_boost_factor __read_mostly = 15000; > -#endif > int watermark_scale_factor = 10; > > static unsigned long nr_kernel_pages __initdata; > Nice Acked-by: David Hildenbrand -- Thanks, David / dhildenb 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.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable 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 D9838C48BCD for ; Wed, 9 Jun 2021 10:55:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AA0AD613AE for ; Wed, 9 Jun 2021 10:55:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA0AD613AE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OvOfucB3gJKXKIVOQfZBGNmxjhDKejVpycWV8xvqas4=; b=GxpyTUaYB/BAu6MdMBjLsGa6eH RKzR0dABf+CUv5o+imOITeE2DQfFRCq6zcPkP8cCxRmcopG6tKkHScKH2b/8hae8ZB4hxeoHI6fuI 2vneWpKMTffnX+l8T1mSgSlbsq8J4xhYyrOSrBDknKXQyViOf7oARyADKrDYHtUqka9zAuy52PkBJ HXYI7z/dprfVhRgSXN+O4fVIEDoB2TNognF7MAOF/vz+F3PEWaANWljXvslQWbK/W3vtZZZkQXvgQ PFQrYUSGqxyQpKigwe4r7FrlYGoAqakh0RBrCNp5CYtPluoLiHaSQZ2XACprwsq6AAnBYp86lVCIz Le5miFdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqvsA-00DAk6-0x; Wed, 09 Jun 2021 10:55:46 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqvrd-00DAUv-U2 for linux-snps-arc@lists.infradead.org; Wed, 09 Jun 2021 10:55:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623236112; 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=benEkoYiyJABYdMW95hQGiXtSU/C1XePwCmkHhtvx1g=; b=crhv9Vvb0mgh7qWL7y7xFDM297sQEubAtkR3Uv5cgs7+c1QXEJisIH9kif4jf/GacqdwZ6 zW45IjmI/bqIGZ5dnFts6Z+fwRpHredcs7Cnb7qoye6MSWZs3kX8KAIuzRiqgUPn38KNXs 3bY3AjZXRhUw+KCdYzr2t3pqv+P6a5g= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-164-wz4Gr1KQPY2N7VuM5Z9Zbw-1; Wed, 09 Jun 2021 06:55:09 -0400 X-MC-Unique: wz4Gr1KQPY2N7VuM5Z9Zbw-1 Received: by mail-wr1-f72.google.com with SMTP id h10-20020a5d688a0000b0290119c2ce2499so5648706wru.19 for ; Wed, 09 Jun 2021 03:55:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=benEkoYiyJABYdMW95hQGiXtSU/C1XePwCmkHhtvx1g=; b=SpQj3PVWvgbtHsPJxcy9UnGCeLYYSRkRgKAQmnbWTlZlY2Rezlo+4uLZEdy063GTfb d3fvNz4DKzQt1SSdoEpoBATsKpJ1c/V0dbXAJc9utTgdXPcQ6S++q/xLRnBxMrYSbh9C CNY+kMpi5CNrXN/d0Dfaiyd6e5uOJAl7fJ4D+ahnmsdi1F8li/SH4exBxFuk/aPyDsDC I/kS7NsSuyZcCbBrFv7DV+AmEn9t9xVrb/9oFGar0MHXSL/aiukTVJLgz7+P56oaiDIT /RAj456VBc+Z5nXVeacPD0N1VstS7JhIMrTa8DgafDTJX4yJzyQ6VPPulsDcb/ya4389 vRLw== X-Gm-Message-State: AOAM530RAJEtl0jpUlTPTgAuAaJD7aAmZ4QASJULwWwjk4KSHDnrwuDJ Js59N2JtVKaDvPnWgOt1t6eLOp3eTQQrXiGHdXx9/tLkOZ5VPbJKv5GQjIxdztFYxSpgZSPKqe3 +gpmQmBUMp0K3b+dKC8vSGKy4ntPdPo60 X-Received: by 2002:adf:a195:: with SMTP id u21mr27273822wru.367.1623236108238; Wed, 09 Jun 2021 03:55:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjnCkAcBENrkqMTB70+rs2Nob4xVwaz0WEFyYcAGQK8OJcQbAHNdq4EvIJiX07BLGSW1YWbw== X-Received: by 2002:adf:a195:: with SMTP id u21mr27273781wru.367.1623236107908; Wed, 09 Jun 2021 03:55:07 -0700 (PDT) Received: from [192.168.3.132] (p5b0c611d.dip0.t-ipconnect.de. [91.12.97.29]) by smtp.gmail.com with ESMTPSA id j1sm20561498wmi.44.2021.06.09.03.55.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 03:55:07 -0700 (PDT) Subject: Re: [PATCH 5/9] mm: remove CONFIG_DISCONTIGMEM To: Mike Rapoport , Andrew Morton Cc: Arnd Bergmann , Geert Uytterhoeven , Ivan Kokshaysky , Jonathan Corbet , Matt Turner , Mike Rapoport , Richard Henderson , Vineet Gupta , kexec@lists.infradead.org, linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org References: <20210602105348.13387-1-rppt@kernel.org> <20210602105348.13387-6-rppt@kernel.org> From: David Hildenbrand Organization: Red Hat Message-ID: Date: Wed, 9 Jun 2021 12:55:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210602105348.13387-6-rppt@kernel.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210609_035514_117213_9D7051D8 X-CRM114-Status: GOOD ( 33.95 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org On 02.06.21 12:53, Mike Rapoport wrote: > From: Mike Rapoport > > There are no architectures that support DISCONTIGMEM left. > > Remove the configuration option and the dead code it was guarding in the > generic memory management code. > > Signed-off-by: Mike Rapoport > --- > include/asm-generic/memory_model.h | 37 ++++-------------------------- > include/linux/mmzone.h | 4 ++-- > mm/Kconfig | 25 +++----------------- > mm/memory.c | 3 +-- > mm/page_alloc.c | 13 ----------- > 5 files changed, 10 insertions(+), 72 deletions(-) > > diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h > index 7637fb46ba4f..a2c8ed60233a 100644 > --- a/include/asm-generic/memory_model.h > +++ b/include/asm-generic/memory_model.h > @@ -6,47 +6,18 @@ > > #ifndef __ASSEMBLY__ > > +/* > + * supports 3 memory models. > + */ > #if defined(CONFIG_FLATMEM) > > #ifndef ARCH_PFN_OFFSET > #define ARCH_PFN_OFFSET (0UL) > #endif > > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#ifndef arch_pfn_to_nid > -#define arch_pfn_to_nid(pfn) pfn_to_nid(pfn) > -#endif > - > -#ifndef arch_local_page_offset > -#define arch_local_page_offset(pfn, nid) \ > - ((pfn) - NODE_DATA(nid)->node_start_pfn) > -#endif > - > -#endif /* CONFIG_DISCONTIGMEM */ > - > -/* > - * supports 3 memory models. > - */ > -#if defined(CONFIG_FLATMEM) > - > #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET)) > #define __page_to_pfn(page) ((unsigned long)((page) - mem_map) + \ > ARCH_PFN_OFFSET) > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#define __pfn_to_page(pfn) \ > -({ unsigned long __pfn = (pfn); \ > - unsigned long __nid = arch_pfn_to_nid(__pfn); \ > - NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ > -}) > - > -#define __page_to_pfn(pg) \ > -({ const struct page *__pg = (pg); \ > - struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ > - (unsigned long)(__pg - __pgdat->node_mem_map) + \ > - __pgdat->node_start_pfn; \ > -}) > > #elif defined(CONFIG_SPARSEMEM_VMEMMAP) > > @@ -70,7 +41,7 @@ > struct mem_section *__sec = __pfn_to_section(__pfn); \ > __section_mem_map_addr(__sec) + __pfn; \ > }) > -#endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ > +#endif /* CONFIG_FLATMEM/SPARSEMEM */ > > /* > * Convert a physical address to a Page Frame Number and back > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 0d53eba1c383..2b41e252a995 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -738,8 +738,8 @@ struct zonelist { > struct zoneref _zonerefs[MAX_ZONES_PER_ZONELIST + 1]; > }; > > -#ifndef CONFIG_DISCONTIGMEM > -/* The array of struct pages - for discontigmem use pgdat->lmem_map */ > +#ifdef CONFIG_FLATMEM > +/* The array of struct pages for flatmem */ > extern struct page *mem_map; > #endif > > diff --git a/mm/Kconfig b/mm/Kconfig > index 02d44e3420f5..218b96ccc84a 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -19,7 +19,7 @@ choice > > config FLATMEM_MANUAL > bool "Flat Memory" > - depends on !(ARCH_DISCONTIGMEM_ENABLE || ARCH_SPARSEMEM_ENABLE) || ARCH_FLATMEM_ENABLE > + depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE > help > This option is best suited for non-NUMA systems with > flat address space. The FLATMEM is the most efficient > @@ -32,21 +32,6 @@ config FLATMEM_MANUAL > > If unsure, choose this option (Flat Memory) over any other. > > -config DISCONTIGMEM_MANUAL > - bool "Discontiguous Memory" > - depends on ARCH_DISCONTIGMEM_ENABLE > - help > - This option provides enhanced support for discontiguous > - memory systems, over FLATMEM. These systems have holes > - in their physical address spaces, and this option provides > - more efficient handling of these holes. > - > - Although "Discontiguous Memory" is still used by several > - architectures, it is considered deprecated in favor of > - "Sparse Memory". > - > - If unsure, choose "Sparse Memory" over this option. > - > config SPARSEMEM_MANUAL > bool "Sparse Memory" > depends on ARCH_SPARSEMEM_ENABLE > @@ -62,17 +47,13 @@ config SPARSEMEM_MANUAL > > endchoice > > -config DISCONTIGMEM > - def_bool y > - depends on (!SELECT_MEMORY_MODEL && ARCH_DISCONTIGMEM_ENABLE) || DISCONTIGMEM_MANUAL > - > config SPARSEMEM > def_bool y > depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL > > config FLATMEM > def_bool y > - depends on (!DISCONTIGMEM && !SPARSEMEM) || FLATMEM_MANUAL > + depends on !SPARSEMEM || FLATMEM_MANUAL > > config FLAT_NODE_MEM_MAP > def_bool y > @@ -85,7 +66,7 @@ config FLAT_NODE_MEM_MAP > # > config NEED_MULTIPLE_NODES > def_bool y > - depends on DISCONTIGMEM || NUMA > + depends on NUMA > > # > # SPARSEMEM_EXTREME (which is the default) does some bootmem > diff --git a/mm/memory.c b/mm/memory.c > index 730daa00952b..7c7b6ea02504 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -90,8 +90,7 @@ > #warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid. > #endif > > -#ifndef CONFIG_NEED_MULTIPLE_NODES > -/* use the per-pgdat data instead for discontigmem - mbligh */ > +#ifdef CONFIG_FLATMEM > unsigned long max_mapnr; > EXPORT_SYMBOL(max_mapnr); > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index aaa1655cf682..6fc22482eaa8 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -331,20 +331,7 @@ compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS] = { > > int min_free_kbytes = 1024; > int user_min_free_kbytes = -1; > -#ifdef CONFIG_DISCONTIGMEM > -/* > - * DiscontigMem defines memory ranges as separate pg_data_t even if the ranges > - * are not on separate NUMA nodes. Functionally this works but with > - * watermark_boost_factor, it can reclaim prematurely as the ranges can be > - * quite small. By default, do not boost watermarks on discontigmem as in > - * many cases very high-order allocations like THP are likely to be > - * unsupported and the premature reclaim offsets the advantage of long-term > - * fragmentation avoidance. > - */ > -int watermark_boost_factor __read_mostly; > -#else > int watermark_boost_factor __read_mostly = 15000; > -#endif > int watermark_scale_factor = 10; > > static unsigned long nr_kernel_pages __initdata; > Nice Acked-by: David Hildenbrand -- Thanks, David / dhildenb _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc 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.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable 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 DA1B8C48BCD for ; Wed, 9 Jun 2021 10:57:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AA3826136D for ; Wed, 9 Jun 2021 10:57:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA3826136D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BQsbXJ95uw+w4BnO1SKUDpzu70obgOgQ96qElkhoMcc=; b=amYGiURH+SBx/aV6/FxMsNWSGw 2xr+k5sqYVTzd+gYuqFyTDQlakvMeXm69iCMhqsLNNRIy+CxIdWRTkii8GXq870kr3LTioofR6Tbv gBYYiwRFnb/akLmCNSR8j6KJ9i3ijQdPlUJlhHhX2zPdGGsnDE3JWwFforOWIvF79dMa7Ft26zBRE DgjJmQTXj1hNr2J2HMnbR4dCM9W29avG0apwd40ILtBRkEIvcchJAj05YZ4xMZzmgZ8zEO1LzFYm9 wzfXD9TG2QFGMT99BlBu0qJuH9Tu0QhmJ4O4B7hZHReD6fonTTrs0/1e64+pBjIkJ+No0No++rFGb LjLzICWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqvrh-00DAXG-Ib; Wed, 09 Jun 2021 10:55:18 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqvrb-00DATT-Mf for linux-arm-kernel@lists.infradead.org; Wed, 09 Jun 2021 10:55:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623236110; 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=benEkoYiyJABYdMW95hQGiXtSU/C1XePwCmkHhtvx1g=; b=PaNnjs6ibUg2dwjRwpZK3wVXVNgdJHJo6Ls5EGV6lHp3DQ9yO5eOStmU5wCgwGweoio8QG CJQaEbBRek6Ew6+zPEVH9PpFrqaz9dmXafmSuP8+e3qLB4csy0S8Bj48mBLaQnj5JjIfVE T6lD5VDbMtCrSW04O05+VWQYQ48tDIQ= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-164-AxcajaDWMm2z5wo5M1HjiQ-1; Wed, 09 Jun 2021 06:55:09 -0400 X-MC-Unique: AxcajaDWMm2z5wo5M1HjiQ-1 Received: by mail-wr1-f72.google.com with SMTP id e9-20020a5d6d090000b0290119e91be97dso2369012wrq.1 for ; Wed, 09 Jun 2021 03:55:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=benEkoYiyJABYdMW95hQGiXtSU/C1XePwCmkHhtvx1g=; b=KVsZiC0E5rzH5Psjx3P5I8Wd8h1p31+3XXddtkWk5ANcfDXo/AqkCYpdmLYUAr7FI3 KljMl7brIqguJhauUXIQvkLBH+QBVNq4npRNhVSvppGOPWsB31YUvMmrHz/Xeu4ftN+w kdGjsgM5G8jTj6Zv9n3PVR0Gus4xo+zFvap8syVcbz3/2ZmccYl6ARNdr+OnjoBcRSNV 5yUwQZ9kHcflju/1lsuvujgVqiyK8dGm5YPFlg8r6IfzVM0uCi/VrEKlGPv7LHfHAJh5 Wl08vo27YBUyf3bvACDP8hNW54vBrnFGhDA7s4jJMYsVevTdYfyVnSmwlTTz3VijvT4P K7YQ== X-Gm-Message-State: AOAM532sK1V7Qi8UgUCmH+pa/oJJhl2KHIdHBs+rRUHGMgp+wF06GmHU 8PHCDJGdJZccWohHQ4XlyWLmZPRBIEfp0nlZtUSlZeHa9RgJG7IO0i+yDmQ7zRnKaWD3z8h5fgV qM6j4aVlxYrCTeu/IwPUrkqQwuJeb8g/R4OQ= X-Received: by 2002:adf:a195:: with SMTP id u21mr27273844wru.367.1623236108272; Wed, 09 Jun 2021 03:55:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjnCkAcBENrkqMTB70+rs2Nob4xVwaz0WEFyYcAGQK8OJcQbAHNdq4EvIJiX07BLGSW1YWbw== X-Received: by 2002:adf:a195:: with SMTP id u21mr27273781wru.367.1623236107908; Wed, 09 Jun 2021 03:55:07 -0700 (PDT) Received: from [192.168.3.132] (p5b0c611d.dip0.t-ipconnect.de. [91.12.97.29]) by smtp.gmail.com with ESMTPSA id j1sm20561498wmi.44.2021.06.09.03.55.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 03:55:07 -0700 (PDT) Subject: Re: [PATCH 5/9] mm: remove CONFIG_DISCONTIGMEM To: Mike Rapoport , Andrew Morton Cc: Arnd Bergmann , Geert Uytterhoeven , Ivan Kokshaysky , Jonathan Corbet , Matt Turner , Mike Rapoport , Richard Henderson , Vineet Gupta , kexec@lists.infradead.org, linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org References: <20210602105348.13387-1-rppt@kernel.org> <20210602105348.13387-6-rppt@kernel.org> From: David Hildenbrand Organization: Red Hat Message-ID: Date: Wed, 9 Jun 2021 12:55:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210602105348.13387-6-rppt@kernel.org> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210609_035511_886435_70FD8DCC X-CRM114-Status: GOOD ( 35.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 02.06.21 12:53, Mike Rapoport wrote: > From: Mike Rapoport > > There are no architectures that support DISCONTIGMEM left. > > Remove the configuration option and the dead code it was guarding in the > generic memory management code. > > Signed-off-by: Mike Rapoport > --- > include/asm-generic/memory_model.h | 37 ++++-------------------------- > include/linux/mmzone.h | 4 ++-- > mm/Kconfig | 25 +++----------------- > mm/memory.c | 3 +-- > mm/page_alloc.c | 13 ----------- > 5 files changed, 10 insertions(+), 72 deletions(-) > > diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h > index 7637fb46ba4f..a2c8ed60233a 100644 > --- a/include/asm-generic/memory_model.h > +++ b/include/asm-generic/memory_model.h > @@ -6,47 +6,18 @@ > > #ifndef __ASSEMBLY__ > > +/* > + * supports 3 memory models. > + */ > #if defined(CONFIG_FLATMEM) > > #ifndef ARCH_PFN_OFFSET > #define ARCH_PFN_OFFSET (0UL) > #endif > > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#ifndef arch_pfn_to_nid > -#define arch_pfn_to_nid(pfn) pfn_to_nid(pfn) > -#endif > - > -#ifndef arch_local_page_offset > -#define arch_local_page_offset(pfn, nid) \ > - ((pfn) - NODE_DATA(nid)->node_start_pfn) > -#endif > - > -#endif /* CONFIG_DISCONTIGMEM */ > - > -/* > - * supports 3 memory models. > - */ > -#if defined(CONFIG_FLATMEM) > - > #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET)) > #define __page_to_pfn(page) ((unsigned long)((page) - mem_map) + \ > ARCH_PFN_OFFSET) > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#define __pfn_to_page(pfn) \ > -({ unsigned long __pfn = (pfn); \ > - unsigned long __nid = arch_pfn_to_nid(__pfn); \ > - NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ > -}) > - > -#define __page_to_pfn(pg) \ > -({ const struct page *__pg = (pg); \ > - struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ > - (unsigned long)(__pg - __pgdat->node_mem_map) + \ > - __pgdat->node_start_pfn; \ > -}) > > #elif defined(CONFIG_SPARSEMEM_VMEMMAP) > > @@ -70,7 +41,7 @@ > struct mem_section *__sec = __pfn_to_section(__pfn); \ > __section_mem_map_addr(__sec) + __pfn; \ > }) > -#endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ > +#endif /* CONFIG_FLATMEM/SPARSEMEM */ > > /* > * Convert a physical address to a Page Frame Number and back > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 0d53eba1c383..2b41e252a995 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -738,8 +738,8 @@ struct zonelist { > struct zoneref _zonerefs[MAX_ZONES_PER_ZONELIST + 1]; > }; > > -#ifndef CONFIG_DISCONTIGMEM > -/* The array of struct pages - for discontigmem use pgdat->lmem_map */ > +#ifdef CONFIG_FLATMEM > +/* The array of struct pages for flatmem */ > extern struct page *mem_map; > #endif > > diff --git a/mm/Kconfig b/mm/Kconfig > index 02d44e3420f5..218b96ccc84a 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -19,7 +19,7 @@ choice > > config FLATMEM_MANUAL > bool "Flat Memory" > - depends on !(ARCH_DISCONTIGMEM_ENABLE || ARCH_SPARSEMEM_ENABLE) || ARCH_FLATMEM_ENABLE > + depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE > help > This option is best suited for non-NUMA systems with > flat address space. The FLATMEM is the most efficient > @@ -32,21 +32,6 @@ config FLATMEM_MANUAL > > If unsure, choose this option (Flat Memory) over any other. > > -config DISCONTIGMEM_MANUAL > - bool "Discontiguous Memory" > - depends on ARCH_DISCONTIGMEM_ENABLE > - help > - This option provides enhanced support for discontiguous > - memory systems, over FLATMEM. These systems have holes > - in their physical address spaces, and this option provides > - more efficient handling of these holes. > - > - Although "Discontiguous Memory" is still used by several > - architectures, it is considered deprecated in favor of > - "Sparse Memory". > - > - If unsure, choose "Sparse Memory" over this option. > - > config SPARSEMEM_MANUAL > bool "Sparse Memory" > depends on ARCH_SPARSEMEM_ENABLE > @@ -62,17 +47,13 @@ config SPARSEMEM_MANUAL > > endchoice > > -config DISCONTIGMEM > - def_bool y > - depends on (!SELECT_MEMORY_MODEL && ARCH_DISCONTIGMEM_ENABLE) || DISCONTIGMEM_MANUAL > - > config SPARSEMEM > def_bool y > depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL > > config FLATMEM > def_bool y > - depends on (!DISCONTIGMEM && !SPARSEMEM) || FLATMEM_MANUAL > + depends on !SPARSEMEM || FLATMEM_MANUAL > > config FLAT_NODE_MEM_MAP > def_bool y > @@ -85,7 +66,7 @@ config FLAT_NODE_MEM_MAP > # > config NEED_MULTIPLE_NODES > def_bool y > - depends on DISCONTIGMEM || NUMA > + depends on NUMA > > # > # SPARSEMEM_EXTREME (which is the default) does some bootmem > diff --git a/mm/memory.c b/mm/memory.c > index 730daa00952b..7c7b6ea02504 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -90,8 +90,7 @@ > #warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid. > #endif > > -#ifndef CONFIG_NEED_MULTIPLE_NODES > -/* use the per-pgdat data instead for discontigmem - mbligh */ > +#ifdef CONFIG_FLATMEM > unsigned long max_mapnr; > EXPORT_SYMBOL(max_mapnr); > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index aaa1655cf682..6fc22482eaa8 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -331,20 +331,7 @@ compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS] = { > > int min_free_kbytes = 1024; > int user_min_free_kbytes = -1; > -#ifdef CONFIG_DISCONTIGMEM > -/* > - * DiscontigMem defines memory ranges as separate pg_data_t even if the ranges > - * are not on separate NUMA nodes. Functionally this works but with > - * watermark_boost_factor, it can reclaim prematurely as the ranges can be > - * quite small. By default, do not boost watermarks on discontigmem as in > - * many cases very high-order allocations like THP are likely to be > - * unsupported and the premature reclaim offsets the advantage of long-term > - * fragmentation avoidance. > - */ > -int watermark_boost_factor __read_mostly; > -#else > int watermark_boost_factor __read_mostly = 15000; > -#endif > int watermark_scale_factor = 10; > > static unsigned long nr_kernel_pages __initdata; > Nice Acked-by: David Hildenbrand -- Thanks, David / dhildenb _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqvrd-00DAUp-QD for kexec@lists.infradead.org; Wed, 09 Jun 2021 10:55:15 +0000 Received: by mail-wr1-f71.google.com with SMTP id v15-20020a5d4a4f0000b0290118dc518878so10646613wrs.6 for ; Wed, 09 Jun 2021 03:55:09 -0700 (PDT) Subject: Re: [PATCH 5/9] mm: remove CONFIG_DISCONTIGMEM References: <20210602105348.13387-1-rppt@kernel.org> <20210602105348.13387-6-rppt@kernel.org> From: David Hildenbrand Message-ID: Date: Wed, 9 Jun 2021 12:55:04 +0200 MIME-Version: 1.0 In-Reply-To: <20210602105348.13387-6-rppt@kernel.org> Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Mike Rapoport , Andrew Morton Cc: Arnd Bergmann , Geert Uytterhoeven , Ivan Kokshaysky , Jonathan Corbet , Matt Turner , Mike Rapoport , Richard Henderson , Vineet Gupta , kexec@lists.infradead.org, linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org On 02.06.21 12:53, Mike Rapoport wrote: > From: Mike Rapoport > > There are no architectures that support DISCONTIGMEM left. > > Remove the configuration option and the dead code it was guarding in the > generic memory management code. > > Signed-off-by: Mike Rapoport > --- > include/asm-generic/memory_model.h | 37 ++++-------------------------- > include/linux/mmzone.h | 4 ++-- > mm/Kconfig | 25 +++----------------- > mm/memory.c | 3 +-- > mm/page_alloc.c | 13 ----------- > 5 files changed, 10 insertions(+), 72 deletions(-) > > diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h > index 7637fb46ba4f..a2c8ed60233a 100644 > --- a/include/asm-generic/memory_model.h > +++ b/include/asm-generic/memory_model.h > @@ -6,47 +6,18 @@ > > #ifndef __ASSEMBLY__ > > +/* > + * supports 3 memory models. > + */ > #if defined(CONFIG_FLATMEM) > > #ifndef ARCH_PFN_OFFSET > #define ARCH_PFN_OFFSET (0UL) > #endif > > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#ifndef arch_pfn_to_nid > -#define arch_pfn_to_nid(pfn) pfn_to_nid(pfn) > -#endif > - > -#ifndef arch_local_page_offset > -#define arch_local_page_offset(pfn, nid) \ > - ((pfn) - NODE_DATA(nid)->node_start_pfn) > -#endif > - > -#endif /* CONFIG_DISCONTIGMEM */ > - > -/* > - * supports 3 memory models. > - */ > -#if defined(CONFIG_FLATMEM) > - > #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET)) > #define __page_to_pfn(page) ((unsigned long)((page) - mem_map) + \ > ARCH_PFN_OFFSET) > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#define __pfn_to_page(pfn) \ > -({ unsigned long __pfn = (pfn); \ > - unsigned long __nid = arch_pfn_to_nid(__pfn); \ > - NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ > -}) > - > -#define __page_to_pfn(pg) \ > -({ const struct page *__pg = (pg); \ > - struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ > - (unsigned long)(__pg - __pgdat->node_mem_map) + \ > - __pgdat->node_start_pfn; \ > -}) > > #elif defined(CONFIG_SPARSEMEM_VMEMMAP) > > @@ -70,7 +41,7 @@ > struct mem_section *__sec = __pfn_to_section(__pfn); \ > __section_mem_map_addr(__sec) + __pfn; \ > }) > -#endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ > +#endif /* CONFIG_FLATMEM/SPARSEMEM */ > > /* > * Convert a physical address to a Page Frame Number and back > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 0d53eba1c383..2b41e252a995 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -738,8 +738,8 @@ struct zonelist { > struct zoneref _zonerefs[MAX_ZONES_PER_ZONELIST + 1]; > }; > > -#ifndef CONFIG_DISCONTIGMEM > -/* The array of struct pages - for discontigmem use pgdat->lmem_map */ > +#ifdef CONFIG_FLATMEM > +/* The array of struct pages for flatmem */ > extern struct page *mem_map; > #endif > > diff --git a/mm/Kconfig b/mm/Kconfig > index 02d44e3420f5..218b96ccc84a 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -19,7 +19,7 @@ choice > > config FLATMEM_MANUAL > bool "Flat Memory" > - depends on !(ARCH_DISCONTIGMEM_ENABLE || ARCH_SPARSEMEM_ENABLE) || ARCH_FLATMEM_ENABLE > + depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE > help > This option is best suited for non-NUMA systems with > flat address space. The FLATMEM is the most efficient > @@ -32,21 +32,6 @@ config FLATMEM_MANUAL > > If unsure, choose this option (Flat Memory) over any other. > > -config DISCONTIGMEM_MANUAL > - bool "Discontiguous Memory" > - depends on ARCH_DISCONTIGMEM_ENABLE > - help > - This option provides enhanced support for discontiguous > - memory systems, over FLATMEM. These systems have holes > - in their physical address spaces, and this option provides > - more efficient handling of these holes. > - > - Although "Discontiguous Memory" is still used by several > - architectures, it is considered deprecated in favor of > - "Sparse Memory". > - > - If unsure, choose "Sparse Memory" over this option. > - > config SPARSEMEM_MANUAL > bool "Sparse Memory" > depends on ARCH_SPARSEMEM_ENABLE > @@ -62,17 +47,13 @@ config SPARSEMEM_MANUAL > > endchoice > > -config DISCONTIGMEM > - def_bool y > - depends on (!SELECT_MEMORY_MODEL && ARCH_DISCONTIGMEM_ENABLE) || DISCONTIGMEM_MANUAL > - > config SPARSEMEM > def_bool y > depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL > > config FLATMEM > def_bool y > - depends on (!DISCONTIGMEM && !SPARSEMEM) || FLATMEM_MANUAL > + depends on !SPARSEMEM || FLATMEM_MANUAL > > config FLAT_NODE_MEM_MAP > def_bool y > @@ -85,7 +66,7 @@ config FLAT_NODE_MEM_MAP > # > config NEED_MULTIPLE_NODES > def_bool y > - depends on DISCONTIGMEM || NUMA > + depends on NUMA > > # > # SPARSEMEM_EXTREME (which is the default) does some bootmem > diff --git a/mm/memory.c b/mm/memory.c > index 730daa00952b..7c7b6ea02504 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -90,8 +90,7 @@ > #warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid. > #endif > > -#ifndef CONFIG_NEED_MULTIPLE_NODES > -/* use the per-pgdat data instead for discontigmem - mbligh */ > +#ifdef CONFIG_FLATMEM > unsigned long max_mapnr; > EXPORT_SYMBOL(max_mapnr); > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index aaa1655cf682..6fc22482eaa8 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -331,20 +331,7 @@ compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS] = { > > int min_free_kbytes = 1024; > int user_min_free_kbytes = -1; > -#ifdef CONFIG_DISCONTIGMEM > -/* > - * DiscontigMem defines memory ranges as separate pg_data_t even if the ranges > - * are not on separate NUMA nodes. Functionally this works but with > - * watermark_boost_factor, it can reclaim prematurely as the ranges can be > - * quite small. By default, do not boost watermarks on discontigmem as in > - * many cases very high-order allocations like THP are likely to be > - * unsupported and the premature reclaim offsets the advantage of long-term > - * fragmentation avoidance. > - */ > -int watermark_boost_factor __read_mostly; > -#else > int watermark_boost_factor __read_mostly = 15000; > -#endif > int watermark_scale_factor = 10; > > static unsigned long nr_kernel_pages __initdata; > Nice Acked-by: David Hildenbrand -- Thanks, David / dhildenb _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hildenbrand Date: Wed, 09 Jun 2021 10:55:04 +0000 Subject: Re: [PATCH 5/9] mm: remove CONFIG_DISCONTIGMEM Message-Id: List-Id: References: <20210602105348.13387-1-rppt@kernel.org> <20210602105348.13387-6-rppt@kernel.org> In-Reply-To: <20210602105348.13387-6-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Mike Rapoport , Andrew Morton Cc: Arnd Bergmann , Geert Uytterhoeven , Ivan Kokshaysky , Jonathan Corbet , Matt Turner , Mike Rapoport , Richard Henderson , Vineet Gupta , kexec@lists.infradead.org, linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org On 02.06.21 12:53, Mike Rapoport wrote: > From: Mike Rapoport > > There are no architectures that support DISCONTIGMEM left. > > Remove the configuration option and the dead code it was guarding in the > generic memory management code. > > Signed-off-by: Mike Rapoport > --- > include/asm-generic/memory_model.h | 37 ++++-------------------------- > include/linux/mmzone.h | 4 ++-- > mm/Kconfig | 25 +++----------------- > mm/memory.c | 3 +-- > mm/page_alloc.c | 13 ----------- > 5 files changed, 10 insertions(+), 72 deletions(-) > > diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h > index 7637fb46ba4f..a2c8ed60233a 100644 > --- a/include/asm-generic/memory_model.h > +++ b/include/asm-generic/memory_model.h > @@ -6,47 +6,18 @@ > > #ifndef __ASSEMBLY__ > > +/* > + * supports 3 memory models. > + */ > #if defined(CONFIG_FLATMEM) > > #ifndef ARCH_PFN_OFFSET > #define ARCH_PFN_OFFSET (0UL) > #endif > > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#ifndef arch_pfn_to_nid > -#define arch_pfn_to_nid(pfn) pfn_to_nid(pfn) > -#endif > - > -#ifndef arch_local_page_offset > -#define arch_local_page_offset(pfn, nid) \ > - ((pfn) - NODE_DATA(nid)->node_start_pfn) > -#endif > - > -#endif /* CONFIG_DISCONTIGMEM */ > - > -/* > - * supports 3 memory models. > - */ > -#if defined(CONFIG_FLATMEM) > - > #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET)) > #define __page_to_pfn(page) ((unsigned long)((page) - mem_map) + \ > ARCH_PFN_OFFSET) > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#define __pfn_to_page(pfn) \ > -({ unsigned long __pfn = (pfn); \ > - unsigned long __nid = arch_pfn_to_nid(__pfn); \ > - NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ > -}) > - > -#define __page_to_pfn(pg) \ > -({ const struct page *__pg = (pg); \ > - struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ > - (unsigned long)(__pg - __pgdat->node_mem_map) + \ > - __pgdat->node_start_pfn; \ > -}) > > #elif defined(CONFIG_SPARSEMEM_VMEMMAP) > > @@ -70,7 +41,7 @@ > struct mem_section *__sec = __pfn_to_section(__pfn); \ > __section_mem_map_addr(__sec) + __pfn; \ > }) > -#endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ > +#endif /* CONFIG_FLATMEM/SPARSEMEM */ > > /* > * Convert a physical address to a Page Frame Number and back > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 0d53eba1c383..2b41e252a995 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -738,8 +738,8 @@ struct zonelist { > struct zoneref _zonerefs[MAX_ZONES_PER_ZONELIST + 1]; > }; > > -#ifndef CONFIG_DISCONTIGMEM > -/* The array of struct pages - for discontigmem use pgdat->lmem_map */ > +#ifdef CONFIG_FLATMEM > +/* The array of struct pages for flatmem */ > extern struct page *mem_map; > #endif > > diff --git a/mm/Kconfig b/mm/Kconfig > index 02d44e3420f5..218b96ccc84a 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -19,7 +19,7 @@ choice > > config FLATMEM_MANUAL > bool "Flat Memory" > - depends on !(ARCH_DISCONTIGMEM_ENABLE || ARCH_SPARSEMEM_ENABLE) || ARCH_FLATMEM_ENABLE > + depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE > help > This option is best suited for non-NUMA systems with > flat address space. The FLATMEM is the most efficient > @@ -32,21 +32,6 @@ config FLATMEM_MANUAL > > If unsure, choose this option (Flat Memory) over any other. > > -config DISCONTIGMEM_MANUAL > - bool "Discontiguous Memory" > - depends on ARCH_DISCONTIGMEM_ENABLE > - help > - This option provides enhanced support for discontiguous > - memory systems, over FLATMEM. These systems have holes > - in their physical address spaces, and this option provides > - more efficient handling of these holes. > - > - Although "Discontiguous Memory" is still used by several > - architectures, it is considered deprecated in favor of > - "Sparse Memory". > - > - If unsure, choose "Sparse Memory" over this option. > - > config SPARSEMEM_MANUAL > bool "Sparse Memory" > depends on ARCH_SPARSEMEM_ENABLE > @@ -62,17 +47,13 @@ config SPARSEMEM_MANUAL > > endchoice > > -config DISCONTIGMEM > - def_bool y > - depends on (!SELECT_MEMORY_MODEL && ARCH_DISCONTIGMEM_ENABLE) || DISCONTIGMEM_MANUAL > - > config SPARSEMEM > def_bool y > depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL > > config FLATMEM > def_bool y > - depends on (!DISCONTIGMEM && !SPARSEMEM) || FLATMEM_MANUAL > + depends on !SPARSEMEM || FLATMEM_MANUAL > > config FLAT_NODE_MEM_MAP > def_bool y > @@ -85,7 +66,7 @@ config FLAT_NODE_MEM_MAP > # > config NEED_MULTIPLE_NODES > def_bool y > - depends on DISCONTIGMEM || NUMA > + depends on NUMA > > # > # SPARSEMEM_EXTREME (which is the default) does some bootmem > diff --git a/mm/memory.c b/mm/memory.c > index 730daa00952b..7c7b6ea02504 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -90,8 +90,7 @@ > #warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid. > #endif > > -#ifndef CONFIG_NEED_MULTIPLE_NODES > -/* use the per-pgdat data instead for discontigmem - mbligh */ > +#ifdef CONFIG_FLATMEM > unsigned long max_mapnr; > EXPORT_SYMBOL(max_mapnr); > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index aaa1655cf682..6fc22482eaa8 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -331,20 +331,7 @@ compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS] = { > > int min_free_kbytes = 1024; > int user_min_free_kbytes = -1; > -#ifdef CONFIG_DISCONTIGMEM > -/* > - * DiscontigMem defines memory ranges as separate pg_data_t even if the ranges > - * are not on separate NUMA nodes. Functionally this works but with > - * watermark_boost_factor, it can reclaim prematurely as the ranges can be > - * quite small. By default, do not boost watermarks on discontigmem as in > - * many cases very high-order allocations like THP are likely to be > - * unsupported and the premature reclaim offsets the advantage of long-term > - * fragmentation avoidance. > - */ > -int watermark_boost_factor __read_mostly; > -#else > int watermark_boost_factor __read_mostly = 15000; > -#endif > int watermark_scale_factor = 10; > > static unsigned long nr_kernel_pages __initdata; > Nice Acked-by: David Hildenbrand -- Thanks, David / dhildenb From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hildenbrand Subject: Re: [PATCH 5/9] mm: remove CONFIG_DISCONTIGMEM Date: Wed, 9 Jun 2021 12:55:04 +0200 Message-ID: References: <20210602105348.13387-1-rppt@kernel.org> <20210602105348.13387-6-rppt@kernel.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623236110; 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=benEkoYiyJABYdMW95hQGiXtSU/C1XePwCmkHhtvx1g=; b=PaNnjs6ibUg2dwjRwpZK3wVXVNgdJHJo6Ls5EGV6lHp3DQ9yO5eOStmU5wCgwGweoio8QG CJQaEbBRek6Ew6+zPEVH9PpFrqaz9dmXafmSuP8+e3qLB4csy0S8Bj48mBLaQnj5JjIfVE T6lD5VDbMtCrSW04O05+VWQYQ48tDIQ= In-Reply-To: <20210602105348.13387-6-rppt@kernel.org> Content-Language: en-US List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Mike Rapoport , Andrew Morton Cc: Arnd Bergmann , Geert Uytterhoeven , Ivan Kokshaysky , Jonathan Corbet , Matt Turner , Mike Rapoport , Richard Henderson , Vineet Gupta , kexec@lists.infradead.org, linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, sparclin On 02.06.21 12:53, Mike Rapoport wrote: > From: Mike Rapoport > > There are no architectures that support DISCONTIGMEM left. > > Remove the configuration option and the dead code it was guarding in the > generic memory management code. > > Signed-off-by: Mike Rapoport > --- > include/asm-generic/memory_model.h | 37 ++++-------------------------- > include/linux/mmzone.h | 4 ++-- > mm/Kconfig | 25 +++----------------- > mm/memory.c | 3 +-- > mm/page_alloc.c | 13 ----------- > 5 files changed, 10 insertions(+), 72 deletions(-) > > diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h > index 7637fb46ba4f..a2c8ed60233a 100644 > --- a/include/asm-generic/memory_model.h > +++ b/include/asm-generic/memory_model.h > @@ -6,47 +6,18 @@ > > #ifndef __ASSEMBLY__ > > +/* > + * supports 3 memory models. > + */ > #if defined(CONFIG_FLATMEM) > > #ifndef ARCH_PFN_OFFSET > #define ARCH_PFN_OFFSET (0UL) > #endif > > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#ifndef arch_pfn_to_nid > -#define arch_pfn_to_nid(pfn) pfn_to_nid(pfn) > -#endif > - > -#ifndef arch_local_page_offset > -#define arch_local_page_offset(pfn, nid) \ > - ((pfn) - NODE_DATA(nid)->node_start_pfn) > -#endif > - > -#endif /* CONFIG_DISCONTIGMEM */ > - > -/* > - * supports 3 memory models. > - */ > -#if defined(CONFIG_FLATMEM) > - > #define __pfn_to_page(pfn) (mem_map + ((pfn) - ARCH_PFN_OFFSET)) > #define __page_to_pfn(page) ((unsigned long)((page) - mem_map) + \ > ARCH_PFN_OFFSET) > -#elif defined(CONFIG_DISCONTIGMEM) > - > -#define __pfn_to_page(pfn) \ > -({ unsigned long __pfn = (pfn); \ > - unsigned long __nid = arch_pfn_to_nid(__pfn); \ > - NODE_DATA(__nid)->node_mem_map + arch_local_page_offset(__pfn, __nid);\ > -}) > - > -#define __page_to_pfn(pg) \ > -({ const struct page *__pg = (pg); \ > - struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ > - (unsigned long)(__pg - __pgdat->node_mem_map) + \ > - __pgdat->node_start_pfn; \ > -}) > > #elif defined(CONFIG_SPARSEMEM_VMEMMAP) > > @@ -70,7 +41,7 @@ > struct mem_section *__sec = __pfn_to_section(__pfn); \ > __section_mem_map_addr(__sec) + __pfn; \ > }) > -#endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ > +#endif /* CONFIG_FLATMEM/SPARSEMEM */ > > /* > * Convert a physical address to a Page Frame Number and back > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 0d53eba1c383..2b41e252a995 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -738,8 +738,8 @@ struct zonelist { > struct zoneref _zonerefs[MAX_ZONES_PER_ZONELIST + 1]; > }; > > -#ifndef CONFIG_DISCONTIGMEM > -/* The array of struct pages - for discontigmem use pgdat->lmem_map */ > +#ifdef CONFIG_FLATMEM > +/* The array of struct pages for flatmem */ > extern struct page *mem_map; > #endif > > diff --git a/mm/Kconfig b/mm/Kconfig > index 02d44e3420f5..218b96ccc84a 100644 > --- a/mm/Kconfig > +++ b/mm/Kconfig > @@ -19,7 +19,7 @@ choice > > config FLATMEM_MANUAL > bool "Flat Memory" > - depends on !(ARCH_DISCONTIGMEM_ENABLE || ARCH_SPARSEMEM_ENABLE) || ARCH_FLATMEM_ENABLE > + depends on !ARCH_SPARSEMEM_ENABLE || ARCH_FLATMEM_ENABLE > help > This option is best suited for non-NUMA systems with > flat address space. The FLATMEM is the most efficient > @@ -32,21 +32,6 @@ config FLATMEM_MANUAL > > If unsure, choose this option (Flat Memory) over any other. > > -config DISCONTIGMEM_MANUAL > - bool "Discontiguous Memory" > - depends on ARCH_DISCONTIGMEM_ENABLE > - help > - This option provides enhanced support for discontiguous > - memory systems, over FLATMEM. These systems have holes > - in their physical address spaces, and this option provides > - more efficient handling of these holes. > - > - Although "Discontiguous Memory" is still used by several > - architectures, it is considered deprecated in favor of > - "Sparse Memory". > - > - If unsure, choose "Sparse Memory" over this option. > - > config SPARSEMEM_MANUAL > bool "Sparse Memory" > depends on ARCH_SPARSEMEM_ENABLE > @@ -62,17 +47,13 @@ config SPARSEMEM_MANUAL > > endchoice > > -config DISCONTIGMEM > - def_bool y > - depends on (!SELECT_MEMORY_MODEL && ARCH_DISCONTIGMEM_ENABLE) || DISCONTIGMEM_MANUAL > - > config SPARSEMEM > def_bool y > depends on (!SELECT_MEMORY_MODEL && ARCH_SPARSEMEM_ENABLE) || SPARSEMEM_MANUAL > > config FLATMEM > def_bool y > - depends on (!DISCONTIGMEM && !SPARSEMEM) || FLATMEM_MANUAL > + depends on !SPARSEMEM || FLATMEM_MANUAL > > config FLAT_NODE_MEM_MAP > def_bool y > @@ -85,7 +66,7 @@ config FLAT_NODE_MEM_MAP > # > config NEED_MULTIPLE_NODES > def_bool y > - depends on DISCONTIGMEM || NUMA > + depends on NUMA > > # > # SPARSEMEM_EXTREME (which is the default) does some bootmem > diff --git a/mm/memory.c b/mm/memory.c > index 730daa00952b..7c7b6ea02504 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -90,8 +90,7 @@ > #warning Unfortunate NUMA and NUMA Balancing config, growing page-frame for last_cpupid. > #endif > > -#ifndef CONFIG_NEED_MULTIPLE_NODES > -/* use the per-pgdat data instead for discontigmem - mbligh */ > +#ifdef CONFIG_FLATMEM > unsigned long max_mapnr; > EXPORT_SYMBOL(max_mapnr); > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index aaa1655cf682..6fc22482eaa8 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -331,20 +331,7 @@ compound_page_dtor * const compound_page_dtors[NR_COMPOUND_DTORS] = { > > int min_free_kbytes = 1024; > int user_min_free_kbytes = -1; > -#ifdef CONFIG_DISCONTIGMEM > -/* > - * DiscontigMem defines memory ranges as separate pg_data_t even if the ranges > - * are not on separate NUMA nodes. Functionally this works but with > - * watermark_boost_factor, it can reclaim prematurely as the ranges can be > - * quite small. By default, do not boost watermarks on discontigmem as in > - * many cases very high-order allocations like THP are likely to be > - * unsupported and the premature reclaim offsets the advantage of long-term > - * fragmentation avoidance. > - */ > -int watermark_boost_factor __read_mostly; > -#else > int watermark_boost_factor __read_mostly = 15000; > -#endif > int watermark_scale_factor = 10; > > static unsigned long nr_kernel_pages __initdata; > Nice Acked-by: David Hildenbrand -- Thanks, David / dhildenb