From patchwork Sun Aug 15 11:50:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mianhan Liu X-Patchwork-Id: 12437205 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DA1AC4338F for ; Sun, 15 Aug 2021 11:52:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0698861038 for ; Sun, 15 Aug 2021 11:52:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0698861038 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=shanghaitech.edu.cn Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 34A028D0001; Sun, 15 Aug 2021 07:52:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2FB7F6B0073; Sun, 15 Aug 2021 07:52:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 20FA48D0001; Sun, 15 Aug 2021 07:52:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0206.hostedemail.com [216.40.44.206]) by kanga.kvack.org (Postfix) with ESMTP id 04A5C6B0072 for ; Sun, 15 Aug 2021 07:52:19 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 90FBF8249980 for ; Sun, 15 Aug 2021 11:52:19 +0000 (UTC) X-FDA: 78477151998.01.A8124FB Received: from mail.shanghaitech.edu.cn (mail1.shanghaitech.edu.cn [119.78.254.90]) by imf24.hostedemail.com (Postfix) with ESMTP id 8CA37B007B0A for ; Sun, 15 Aug 2021 11:52:17 +0000 (UTC) Received: from [10.15.44.216] by mail.shanghaitech.edu.cn with MESSAGESEC ESMTP id 7712015506132; Sun, 15 Aug 2021 19:51:51 +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, 15 Aug 2021 19:51:53 +0800 From: Mianhan Liu To: Andrew Morton CC: , , Eric Dumazet , Mianhan Liu Subject: [PATCH -next v2] include/linux/mm.h: move nr_free_buffer_pages from swap.h to mm.h Date: Sun, 15 Aug 2021 19:50:57 +0800 Message-ID: <20210815115057.1511-1-liumh1@shanghaitech.edu.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.15.44.220] X-Rspamd-Queue-Id: 8CA37B007B0A Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=shanghaitech.edu.cn; spf=pass (imf24.hostedemail.com: domain of liumh1@shanghaitech.edu.cn designates 119.78.254.90 as permitted sender) smtp.mailfrom=liumh1@shanghaitech.edu.cn X-Rspamd-Server: rspam04 X-Stat-Signature: dqysnc1m1qkqjwks4qafw5ngasautaaj X-HE-Tag: 1629028337-802484 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. 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 --- include/linux/mm.h | 1 + include/linux/swap.h | 2 +- net/ipv4/tcp.c | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index ce8fc0fd6..6ca7b7fba 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -871,6 +871,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); +extern 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..22b17431a 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -341,7 +341,7 @@ 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 f931def63..dcdd8ebfb 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -260,7 +260,6 @@ #include #include #include -#include #include #include #include