linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] include: Remove pagemap.h from blkdev.h
@ 2021-03-09 19:57 Matthew Wilcox (Oracle)
  2021-03-09 20:47 ` Dan Williams
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Matthew Wilcox (Oracle) @ 2021-03-09 19:57 UTC (permalink / raw)
  To: Andrew Morton, linux-mm
  Cc: Matthew Wilcox (Oracle),
	linux-block, linux-kernel, linux-bcache, linux-nvdimm,
	linux-scsi

My UEK-derived config has 1030 files depending on pagemap.h before
this change.  Afterwards, just 326 files need to be rebuilt when I
touch pagemap.h.  I think blkdev.h is probably included too widely,
but untangling that dependency is harder and this solves my problem.
x86 allmodconfig builds, but there may be implicit include problems
on other architectures.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
v2: Fix CONFIG_SWAP=n implicit use of pagemap.h by swap.h.  Increases
    the number of files from 240, but that's still a big win -- 68%
    reduction instead of 77%.

 block/blk-settings.c      | 1 +
 drivers/block/brd.c       | 1 +
 drivers/block/loop.c      | 1 +
 drivers/md/bcache/super.c | 1 +
 drivers/nvdimm/btt.c      | 1 +
 drivers/nvdimm/pmem.c     | 1 +
 drivers/scsi/scsicam.c    | 1 +
 include/linux/blkdev.h    | 1 -
 include/linux/swap.h      | 1 +
 9 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/block/blk-settings.c b/block/blk-settings.c
index b4aa2f37fab6..976085a44fb8 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -7,6 +7,7 @@
 #include <linux/init.h>
 #include <linux/bio.h>
 #include <linux/blkdev.h>
+#include <linux/pagemap.h>
 #include <linux/memblock.h>	/* for max_pfn/max_low_pfn */
 #include <linux/gcd.h>
 #include <linux/lcm.h>
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 18bf99906662..2a5a1933826b 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -18,6 +18,7 @@
 #include <linux/bio.h>
 #include <linux/highmem.h>
 #include <linux/mutex.h>
+#include <linux/pagemap.h>
 #include <linux/radix-tree.h>
 #include <linux/fs.h>
 #include <linux/slab.h>
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a370cde3ddd4..d58d68f3c7cd 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -53,6 +53,7 @@
 #include <linux/moduleparam.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
+#include <linux/pagemap.h>
 #include <linux/file.h>
 #include <linux/stat.h>
 #include <linux/errno.h>
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 71691f32959b..f154c89d1326 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -16,6 +16,7 @@
 #include "features.h"
 
 #include <linux/blkdev.h>
+#include <linux/pagemap.h>
 #include <linux/debugfs.h>
 #include <linux/genhd.h>
 #include <linux/idr.h>
diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
index 41aa1f01fc07..18a267d5073f 100644
--- a/drivers/nvdimm/btt.c
+++ b/drivers/nvdimm/btt.c
@@ -6,6 +6,7 @@
 #include <linux/highmem.h>
 #include <linux/debugfs.h>
 #include <linux/blkdev.h>
+#include <linux/pagemap.h>
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/mutex.h>
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index b8a85bfb2e95..16760b237229 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -8,6 +8,7 @@
  */
 
 #include <linux/blkdev.h>
+#include <linux/pagemap.h>
 #include <linux/hdreg.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c
index f1553a453616..0ffdb8f2995f 100644
--- a/drivers/scsi/scsicam.c
+++ b/drivers/scsi/scsicam.c
@@ -17,6 +17,7 @@
 #include <linux/genhd.h>
 #include <linux/kernel.h>
 #include <linux/blkdev.h>
+#include <linux/pagemap.h>
 #include <linux/msdos_partition.h>
 #include <asm/unaligned.h>
 
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index c032cfe133c7..1e2a95599390 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -11,7 +11,6 @@
 #include <linux/minmax.h>
 #include <linux/timer.h>
 #include <linux/workqueue.h>
-#include <linux/pagemap.h>
 #include <linux/backing-dev-defs.h>
 #include <linux/wait.h>
 #include <linux/mempool.h>
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 4cc6ec3bf0ab..ae194bb7ddb4 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -10,6 +10,7 @@
 #include <linux/sched.h>
 #include <linux/node.h>
 #include <linux/fs.h>
+#include <linux/pagemap.h>
 #include <linux/atomic.h>
 #include <linux/page-flags.h>
 #include <asm/page.h>
-- 
2.30.0


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

* Re: [PATCH v2] include: Remove pagemap.h from blkdev.h
  2021-03-09 19:57 [PATCH v2] include: Remove pagemap.h from blkdev.h Matthew Wilcox (Oracle)
@ 2021-03-09 20:47 ` Dan Williams
  2021-03-09 20:50 ` Jens Axboe
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dan Williams @ 2021-03-09 20:47 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Linux MM, linux-block, Linux Kernel Mailing List,
	linux-bcache, linux-nvdimm, linux-scsi

On Tue, Mar 9, 2021 at 11:59 AM Matthew Wilcox (Oracle)
<willy@infradead.org> wrote:
>
> My UEK-derived config has 1030 files depending on pagemap.h before
> this change.  Afterwards, just 326 files need to be rebuilt when I
> touch pagemap.h.  I think blkdev.h is probably included too widely,
> but untangling that dependency is harder and this solves my problem.
> x86 allmodconfig builds, but there may be implicit include problems
> on other architectures.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
> v2: Fix CONFIG_SWAP=n implicit use of pagemap.h by swap.h.  Increases
>     the number of files from 240, but that's still a big win -- 68%
>     reduction instead of 77%.
>
[..]
>  drivers/nvdimm/btt.c      | 1 +
>  drivers/nvdimm/pmem.c     | 1 +

For the nvdimm bits:

Acked-by: Dan Williams <dan.j.williams@intel.com>

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

* Re: [PATCH v2] include: Remove pagemap.h from blkdev.h
  2021-03-09 19:57 [PATCH v2] include: Remove pagemap.h from blkdev.h Matthew Wilcox (Oracle)
  2021-03-09 20:47 ` Dan Williams
