Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp933796pxy; Sun, 15 Aug 2021 04:56:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzftDFpCSQ2Mpb5QwfC2D9VvdWSjfo2pg1m3fuifwEPIhddRq8OBG2nh3gxEqI1C4THlfon X-Received: by 2002:a17:906:684e:: with SMTP id a14mr11322262ejs.440.1629028602511; Sun, 15 Aug 2021 04:56:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629028602; cv=none; d=google.com; s=arc-20160816; b=tIa4SXvIQEmlPTAn1B523XfSGVJaJ41ZY0ldy7ov5Ptxkg83qHdoQyzwyJWai5/+sf T68+KSdrV7tHO46xWxL1PmKY7czj++z1spZB/srXnB2FVxyVRvHTSkb4LO3GCgJ28hNO /lwsuTTx/MdKHS+P0eUjHqsSlZPpah9AIPcJpJt4SFUJGOJUcmQr7gvR00cQzZr6BVx5 nJ9NKiePJ2IGOSsXwlHkAyiKP5JTkuPcHLkLCrY56L4yMBnvlzst176G7u/vFjMy+d0W gd5fV5oz1dlGVdCOmTx7Jwt5E2n1LdfkoWL6mL156No5PDl5auEC05Y8WjUVrU0XFqHp 8PUw== 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=VeZC4ruYZR8WmyV93uptbI6FJu/9hlFCnO7EtUEw4w0=; b=bVM3IlqQr8PvnSDDyDzosu+4omCvukSeAxdt7uoTeClHABb8coqfx8Mh9NTtJrU4ly B25Iob7SXSTpNdhzGOucj9FlBzQNbyIUsDt4SUxtYiHgaZtRb9Plnzyc9iSPvJRPU5P7 D0FVr8u5tvGyw1xRJUnDHCNjXX8GQQIqxPmySw6i8ftPo+9/b5m6h7ELSbZ88585yof1 SJDlIvYoNAiP+JQ2vMg3EuesSZMGsoTMHz0ruadkQzX8N6IH1dYf2I+Ccac6RARwyalu mWz+/nksfdQ+mTqoXwV2fzHgNref/E6zPdkyycHRgAfPqVTsTWRZ6zgiNSjUO6ks4vqS Q2IQ== 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 g17si1844269edb.536.2021.08.15.04.56.19; Sun, 15 Aug 2021 04:56:42 -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 S237424AbhHOLwl convert rfc822-to-8bit (ORCPT + 99 others); Sun, 15 Aug 2021 07:52:41 -0400 Received: from mail1.shanghaitech.edu.cn ([119.78.254.90]:4759 "EHLO mail.shanghaitech.edu.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229597AbhHOLwl (ORCPT ); Sun, 15 Aug 2021 07:52:41 -0400 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 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. 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 -- 2.25.1