diff mbox series

iomap: remove set_memor_ro() on zero page

Message ID 20240826212632.2098685-1-mcgrof@kernel.org (mailing list archive)
State Not Applicable, archived
Headers show
Series iomap: remove set_memor_ro() on zero page | expand

Commit Message

Luis Chamberlain Aug. 26, 2024, 9:26 p.m. UTC
Stephen reported a boot failure on ppc power8 system where
set_memor_ro() on the new zero page failed [0]. Christophe Leroy
further clarifies we can't use this on on linear memory on ppc, and
so instead of special casing this just for PowerPC [2] remove the
call as suggested by Darrick.

[0] https://lore.kernel.org/all/20240826175931.1989f99e@canb.auug.org.au/T/#u
[1] https://lore.kernel.org/all/b0fe75b4-c1bb-47f7-a7c3-2534b31c1780@csgroup.eu/
[2] https://lore.kernel.org/all/ZszrJkFOpiy5rCma@bombadil.infradead.org/

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Suggested-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---

This applies to the vfs.blocksize branch on the vfs tree.

 fs/iomap/direct-io.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Christoph Hellwig Aug. 27, 2024, 4:07 a.m. UTC | #1
On Mon, Aug 26, 2024 at 02:26:32PM -0700, Luis Chamberlain wrote:
> Stephen reported a boot failure on ppc power8 system where
> set_memor_ro() on the new zero page failed [0]. Christophe Leroy
> further clarifies we can't use this on on linear memory on ppc, and
> so instead of special casing this just for PowerPC [2] remove the
> call as suggested by Darrick.

I've already asked for it not to be added multiple times, but I'm
glad we're getting there now:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Darrick J. Wong Aug. 27, 2024, 5:55 a.m. UTC | #2
On Mon, Aug 26, 2024 at 02:26:32PM -0700, Luis Chamberlain wrote:
> Stephen reported a boot failure on ppc power8 system where
> set_memor_ro() on the new zero page failed [0]. Christophe Leroy
> further clarifies we can't use this on on linear memory on ppc, and
> so instead of special casing this just for PowerPC [2] remove the
> call as suggested by Darrick.
> 
> [0] https://lore.kernel.org/all/20240826175931.1989f99e@canb.auug.org.au/T/#u
> [1] https://lore.kernel.org/all/b0fe75b4-c1bb-47f7-a7c3-2534b31c1780@csgroup.eu/
> [2] https://lore.kernel.org/all/ZszrJkFOpiy5rCma@bombadil.infradead.org/
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Suggested-by: "Darrick J. Wong" <djwong@kernel.org>
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
> 
> This applies to the vfs.blocksize branch on the vfs tree.
> 
>  fs/iomap/direct-io.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
> index c02b266bba52..f637aa0706a3 100644
> --- a/fs/iomap/direct-io.c
> +++ b/fs/iomap/direct-io.c
> @@ -11,7 +11,6 @@
>  #include <linux/iomap.h>
>  #include <linux/backing-dev.h>
>  #include <linux/uio.h>
> -#include <linux/set_memory.h>
>  #include <linux/task_io_accounting_ops.h>
>  #include "trace.h"
>  
> @@ -781,8 +780,6 @@ static int __init iomap_dio_init(void)
>  	if (!zero_page)
>  		return -ENOMEM;
>  
> -	set_memory_ro((unsigned long)page_address(zero_page),
> -		      1U << IOMAP_ZERO_PAGE_ORDER);
>  	return 0;
>  }
>  fs_initcall(iomap_dio_init);
> -- 
> 2.43.0
> 
>
Stephen Rothwell Aug. 27, 2024, 6:26 a.m. UTC | #3
Hi all,

On Mon, 26 Aug 2024 22:55:39 -0700 "Darrick J. Wong" <djwong@kernel.org> wrote:
>
> On Mon, Aug 26, 2024 at 02:26:32PM -0700, Luis Chamberlain wrote:
> > Stephen reported a boot failure on ppc power8 system where
> > set_memor_ro() on the new zero page failed [0]. Christophe Leroy
> > further clarifies we can't use this on on linear memory on ppc, and
> > so instead of special casing this just for PowerPC [2] remove the
> > call as suggested by Darrick.
> > 
> > [0] https://lore.kernel.org/all/20240826175931.1989f99e@canb.auug.org.au/T/#u
> > [1] https://lore.kernel.org/all/b0fe75b4-c1bb-47f7-a7c3-2534b31c1780@csgroup.eu/
> > [2] https://lore.kernel.org/all/ZszrJkFOpiy5rCma@bombadil.infradead.org/
> > 
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Suggested-by: "Darrick J. Wong" <djwong@kernel.org>
> > Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>  
> 
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>

I added this to linux-next today, and it seems to have fixed the run
time warning, so

Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Christian Brauner Aug. 27, 2024, 7:56 a.m. UTC | #4
On Mon, 26 Aug 2024 14:26:32 -0700, Luis Chamberlain wrote:
> Stephen reported a boot failure on ppc power8 system where
> set_memor_ro() on the new zero page failed [0]. Christophe Leroy
> further clarifies we can't use this on on linear memory on ppc, and
> so instead of special casing this just for PowerPC [2] remove the
> call as suggested by Darrick.
> 
> [0] https://lore.kernel.org/all/20240826175931.1989f99e@canb.auug.org.au/T/#u
> [1] https://lore.kernel.org/all/b0fe75b4-c1bb-47f7-a7c3-2534b31c1780@csgroup.eu/
> [2] https://lore.kernel.org/all/ZszrJkFOpiy5rCma@bombadil.infradead.org/
> 
> [...]

Thank you for the quick fix!

---

Applied to the vfs.blocksize branch of the vfs/vfs.git tree.
Patches in the vfs.blocksize branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.blocksize

[1/1] iomap: remove set_memor_ro() on zero page
      https://git.kernel.org/vfs/vfs/c/51eac77be01b
diff mbox series

Patch

diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index c02b266bba52..f637aa0706a3 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -11,7 +11,6 @@ 
 #include <linux/iomap.h>
 #include <linux/backing-dev.h>
 #include <linux/uio.h>
-#include <linux/set_memory.h>
 #include <linux/task_io_accounting_ops.h>
 #include "trace.h"
 
@@ -781,8 +780,6 @@  static int __init iomap_dio_init(void)
 	if (!zero_page)
 		return -ENOMEM;
 
-	set_memory_ro((unsigned long)page_address(zero_page),
-		      1U << IOMAP_ZERO_PAGE_ORDER);
 	return 0;
 }
 fs_initcall(iomap_dio_init);