linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] mm/page_alloc: remove duplicated include from page_alloc.c
@ 2021-03-26  2:55 Qinglang Miao
  2021-03-26  3:42 ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Qinglang Miao @ 2021-03-26  2:55 UTC (permalink / raw)
  To: miaoqinglang, Andrew Morton
  Cc: linux-mm, linux-kernel, kernel-janitors, Hulk Robot

Remove duplicated include.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
 mm/page_alloc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index c53fe4fa10bf..e51826c87a0b 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -72,7 +72,6 @@
 #include <linux/padata.h>
 #include <linux/khugepaged.h>
 #include <linux/buffer_head.h>
-#include <linux/vmalloc.h>
 
 #include <asm/sections.h>
 #include <asm/tlbflush.h>



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] mm/page_alloc: remove duplicated include from page_alloc.c
  2021-03-26  2:55 [PATCH -next] mm/page_alloc: remove duplicated include from page_alloc.c Qinglang Miao
@ 2021-03-26  3:42 ` Matthew Wilcox
  2021-03-26  8:18   ` Qinglang Miao
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2021-03-26  3:42 UTC (permalink / raw)
  To: Qinglang Miao
  Cc: Andrew Morton, linux-mm, linux-kernel, kernel-janitors, Hulk Robot

On Fri, Mar 26, 2021 at 10:55:42AM +0800, Qinglang Miao wrote:
> Remove duplicated include.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>

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?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] mm/page_alloc: remove duplicated include from page_alloc.c
  2021-03-26  3:42 ` Matthew Wilcox
@ 2021-03-26  8:18   ` Qinglang Miao
  2021-03-26 12:27     ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Qinglang Miao @ 2021-03-26  8:18 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Andrew Morton, linux-mm, linux-kernel, kernel-janitors, Hulk Robot

Hey, Matthew

Thanks for your advice towards hulk robot. We'd like to improve the 
capbility of hulk robot whole the time.

This patch is just a small cleanup reported by hulk robot, But the robot 
can do more than this. For example, it finds crucial and useful bugs as 
well.

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.


在 2021/3/26 11:42, Matthew Wilcox 写道:
> On Fri, Mar 26, 2021 at 10:55:42AM +0800, Qinglang Miao wrote:
>> Remove duplicated include.
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
> 
> 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?
> .
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] mm/page_alloc: remove duplicated include from page_alloc.c
  2021-03-26  8:18   ` Qinglang Miao
@ 2021-03-26 12:27     ` Matthew Wilcox
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2021-03-26 12:27 UTC (permalink / raw)
  To: Qinglang Miao
  Cc: Andrew Morton, linux-mm, linux-kernel, kernel-janitors, Hulk Robot

On Fri, Mar 26, 2021 at 04:18:38PM +0800, Qinglang Miao wrote:
> Hey, Matthew
> 
> Thanks for your advice towards hulk robot. We'd like to improve the
> capbility of hulk robot whole the time.
> 
> This patch is just a small cleanup reported by hulk robot, But the robot can
> do more than this. For example, it finds crucial and useful bugs as well.

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 is
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.

> 在 2021/3/26 11:42, Matthew Wilcox 写道:
> > On Fri, Mar 26, 2021 at 10:55:42AM +0800, Qinglang Miao wrote:
> > > Remove duplicated include.
> > > 
> > > Reported-by: Hulk Robot <hulkci@huawei.com>
> > > Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
> > 
> > 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?
> > .
> > 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-26 12:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26  2:55 [PATCH -next] mm/page_alloc: remove duplicated include from page_alloc.c Qinglang Miao
2021-03-26  3:42 ` Matthew Wilcox
2021-03-26  8:18   ` Qinglang Miao
2021-03-26 12:27     ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).