2020-09-08 10:11:15

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the akpm-current tree

Hi all,

After merging the akpm-current tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/xen/unpopulated-alloc.c: In function 'fill_list':
drivers/xen/unpopulated-alloc.c:30:9: error: 'struct dev_pagemap' has no member named 'res'; did you mean 'ref'?
30 | pgmap->res.name = "Xen scratch";
| ^~~
| ref
drivers/xen/unpopulated-alloc.c:31:9: error: 'struct dev_pagemap' has no member named 'res'; did you mean 'ref'?
31 | pgmap->res.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
| ^~~
| ref
drivers/xen/unpopulated-alloc.c:33:51: error: 'struct dev_pagemap' has no member named 'res'; did you mean 'ref'?
33 | ret = allocate_resource(&iomem_resource, &pgmap->res,
| ^~~
| ref
In file included from include/asm-generic/memory_model.h:5,
from arch/x86/include/asm/page.h:76,
from arch/x86/include/asm/thread_info.h:12,
from include/linux/thread_info.h:38,
from arch/x86/include/asm/preempt.h:7,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from drivers/xen/unpopulated-alloc.c:3:
drivers/xen/unpopulated-alloc.c:53:35: error: 'struct dev_pagemap' has no member named 'res'; did you mean 'ref'?
53 | xen_pfn_t pfn = PFN_DOWN(pgmap->res.start);
| ^~~
include/linux/pfn.h:20:23: note: in definition of macro 'PFN_DOWN'
20 | #define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
| ^
drivers/xen/unpopulated-alloc.c:58:30: error: 'struct dev_pagemap' has no member named 'res'; did you mean 'ref'?
58 | release_resource(&pgmap->res);
| ^~~
| ref
drivers/xen/unpopulated-alloc.c:69:28: error: 'struct dev_pagemap' has no member named 'res'; did you mean 'ref'?
69 | release_resource(&pgmap->res);
| ^~~
| ref
fs/fuse/virtio_fs.c: In function 'virtio_fs_setup_dax':
fs/fuse/virtio_fs.c:838:9: error: 'struct dev_pagemap' has no member named 'res'; did you mean 'ref'?
838 | pgmap->res = (struct resource){
| ^~~
| ref

Caused by commit

b3e022c5a68c ("mm/memremap_pages: convert to 'struct range'")

interacting with commit

9e2369c06c8a ("xen: add helpers to allocate unpopulated memory")

from Linus' tree (in v5.9-rc4) and commit

7e833303db20 ("virtiofs: set up virtio_fs dax_device")

from the fuse tree.

I have added the following patch which may require more work but at
least makes it all build.

From: Stephen Rothwell <[email protected]>
Date: Tue, 8 Sep 2020 20:00:20 +1000
Subject: [PATCH] merge fix up for "mm/memremap_pages: convert to 'struct
range'"

Signed-off-by: Stephen Rothwell <[email protected]>
---
drivers/xen/unpopulated-alloc.c | 15 +++++++++------
fs/fuse/virtio_fs.c | 3 +--
2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/xen/unpopulated-alloc.c b/drivers/xen/unpopulated-alloc.c
index 3b98dc921426..9fa7ce330628 100644
--- a/drivers/xen/unpopulated-alloc.c
+++ b/drivers/xen/unpopulated-alloc.c
@@ -18,6 +18,7 @@ static unsigned int list_count;
static int fill_list(unsigned int nr_pages)
{
struct dev_pagemap *pgmap;
+ struct resource res;
void *vaddr;
unsigned int i, alloc_pages = round_up(nr_pages, PAGES_PER_SECTION);
int ret;
@@ -27,10 +28,10 @@ static int fill_list(unsigned int nr_pages)
return -ENOMEM;

pgmap->type = MEMORY_DEVICE_GENERIC;
- pgmap->res.name = "Xen scratch";
- pgmap->res.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+ res.name = "Xen scratch";
+ res.flags = IORESOURCE_MEM | IORESOURCE_BUSY;

- ret = allocate_resource(&iomem_resource, &pgmap->res,
+ ret = allocate_resource(&iomem_resource, &res,
alloc_pages * PAGE_SIZE, 0, -1,
PAGES_PER_SECTION * PAGE_SIZE, NULL, NULL);
if (ret < 0) {
@@ -38,6 +39,8 @@ static int fill_list(unsigned int nr_pages)
kfree(pgmap);
return ret;
}
+ pgmap->range.start = res.start;
+ pgmap->range.end = res.end;

#ifdef CONFIG_XEN_HAVE_PVMMU
/*
@@ -50,12 +53,12 @@ static int fill_list(unsigned int nr_pages)
* conflict with any devices.
*/
if (!xen_feature(XENFEAT_auto_translated_physmap)) {
- xen_pfn_t pfn = PFN_DOWN(pgmap->res.start);
+ xen_pfn_t pfn = PFN_DOWN(res.start);

for (i = 0; i < alloc_pages; i++) {
if (!set_phys_to_machine(pfn + i, INVALID_P2M_ENTRY)) {
pr_warn("set_phys_to_machine() failed, no memory added\n");
- release_resource(&pgmap->res);
+ release_resource(&res);
kfree(pgmap);
return -ENOMEM;
}
@@ -66,7 +69,7 @@ static int fill_list(unsigned int nr_pages)
vaddr = memremap_pages(pgmap, NUMA_NO_NODE);
if (IS_ERR(vaddr)) {
pr_err("Cannot remap memory range\n");
- release_resource(&pgmap->res);
+ release_resource(&res);
kfree(pgmap);
return PTR_ERR(vaddr);
}
diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
index da3ede268604..8f27478497fa 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -835,8 +835,7 @@ static int virtio_fs_setup_dax(struct virtio_device *vdev, struct virtio_fs *fs)
* initialize a struct resource from scratch (only the start
* and end fields will be used).
*/
- pgmap->res = (struct resource){
- .name = "virtio-fs dax window",
+ pgmap->range = (struct range){
.start = (phys_addr_t) cache_reg.addr,
.end = (phys_addr_t) cache_reg.addr + cache_reg.len - 1,
};
--
2.28.0

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2020-09-08 16:13:51

by Vivek Goyal

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the akpm-current tree

On Tue, Sep 08, 2020 at 08:09:50PM +1000, Stephen Rothwell wrote:

[..]
> fs/fuse/virtio_fs.c: In function 'virtio_fs_setup_dax':
> fs/fuse/virtio_fs.c:838:9: error: 'struct dev_pagemap' has no member named 'res'; did you mean 'ref'?
> 838 | pgmap->res = (struct resource){
> | ^~~
> | ref
>
> Caused by commit
>
> b3e022c5a68c ("mm/memremap_pages: convert to 'struct range'")
>
> interacting with commit
>
> 9e2369c06c8a ("xen: add helpers to allocate unpopulated memory")
>
> from Linus' tree (in v5.9-rc4) and commit
>
> 7e833303db20 ("virtiofs: set up virtio_fs dax_device")
>
> from the fuse tree.
>
> I have added the following patch which may require more work but at
> least makes it all build.
>
> From: Stephen Rothwell <[email protected]>
> Date: Tue, 8 Sep 2020 20:00:20 +1000
> Subject: [PATCH] merge fix up for "mm/memremap_pages: convert to 'struct
> range'"
>
> Signed-off-by: Stephen Rothwell <[email protected]>
> ---
> drivers/xen/unpopulated-alloc.c | 15 +++++++++------
> fs/fuse/virtio_fs.c | 3 +--
> 2 files changed, 10 insertions(+), 8 deletions(-)
>

[..]
> diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
> index da3ede268604..8f27478497fa 100644
> --- a/fs/fuse/virtio_fs.c
> +++ b/fs/fuse/virtio_fs.c
> @@ -835,8 +835,7 @@ static int virtio_fs_setup_dax(struct virtio_device *vdev, struct virtio_fs *fs)
> * initialize a struct resource from scratch (only the start
> * and end fields will be used).
> */
> - pgmap->res = (struct resource){
> - .name = "virtio-fs dax window",
> + pgmap->range = (struct range){
> .start = (phys_addr_t) cache_reg.addr,
> .end = (phys_addr_t) cache_reg.addr + cache_reg.len - 1,
> };

Thanks Stephen. This change looks good to me for virtiofs.

Thanks
Vivek

2020-09-24 01:41:30

by Dan Williams

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the akpm-current tree

On Tue, 2020-09-08 at 20:09 +-1000, Stephen Rothwell wrote:
+AD4- Hi all,
+AD4-
+AD4- After merging the akpm-current tree, today's linux-next build (x86+AF8-64
+AD4- allmodconfig) failed like this:
+AD4-
+AD4- drivers/xen/unpopulated-alloc.c: In function 'fill+AF8-list':
+AD4- drivers/xen/unpopulated-alloc.c:30:9: error: 'struct dev+AF8-pagemap' has
+AD4- no member named 'res'+ADs- did you mean 'ref'?
+AD4- 30 +AHw- pgmap-+AD4-res.name +AD0- +ACI-Xen scratch+ACIAOw-
+AD4- +AHw- +AF4AfgB+-
+AD4- +AHw- ref
+AD4- drivers/xen/unpopulated-alloc.c:31:9: error: 'struct dev+AF8-pagemap' has
+AD4- no member named 'res'+ADs- did you mean 'ref'?
+AD4- 31 +AHw- pgmap-+AD4-res.flags +AD0- IORESOURCE+AF8-MEM +AHw- IORESOURCE+AF8-BUSY+ADs-
+AD4- +AHw- +AF4AfgB+-
+AD4- +AHw- ref
+AD4- drivers/xen/unpopulated-alloc.c:33:51: error: 'struct dev+AF8-pagemap'
+AD4- has no member named 'res'+ADs- did you mean 'ref'?
+AD4- 33 +AHw- ret +AD0- allocate+AF8-resource(+ACY-iomem+AF8-resource, +ACY-pgmap-+AD4-res,
+AD4- +AHw- +AF4AfgB+-
+AD4- +AHw- ref
+AD4- In file included from include/asm-generic/memory+AF8-model.h:5,
+AD4- from arch/x86/include/asm/page.h:76,
+AD4- from arch/x86/include/asm/thread+AF8-info.h:12,
+AD4- from include/linux/thread+AF8-info.h:38,
+AD4- from arch/x86/include/asm/preempt.h:7,
+AD4- from include/linux/preempt.h:78,
+AD4- from include/linux/spinlock.h:51,
+AD4- from include/linux/mmzone.h:8,
+AD4- from include/linux/gfp.h:6,
+AD4- from drivers/xen/unpopulated-alloc.c:3:
+AD4- drivers/xen/unpopulated-alloc.c:53:35: error: 'struct dev+AF8-pagemap'
+AD4- has no member named 'res'+ADs- did you mean 'ref'?
+AD4- 53 +AHw- xen+AF8-pfn+AF8-t pfn +AD0- PFN+AF8-DOWN(pgmap-+AD4-res.start)+ADs-
+AD4- +AHw- +AF4AfgB+-
+AD4- include/linux/pfn.h:20:23: note: in definition of macro 'PFN+AF8-DOWN'
+AD4- 20 +AHw- +ACM-define PFN+AF8-DOWN(x) ((x) +AD4APg- PAGE+AF8-SHIFT)
+AD4- +AHw- +AF4-
+AD4- drivers/xen/unpopulated-alloc.c:58:30: error: 'struct dev+AF8-pagemap'
+AD4- has no member named 'res'+ADs- did you mean 'ref'?
+AD4- 58 +AHw- release+AF8-resource(+ACY-pgmap-+AD4-res)+ADs-
+AD4- +AHw- +AF4AfgB+-
+AD4- +AHw- ref
+AD4- drivers/xen/unpopulated-alloc.c:69:28: error: 'struct dev+AF8-pagemap'
+AD4- has no member named 'res'+ADs- did you mean 'ref'?
+AD4- 69 +AHw- release+AF8-resource(+ACY-pgmap-+AD4-res)+ADs-
+AD4- +AHw- +AF4AfgB+-
+AD4- +AHw- ref
+AD4- fs/fuse/virtio+AF8-fs.c: In function 'virtio+AF8-fs+AF8-setup+AF8-dax':
+AD4- fs/fuse/virtio+AF8-fs.c:838:9: error: 'struct dev+AF8-pagemap' has no member
+AD4- named 'res'+ADs- did you mean 'ref'?
+AD4- 838 +AHw- pgmap-+AD4-res +AD0- (struct resource)+AHs-
+AD4- +AHw- +AF4AfgB+-
+AD4- +AHw- ref
+AD4-
+AD4- Caused by commit
+AD4-
+AD4- b3e022c5a68c (+ACI-mm/memremap+AF8-pages: convert to 'struct range'+ACI-)
+AD4-
+AD4- interacting with commit
+AD4-
+AD4- 9e2369c06c8a (+ACI-xen: add helpers to allocate unpopulated memory+ACI-)
+AD4-
+AD4- from Linus' tree (in v5.9-rc4) and commit
+AD4-
+AD4- 7e833303db20 (+ACI-virtiofs: set up virtio+AF8-fs dax+AF8-device+ACI-)
+AD4-
+AD4- from the fuse tree.
+AD4-
+AD4- I have added the following patch which may require more work but at
+AD4- least makes it all build.
+AD4-
+AD4- From: Stephen Rothwell +ADw-sfr+AEA-canb.auug.org.au+AD4-
+AD4- Date: Tue, 8 Sep 2020 20:00:20 +-1000
+AD4- Subject: +AFs-PATCH+AF0- merge fix up for +ACI-mm/memremap+AF8-pages: convert to
+AD4- 'struct
+AD4- range'+ACI-
+AD4-
+AD4- Signed-off-by: Stephen Rothwell +ADw-sfr+AEA-canb.auug.org.au+AD4-
+AD4- ---
+AD4- drivers/xen/unpopulated-alloc.c +AHw- 15 +-+-+-+-+-+-+-+-+-------
+AD4- fs/fuse/virtio+AF8-fs.c +AHw- 3 +---
+AD4- 2 files changed, 10 insertions(+-), 8 deletions(-)
+AD4-
+AD4- diff --git a/drivers/xen/unpopulated-alloc.c
+AD4- b/drivers/xen/unpopulated-alloc.c
+AD4- index 3b98dc921426..9fa7ce330628 100644
+AD4- --- a/drivers/xen/unpopulated-alloc.c
+AD4- +-+-+- b/drivers/xen/unpopulated-alloc.c
+AD4- +AEAAQA- -18,6 +-18,7 +AEAAQA- static unsigned int list+AF8-count+ADs-
+AD4- static int fill+AF8-list(unsigned int nr+AF8-pages)
+AD4- +AHs-
+AD4- struct dev+AF8-pagemap +ACo-pgmap+ADs-
+AD4- +- struct resource res+ADs-
+AD4- void +ACo-vaddr+ADs-
+AD4- unsigned int i, alloc+AF8-pages +AD0- round+AF8-up(nr+AF8-pages,
+AD4- PAGES+AF8-PER+AF8-SECTION)+ADs-
+AD4- int ret+ADs-
+AD4- +AEAAQA- -27,10 +-28,10 +AEAAQA- static int fill+AF8-list(unsigned int nr+AF8-pages)
+AD4- return -ENOMEM+ADs-
+AD4-
+AD4- pgmap-+AD4-type +AD0- MEMORY+AF8-DEVICE+AF8-GENERIC+ADs-
+AD4- - pgmap-+AD4-res.name +AD0- +ACI-Xen scratch+ACIAOw-
+AD4- - pgmap-+AD4-res.flags +AD0- IORESOURCE+AF8-MEM +AHw- IORESOURCE+AF8-BUSY+ADs-

This is broken... it needs to be converted to 'struct range'. I'll take
care of that when I respin the series. Sorry for the thrash it seems
this is a new memremap+AF8-pages() user since the conversion patches
landed.

2020-10-16 20:09:47

by Miklos Szeredi

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the akpm-current tree

On Thu, Sep 24, 2020 at 3:40 AM Williams, Dan J
<[email protected]> wrote:
>
> On Tue, 2020-09-08 at 20:09 +1000, Stephen Rothwell wrote:

[...]

> > From: Stephen Rothwell <[email protected]>
> > Date: Tue, 8 Sep 2020 20:00:20 +1000
> > Subject: [PATCH] merge fix up for "mm/memremap_pages: convert to
> > 'struct
> > range'"
> >
> > Signed-off-by: Stephen Rothwell <[email protected]>
> > ---
> > drivers/xen/unpopulated-alloc.c | 15 +++++++++------
> > fs/fuse/virtio_fs.c | 3 +--
> > 2 files changed, 10 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/xen/unpopulated-alloc.c
> > b/drivers/xen/unpopulated-alloc.c
> > index 3b98dc921426..9fa7ce330628 100644
> > --- a/drivers/xen/unpopulated-alloc.c
> > +++ b/drivers/xen/unpopulated-alloc.c
> > @@ -18,6 +18,7 @@ static unsigned int list_count;
> > static int fill_list(unsigned int nr_pages)
> > {
> > struct dev_pagemap *pgmap;
> > + struct resource res;
> > void *vaddr;
> > unsigned int i, alloc_pages = round_up(nr_pages,
> > PAGES_PER_SECTION);
> > int ret;
> > @@ -27,10 +28,10 @@ static int fill_list(unsigned int nr_pages)
> > return -ENOMEM;
> >
> > pgmap->type = MEMORY_DEVICE_GENERIC;
> > - pgmap->res.name = "Xen scratch";
> > - pgmap->res.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
>
> This is broken... it needs to be converted to 'struct range'. I'll take
> care of that when I respin the series. Sorry for the thrash it seems
> this is a new memremap_pages() user since the conversion patches
> landed.

Hi Dan,

I'd like to send this upstream and this conflict needs to be dealt
with some way or another. Can you send the correct fixup against

git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git#for-next

?

Thanks,
Miklos

2020-10-22 07:42:01

by Dan Williams

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the akpm-current tree

On Fri, Oct 16, 2020 at 12:45 PM Miklos Szeredi <[email protected]> wrote:
[..]
> > This is broken... it needs to be converted to 'struct range'. I'll take
> > care of that when I respin the series. Sorry for the thrash it seems
> > this is a new memremap_pages() user since the conversion patches
> > landed.
>
> Hi Dan,
>
> I'd like to send this upstream and this conflict needs to be dealt
> with some way or another. Can you send the correct fixup against
>
> git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git#for-next

Sorry, I just circled back to this and found your for-next branch is
already merged. The resolution looks good. Apologies for not taking a
look earlier.