@ 2021-03-09 20:50 ` Jens Axboe
  2021-03-10  8:43 ` Christoph Hellwig
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Jens Axboe @ 2021-03-09 20:50 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle), Andrew Morton, linux-mm
  Cc: linux-block, linux-kernel, linux-bcache, linux-nvdimm, linux-scsi

On 3/9/21 12:57 PM, Matthew Wilcox (Oracle) wrote:
> My UEK-derived config has 1030 files depending on pagemap.h before
> this change.  Afterwards, just 326 files need to be rebuilt when I
> touch pagemap.h.  I think blkdev.h is probably included too widely,
> but untangling that dependency is harder and this solves my problem.
> x86 allmodconfig builds, but there may be implicit include problems
> on other architectures.

For the block bits:

Acked-by: Jens Axboe <axboe@kernel.dk>

-- 
Jens Axboe


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

* Re: [PATCH v2] include: Remove pagemap.h from blkdev.h
  2021-03-09 19:57 [PATCH v2] include: Remove pagemap.h from blkdev.h Matthew Wilcox (Oracle)
  2021-03-09 20:47 ` Dan Williams
  2021-03-09 20:50 ` Jens Axboe
@ 2021-03-10  8:43 ` Christoph Hellwig
  2021-03-10 10:29 ` Coly Li
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2021-03-10  8:43 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, linux-mm, linux-block, linux-kernel, linux-bcache,
	linux-nvdimm, linux-scsi

On Tue, Mar 09, 2021 at 07:57:47PM +0000, Matthew Wilcox (Oracle) wrote:
> My UEK-derived config has 1030 files depending on pagemap.h before
> this change.  Afterwards, just 326 files need to be rebuilt when I
> touch pagemap.h.  I think blkdev.h is probably included too widely,
> but untangling that dependency is harder and this solves my problem.
> x86 allmodconfig builds, but there may be implicit include problems
> on other architectures.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
> v2: Fix CONFIG_SWAP=n implicit use of pagemap.h by swap.h.  Increases
>     the number of files from 240, but that's still a big win -- 68%
>     reduction instead of 77%.

Looks good.  I suspect blkdev.h also has penty of other includes that
aren't needed either..

Reviewed-by: Christoph Hellwig <hch@lst.de>


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

* Re: [PATCH v2] include: Remove pagemap.h from blkdev.h
  2021-03-09 19:57 [PATCH v2] include: Remove pagemap.h from blkdev.h Matthew Wilcox (Oracle)
                   ` (2 preceding siblings ...)
  2021-03-10  8:43 ` Christoph Hellwig
