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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 D01E7C433C1 for ; Fri, 26 Mar 2021 12:27:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EE6216191F for ; Fri, 26 Mar 2021 12:27:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE6216191F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E2CB66B0072; Fri, 26 Mar 2021 08:27:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DCA966B0073; Fri, 26 Mar 2021 08:27:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C95BF6B0074; Fri, 26 Mar 2021 08:27:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0227.hostedemail.com [216.40.44.227]) by kanga.kvack.org (Postfix) with ESMTP id AC3566B0072 for ; Fri, 26 Mar 2021 08:27:36 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 6F650482A for ; Fri, 26 Mar 2021 12:27:36 +0000 (UTC) X-FDA: 77961951312.31.36B6D48 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf04.hostedemail.com (Postfix) with ESMTP id 0FAE13C1 for ; Fri, 26 Mar 2021 12:27:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=QxJHG67cnzAtp1qB+aYyj2WZtARO+XJmoqLkBw1fYTc=; b=L4C7D/iPJwNEbqcG8xy4WpMw5n BDecPJA0uQZuls/0/G6uBNfjaVsne8JK4g9DymhDULa+eE/btqy5hDts7uILquN4NfBruQ7m6EygX uWFIPixKNNiLamhYLsHw1z2qRKsswDbAFiY8guxFj1j7+XhVZ/+Ne3MKO0lrFlLhviJk0ieIkb5iw nTTZrkFH6Vb3euOOrFUWyGvV9L7lPH4LKeEy/tDHKU7wlaS6J37Ny5jh7srf6YMpq6M2SVKHchBie +F9XhvGqXqFXL+7/CYEpUX4V3YRUzD3SLO2iT79Z0cqJgDLw0j4ODKCeGop1vldaRMNCK4PGzPKGi IpW8DCOQ==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lPlYb-00En34-Ov; Fri, 26 Mar 2021 12:27:25 +0000 Date: Fri, 26 Mar 2021 12:27:17 +0000 From: Matthew Wilcox To: Qinglang Miao Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Hulk Robot Subject: Re: [PATCH -next] mm/page_alloc: remove duplicated include from page_alloc.c Message-ID: <20210326122717.GE1719932@casper.infradead.org> References: <20210326025542.3565329-1-miaoqinglang@huawei.com> <20210326034208.GC1719932@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 0FAE13C1 X-Stat-Signature: qqq6jjhewsdwy5rbfdufkkfumhc6xfkm Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf04; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616761653-415214 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Mar 26, 2021 at 04:18:38PM +0800, Qinglang Miao wrote: > Hey, Matthew >=20 > Thanks for your advice towards hulk robot. We'd like to improve the > capbility of hulk robot whole the time. >=20 > This patch is just a small cleanup reported by hulk robot, But the robo= t can > do more than this. For example, it finds crucial and useful bugs as wel= l. I'll have to take your word for it. Most of what I see from Hulk Robot is trivialities. > As for 'Untangle the mass of header includes' you mentioned, could you > please offer more details? Because I didn't find pagemap.h in net/ipv4/= tcp.c > in -next like what you said. Exactly! But check net/ipv4/.tcp.o.d -- you'll see include/linux/pagemap= .h in its dependencies. So it's being pulled in through another file that i= s included by tcp.c, either directly or indirectly. You can run a file through the preprocessor: $ make net/ipv4/tcp.i CPP net/ipv4/tcp.i and then look to see what included it: # 12 "../include/linux/swap.h" 2 # 1 "../include/linux/pagemap.h" 1 So the question then becomes _either_ "Does swap.h need pagemap.h?", _or_ "Does tcp.c need swap.h" So we can try both things, first deleting the include of pagemap.h from swap.h (compilation fails) and then deleting the include of swap.h from tcp.c (compilation also fails). This is a simple example because swap.h is included directly from tcp.c; the chain can be quite long. Some human intervention at this point might be possible. For example, nr_free_buffer_pages could be exposed through mm.h instead of swap.h, and then tcp.c wouldn't need swap.h. Or find_get_incore_page() could be moved from swap.h to pagemap.h and then swap.h wouldn't need pagemap.h. But then pagemap.h would acquire a dependency on CONFIG_SWAP (if it doesn't have that already). I don't think those are reasonable solutions for a bot to find. Or are they? Anyway, I'm sure there are a lot of obsolete includes. I have a patch sitting in my tree which removed pagemap.h from mempolicy.h. That causes a build failure in fs/aio.c, so the same patch adds pagemap.h to aio.c. It's not a particularly large win; only 5 files lose a dependency on pagemap.h, so I haven't decided what to do with it yet. > =E5=9C=A8 2021/3/26 11:42, Matthew Wilcox =E5=86=99=E9=81=93: > > On Fri, Mar 26, 2021 at 10:55:42AM +0800, Qinglang Miao wrote: > > > Remove duplicated include. > > >=20 > > > Reported-by: Hulk Robot > > > Signed-off-by: Qinglang Miao > >=20 > > can't you make hulk robot do something useful, like untangle the > > mass of header includes? For example, in -next, net/ipv4/tcp.c > > has a dependency on pagemap.h. Why? > > . > >=20 >=20