* [PATCH v1] xen/balloon: Set pages PageOffline() in balloon_add_region()
@ 2019-09-27 15:46 David Hildenbrand
2019-09-27 18:08 ` Boris Ostrovsky
0 siblings, 1 reply; 3+ messages in thread
From: David Hildenbrand @ 2019-09-27 15:46 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mm, xen-devel, David Hildenbrand,
Marek Marczykowski-Górecki, stable, Boris Ostrovsky,
Juergen Gross, Stefano Stabellini
We are missing a __SetPageOffline(), which is why we can get
!PageOffline() pages onto the balloon list, where
alloc_xenballooned_pages() will complain:
page:ffffea0003e7ffc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0xffffe00001000(reserved)
raw: 000ffffe00001000 dead000000000100 dead000000000200 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
page dumped because: VM_BUG_ON_PAGE(!PageOffline(page))
------------[ cut here ]------------
kernel BUG at include/linux/page-flags.h:744!
invalid opcode: 0000 [#1] SMP NOPTI
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Fixes: 77c4adf6a6df ("xen/balloon: mark inflated pages PG_offline")
Cc: stable@vger.kernel.org # v5.1+
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
drivers/xen/balloon.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 05b1f7e948ef..29f6256363db 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -687,6 +687,7 @@ static void __init balloon_add_region(unsigned long start_pfn,
/* totalram_pages and totalhigh_pages do not
include the boot-time balloon extension, so
don't subtract from it. */
+ __SetPageOffline(page);
__balloon_append(page);
}
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1] xen/balloon: Set pages PageOffline() in balloon_add_region()
2019-09-27 15:46 [PATCH v1] xen/balloon: Set pages PageOffline() in balloon_add_region() David Hildenbrand
@ 2019-09-27 18:08 ` Boris Ostrovsky
2019-09-28 8:46 ` David Hildenbrand
0 siblings, 1 reply; 3+ messages in thread
From: Boris Ostrovsky @ 2019-09-27 18:08 UTC (permalink / raw)
To: David Hildenbrand, linux-kernel
Cc: linux-mm, xen-devel, Marek Marczykowski-Górecki, stable,
Juergen Gross, Stefano Stabellini
On 9/27/19 11:46 AM, David Hildenbrand wrote:
> We are missing a __SetPageOffline(), which is why we can get
> !PageOffline() pages onto the balloon list, where
> alloc_xenballooned_pages() will complain:
>
> page:ffffea0003e7ffc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0
> flags: 0xffffe00001000(reserved)
> raw: 000ffffe00001000 dead000000000100 dead000000000200 0000000000000000
> raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
> page dumped because: VM_BUG_ON_PAGE(!PageOffline(page))
> ------------[ cut here ]------------
> kernel BUG at include/linux/page-flags.h:744!
> invalid opcode: 0000 [#1] SMP NOPTI
>
> Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> Fixes: 77c4adf6a6df ("xen/balloon: mark inflated pages PG_offline")
> Cc: stable@vger.kernel.org # v5.1+
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: Juergen Gross <jgross@suse.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
> drivers/xen/balloon.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
> index 05b1f7e948ef..29f6256363db 100644
> --- a/drivers/xen/balloon.c
> +++ b/drivers/xen/balloon.c
> @@ -687,6 +687,7 @@ static void __init balloon_add_region(unsigned long start_pfn,
> /* totalram_pages and totalhigh_pages do not
> include the boot-time balloon extension, so
> don't subtract from it. */
> + __SetPageOffline(page);
> __balloon_append(page);
Given that when a page is appended to balloon list need to be marked
offline and, conversely, when a page is retrieved the bit should be
cleared I wonder whether it's better to move Set/ClearPageOffline to
balloon_append/retrieve().
-boris
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] xen/balloon: Set pages PageOffline() in balloon_add_region()
2019-09-27 18:08 ` Boris Ostrovsky
@ 2019-09-28 8:46 ` David Hildenbrand
0 siblings, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2019-09-28 8:46 UTC (permalink / raw)
To: Boris Ostrovsky, linux-kernel
Cc: linux-mm, xen-devel, Marek Marczykowski-Górecki, stable,
Juergen Gross, Stefano Stabellini
On 27.09.19 20:08, Boris Ostrovsky wrote:
> On 9/27/19 11:46 AM, David Hildenbrand wrote:
>> We are missing a __SetPageOffline(), which is why we can get
>> !PageOffline() pages onto the balloon list, where
>> alloc_xenballooned_pages() will complain:
>>
>> page:ffffea0003e7ffc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0
>> flags: 0xffffe00001000(reserved)
>> raw: 000ffffe00001000 dead000000000100 dead000000000200 0000000000000000
>> raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
>> page dumped because: VM_BUG_ON_PAGE(!PageOffline(page))
>> ------------[ cut here ]------------
>> kernel BUG at include/linux/page-flags.h:744!
>> invalid opcode: 0000 [#1] SMP NOPTI
>>
>> Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
>> Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
>> Fixes: 77c4adf6a6df ("xen/balloon: mark inflated pages PG_offline")
>> Cc: stable@vger.kernel.org # v5.1+
>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> Cc: Juergen Gross <jgross@suse.com>
>> Cc: Stefano Stabellini <sstabellini@kernel.org>
>> Signed-off-by: David Hildenbrand <david@redhat.com>
>> ---
>> drivers/xen/balloon.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
>> index 05b1f7e948ef..29f6256363db 100644
>> --- a/drivers/xen/balloon.c
>> +++ b/drivers/xen/balloon.c
>> @@ -687,6 +687,7 @@ static void __init balloon_add_region(unsigned long start_pfn,
>> /* totalram_pages and totalhigh_pages do not
>> include the boot-time balloon extension, so
>> don't subtract from it. */
>> + __SetPageOffline(page);
>> __balloon_append(page);
>
>
> Given that when a page is appended to balloon list need to be marked
> offline and, conversely, when a page is retrieved the bit should be
> cleared I wonder whether it's better to move Set/ClearPageOffline to
> balloon_append/retrieve().
Yes, we can do that as an addon patch (and also get rid of either
__balloon_append() or balloon_append() if I remember correctly).
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-09-28 8:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27 15:46 [PATCH v1] xen/balloon: Set pages PageOffline() in balloon_add_region() David Hildenbrand
2019-09-27 18:08 ` Boris Ostrovsky
2019-09-28 8:46 ` David Hildenbrand
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).