@ 2021-03-10 10:29 ` Coly Li
  2021-03-10 14:51 ` Martin K. Petersen
  2021-03-10 18:28 ` William Kucharski
  5 siblings, 0 replies; 7+ messages in thread
From: Coly Li @ 2021-03-10 10:29 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: linux-block, linux-kernel, linux-mm, Andrew Morton, linux-bcache,
	linux-nvdimm, linux-scsi

On 3/10/21 3:57 AM, Matthew Wilcox (Oracle) wrote:
> My UEK-derived config has 1030 files depending on pagemap.h before
> this change.  Afterwards, just 326 files need to be rebuilt when I
> touch pagemap.h.  I think blkdev.h is probably included too widely,
> but untangling that dependency is harder and this solves my problem.
> x86 allmodconfig builds, but there may be implicit include problems
> on other architectures.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
> v2: Fix CONFIG_SWAP=n implicit use of pagemap.h by swap.h.  Increases
>     the number of files from 240, but that's still a big win -- 68%
>     reduction instead of 77%.
> 
>  block/blk-settings.c      | 1 +
>  drivers/block/brd.c       | 1 +
>  drivers/block/loop.c      | 1 +
>  drivers/md/bcache/super.c | 1 +
>  drivers/nvdimm/btt.c      | 1 +
>  drivers/nvdimm/pmem.c     | 1 +
>  drivers/scsi/scsicam.c    | 1 +
>  include/linux/blkdev.h    | 1 -
>  include/linux/swap.h      | 1 +
>  9 files changed, 8 insertions(+), 1 deletion(-)
> 
[snipped]

> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index 71691f32959b..f154c89d1326 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -16,6 +16,7 @@
>  #include "features.h"
>  
>  #include <linux/blkdev.h>
> +#include <linux/pagemap.h>
>  #include <linux/debugfs.h>
>  #include <linux/genhd.h>
>  #include <linux/idr.h>[snipped]

For bcache part, Acked-by: Coly Li <colyli@suse.de>

Thanks.

Coly Li

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

* Re: [PATCH v2] include: Remove pagemap.h from blkdev.h
  2021-03-09 19:57 [PATCH v2] include: Remove pagemap.h from blkdev.h Matthew Wilcox (Oracle)
                   ` (3 preceding siblings ...)
  2021-03-10 10:29 ` Coly Li
@ 2021-03-10 14:51 ` Martin K. Petersen
  2021-03-10 18:28 ` William Kucharski
  5 siblings, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2021-03-10 14:51 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, linux-mm, linux-block, linux-kernel, linux-bcache,
	linux-nvdimm, linux-scsi


Matthew,

> My UEK-derived config has 1030 files depending on pagemap.h before
> this change.  Afterwards, just 326 files need to be rebuilt when I
> touch pagemap.h.  I think blkdev.h is probably included too widely,
> but untangling that dependency is harder and this solves my problem.
> x86 allmodconfig builds, but there may be implicit include problems on
> other architectures.

SCSI portion looks fine.

Acked-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH v2] include: Remove pagemap.h from blkdev.h
  2021-03-09 19:57 [PATCH v2] include: Remove pagemap.h from blkdev.h Matthew Wilcox (Oracle)
                   ` (4 preceding siblings ...)
  2021-03-10 14:51 ` Martin K. Petersen
@ 2021-03-10 18:28 ` William Kucharski
  5 siblings, 0 replies; 7+ messages in thread
From: William Kucharski @ 2021-03-10 18:28 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, linux-mm, linux-block, linux-kernel, linux-bcache,
	linux-nvdimm, linux-scsi

Nice cleanup, IMHO.

Reviewed-by: William Kucharski <william.kucharski@oracle.com>

