Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1055160pxb; Sun, 12 Sep 2021 06:38:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOSMqFyZAfg8f1BcCECJsPRtWBgmKtreZxStFlIoznDoWeBw6uf+mkIgrtnbyAV8NbC6j+ X-Received: by 2002:a92:ddcc:: with SMTP id d12mr4853014ilr.187.1631453916919; Sun, 12 Sep 2021 06:38:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631453916; cv=none; d=google.com; s=arc-20160816; b=VsCkiAKhwBhy4RQMDlPZLnlJxS5/ZIYSiCevUdR5oXJWzq0YjE3JtU3cGrrDwtoJXx 4XwdZ9zA3HXj2ydF6HeIqq504Wcf+8cIOxs8rstYRiUOlszmzq4sxYnzZNFhn9vgQ9aN 2b9+mJxrOAtL1OuOtJo28t2ZgBpDa7X9ATCnGdso2zLN3QGmP0Slf5Q3YVSo6y7k/jaV 26+TQ3lkooC2hIAVx1f9BM1Ji+1tUjzsXHyl3rLfHTpo9ThkeYmfp9jo+wfILE+ZELmr 4Y1uxlNyxcmjhXVQjt/i+zwycdk4fJqs581LFVIwWmbec0hjivFRHhoTmWONdgBS34mR /Fqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=/4kH5X8y28nx0QDW/RQKk/i1xZKmLxtoPZMBOSfstkY=; b=cm6rDHwiXI4SExvDZyAEXsexoZK0AA//vcL1mrTMvyZuPhxw+/my4RID+zPPH5OvgT pydPVlHANwvtQ00bHL10lFDnkrL57AdzdZ6eiE3qqySE2JpqnXcLcqVkWXMUAQ7CO69g 088M6/I48AU8SJ/WxslrE/j2f9git29JY0sGJPuO2tgGxf4npdxnrleO6TULUQRYf24Y pd33Ro9v758IYL2Axol6zkRqJzUnGUIXccF43/VQVyddJkPIojJA+zUsPP2Lu1NY8JLq xM/B+kiyEda+CgI/mIfacY3HA9sMeZ7ni8h0ZlRKqPtB+a603/unSAtAJdjuZi6xCy0u kNfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=shanghaitech.edu.cn Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si4499969ilu.99.2021.09.12.06.38.23; Sun, 12 Sep 2021 06:38:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=shanghaitech.edu.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235454AbhILNiy convert rfc822-to-8bit (ORCPT + 99 others); Sun, 12 Sep 2021 09:38:54 -0400 Received: from mail.shanghaitech.edu.cn ([119.78.254.11]:39017 "EHLO mail.shanghaitech.edu.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235291AbhILNiw (ORCPT ); Sun, 12 Sep 2021 09:38:52 -0400 Received: from [10.15.44.216] by mail.shanghaitech.edu.cn with MESSAGESEC ESMTP id 4804012443630103; Sun, 12 Sep 2021 21:37:16 +0800 (CST) Received: from DESKTOP-U066CHB.localdomain (10.15.44.220) by smtp.shanghaitech.edu.cn (10.15.44.216) with Microsoft SMTP Server (TLS) id 14.3.399.0; Sun, 12 Sep 2021 21:37:16 +0800 From: Mianhan Liu To: Andrew Morton , Jakub Kicinski CC: Ulf Hansson , "David S . Miller" , Simon Horman , Pravin B Shelar , Vlad Yasevich , Marcelo Ricardo Leitner , , , Matthew Wilcox , Mianhan Liu Subject: [PATCH -next v3] include/linux/mm.h: move nr_free_buffer_pages from swap.h to mm.h Date: Sun, 12 Sep 2021 21:36:40 +0800 Message-ID: <20210912133640.1624-1-liumh1@shanghaitech.edu.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain X-Originating-IP: [10.15.44.220] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org nr_free_buffer_pages could be exposed through mm.h instead of swap.h. The advantage of this change is that it can reduce the obsolete includes. For example, net/ipv4/tcp.c wouldn't need swap.h any more since it has already included mm.h. Similarly, after checking all the other files, it comes that tcp.c, udp.c meter.c ,... follow the same rule, so these files can have swap.h removed too. Moreover, after preprocessing all the files that use nr_free_buffer_pages, it turns out that those files have already included mm.h.Thus, we can move nr_free_buffer_pages from swap.h to mm.h safely. This change will not affect the compilation of other files. Signed-off-by: Mianhan Liu --- drivers/mmc/core/mmc_test.c | 1 - include/linux/mm.h | 2 +- include/linux/swap.h | 1 - net/ipv4/tcp.c | 1 - net/ipv4/udp.c | 1 - net/netfilter/ipvs/ip_vs_ctl.c | 1 - net/openvswitch/meter.c | 1 - net/sctp/protocol.c | 1 - 8 files changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c index 63524551a..e6a2fd2c6 100644 --- a/drivers/mmc/core/mmc_test.c +++ b/drivers/mmc/core/mmc_test.c @@ -10,7 +10,6 @@ #include #include -#include /* For nr_free_buffer_pages() */ #include #include diff --git a/include/linux/mm.h b/include/linux/mm.h index d0b5c5e19..d499fde70 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -869,7 +869,7 @@ void put_pages_list(struct list_head *pages); void split_page(struct page *page, unsigned int order); void folio_copy(struct folio *dst, struct folio *src); - +unsigned long nr_free_buffer_pages(void); /* * Compound pages have a destructor function. Provide a * prototype for that function and accessor functions. diff --git a/include/linux/swap.h b/include/linux/swap.h index cdf0957a8..d1ea44b31 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -341,7 +341,6 @@ void workingset_update_node(struct xa_node *node); /* linux/mm/page_alloc.c */ extern unsigned long totalreserve_pages; -extern unsigned long nr_free_buffer_pages(void); /* Definition of global_zone_page_state not available yet */ #define nr_free_pages() global_zone_page_state(NR_FREE_PAGES) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index e8b48df73..0109279df 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -260,7 +260,6 @@ #include #include #include -#include #include #include #include diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 8851c9463..c99983b43 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -78,7 +78,6 @@ #include #include #include -#include #include #include #include diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index c25097092..034e537bb 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c index 896b8f5bc..04a060ac7 100644 --- a/net/openvswitch/meter.c +++ b/net/openvswitch/meter.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index ec0f52567..35928fefa 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include -- 2.25.1