> On Mar 9, 2021, at 12:57 PM, Matthew Wilcox (Oracle) <willy@infradead.org> wrote:
> 
> My UEK-derived config has 1030 files depending on pagemap.h before
> this change.  Afterwards, just 326 files need to be rebuilt when I
> touch pagemap.h.  I think blkdev.h is probably included too widely,
> but untangling that dependency is harder and this solves my problem.
> x86 allmodconfig builds, but there may be implicit include problems
> on other architectures.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
> v2: Fix CONFIG_SWAP=n implicit use of pagemap.h by swap.h.  Increases
>    the number of files from 240, but that's still a big win -- 68%
>    reduction instead of 77%.
> 
> block/blk-settings.c      | 1 +
> drivers/block/brd.c       | 1 +
> drivers/block/loop.c      | 1 +
> drivers/md/bcache/super.c | 1 +
> drivers/nvdimm/btt.c      | 1 +
> drivers/nvdimm/pmem.c     | 1 +
> drivers/scsi/scsicam.c    | 1 +
> include/linux/blkdev.h    | 1 -
> include/linux/swap.h      | 1 +
> 9 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/block/blk-settings.c b/block/blk-settings.c
> index b4aa2f37fab6..976085a44fb8 100644
> --- a/block/blk-settings.c
> +++ b/block/blk-settings.c
> @@ -7,6 +7,7 @@
> #include <linux/init.h>
> #include <linux/bio.h>
> #include <linux/blkdev.h>
> +#include <linux/pagemap.h>
> #include <linux/memblock.h>	/* for max_pfn/max_low_pfn */
> #include <linux/gcd.h>
> #include <linux/lcm.h>
> diff --git a/drivers/block/brd.c b/drivers/block/brd.c
> index 18bf99906662..2a5a1933826b 100644
> --- a/drivers/block/brd.c
> +++ b/drivers/block/brd.c
> @@ -18,6 +18,7 @@
> #include <linux/bio.h>
> #include <linux/highmem.h>
> #include <linux/mutex.h>
> +#include <linux/pagemap.h>
> #include <linux/radix-tree.h>
> #include <linux/fs.h>
> #include <linux/slab.h>
> diff --git a/drivers/block/loop.c b/drivers/block/loop.c
> index a370cde3ddd4..d58d68f3c7cd 100644
> --- a/drivers/block/loop.c
> +++ b/drivers/block/loop.c
> @@ -53,6 +53,7 @@
> #include <linux/moduleparam.h>
> #include <linux/sched.h>
> #include <linux/fs.h>
> +#include <linux/pagemap.h>
> #include <linux/file.h>
> #include <linux/stat.h>
> #include <linux/errno.h>
> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index 71691f32959b..f154c89d1326 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -16,6 +16,7 @@
> #include "features.h"
> 
> #include <linux/blkdev.h>
> +#include <linux/pagemap.h>
> #include <linux/debugfs.h>
> #include <linux/genhd.h>
> #include <linux/idr.h>
> diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
> index 41aa1f01fc07..18a267d5073f 100644
> --- a/drivers/nvdimm/btt.c
> +++ b/drivers/nvdimm/btt.c
> @@ -6,6 +6,7 @@
> #include <linux/highmem.h>
> #include <linux/debugfs.h>
> #include <linux/blkdev.h>
> +#include <linux/pagemap.h>
> #include <linux/module.h>
> #include <linux/device.h>
> #include <linux/mutex.h>
> diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
> index b8a85bfb2e95..16760b237229 100644
> --- a/drivers/nvdimm/pmem.c
> +++ b/drivers/nvdimm/pmem.c
> @@ -8,6 +8,7 @@
>  */
> 
> #include <linux/blkdev.h>
> +#include <linux/pagemap.h>
> #include <linux/hdreg.h>
> #include <linux/init.h>
> #include <linux/platform_device.h>
> diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c
> index f1553a453616..0ffdb8f2995f 100644
> --- a/drivers/scsi/scsicam.c
> +++ b/drivers/scsi/scsicam.c
> @@ -17,6 +17,7 @@
> #include <linux/genhd.h>
> #include <linux/kernel.h>
> #include <linux/blkdev.h>
> +#include <linux/pagemap.h>
> #include <linux/msdos_partition.h>
> #include <asm/unaligned.h>
> 
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index c032cfe133c7..1e2a95599390 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -11,7 +11,6 @@
> #include <linux/minmax.h>
> #include <linux/timer.h>
> #include <linux/workqueue.h>
> -#include <linux/pagemap.h>
> #include <linux/backing-dev-defs.h>
> #include <linux/wait.h>
> #include <linux/mempool.h>
> diff --git a/include/linux/swap.h b/include/linux/swap.h
> index 4cc6ec3bf0ab..ae194bb7ddb4 100644
> --- a/include/linux/swap.h
> +++ b/include/linux/swap.h
> @@ -10,6 +10,7 @@
> #include <linux/sched.h>
> #include <linux/node.h>
> #include <linux/fs.h>
> +#include <linux/pagemap.h>
> #include <linux/atomic.h>
> #include <linux/page-flags.h>
> #include <asm/page.h>
> -- 
> 2.30.0
> 
> 


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

end of thread, other threads:[~2021-03-10 18:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09 19:57 [PATCH v2] include: Remove pagemap.h from blkdev.h Matthew Wilcox (Oracle)
2021-03-09 20:47 ` Dan Williams
2021-03-09 20:50 ` Jens Axboe
2021-03-10  8:43 ` Christoph Hellwig
2021-03-10 10:29 ` Coly Li
2021-03-10 14:51 ` Martin K. Petersen
2021-03-10 18:28 ` William Kucharski

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