Re: [PATCH v1 4/5] xen/balloon: try to merge system ram resources

2020-09-02 Thread David Hildenbrand


> Am 02.09.2020 um 12:15 schrieb Jürgen Groß :
> 
> On 21.08.20 12:34, David Hildenbrand wrote:
>> Let's reuse the new mechanism to merge system ram resources below the
>> root. We are the only one hotplugging system ram (e.g., DIMMs don't apply),
>> so this is safe to be used.
>> Cc: Andrew Morton 
>> Cc: Michal Hocko 
>> Cc: Boris Ostrovsky 
>> Cc: Juergen Gross 
>> Cc: Stefano Stabellini 
>> Cc: Roger Pau Monné 
>> Cc: Julien Grall 
>> Cc: Pankaj Gupta 
>> Cc: Baoquan He 
>> Cc: Wei Yang 
>> Signed-off-by: David Hildenbrand 
>> ---
>>  drivers/xen/balloon.c | 4 
>>  1 file changed, 4 insertions(+)
>> diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
>> index 37ffccda8bb87..5ec73f752b8a7 100644
>> --- a/drivers/xen/balloon.c
>> +++ b/drivers/xen/balloon.c
>> @@ -338,6 +338,10 @@ static enum bp_state reserve_additional_memory(void)
>>  if (rc) {
>>  pr_warn("Cannot add additional memory (%i)\n", rc);
>>  goto err;
>> +} else {
>> +resource = NULL;
>> +/* Try to reduce the number of system ram resources. */
>> +merge_system_ram_resources(_resource);
>>  }
> 
> I don't see the need for setting resource to NULL and to use an "else"
> clause here.
> 

I set it to NULL because the pointer may be stale after that call - to avoid 
future bugs. But I can drop it.

Ack to the „else“ case.

Thanks for having a look!

> 
> Juergen
> 

___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v1 4/5] xen/balloon: try to merge system ram resources

2020-09-02 Thread Jürgen Groß

On 21.08.20 12:34, David Hildenbrand wrote:

Let's reuse the new mechanism to merge system ram resources below the
root. We are the only one hotplugging system ram (e.g., DIMMs don't apply),
so this is safe to be used.

Cc: Andrew Morton 
Cc: Michal Hocko 
Cc: Boris Ostrovsky 
Cc: Juergen Gross 
Cc: Stefano Stabellini 
Cc: Roger Pau Monné 
Cc: Julien Grall 
Cc: Pankaj Gupta 
Cc: Baoquan He 
Cc: Wei Yang 
Signed-off-by: David Hildenbrand 
---
  drivers/xen/balloon.c | 4 
  1 file changed, 4 insertions(+)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 37ffccda8bb87..5ec73f752b8a7 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -338,6 +338,10 @@ static enum bp_state reserve_additional_memory(void)
if (rc) {
pr_warn("Cannot add additional memory (%i)\n", rc);
goto err;
+   } else {
+   resource = NULL;
+   /* Try to reduce the number of system ram resources. */
+   merge_system_ram_resources(_resource);
}


I don't see the need for setting resource to NULL and to use an "else"
clause here.


Juergen
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH v1 4/5] xen/balloon: try to merge system ram resources

2020-08-21 Thread David Hildenbrand
Let's reuse the new mechanism to merge system ram resources below the
root. We are the only one hotplugging system ram (e.g., DIMMs don't apply),
so this is safe to be used.

Cc: Andrew Morton 
Cc: Michal Hocko 
Cc: Boris Ostrovsky 
Cc: Juergen Gross 
Cc: Stefano Stabellini 
Cc: Roger Pau Monné 
Cc: Julien Grall 
Cc: Pankaj Gupta 
Cc: Baoquan He 
Cc: Wei Yang 
Signed-off-by: David Hildenbrand 
---
 drivers/xen/balloon.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 37ffccda8bb87..5ec73f752b8a7 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -338,6 +338,10 @@ static enum bp_state reserve_additional_memory(void)
if (rc) {
pr_warn("Cannot add additional memory (%i)\n", rc);
goto err;
+   } else {
+   resource = NULL;
+   /* Try to reduce the number of system ram resources. */
+   merge_system_ram_resources(_resource);
}
 
balloon_stats.total_pages += balloon_hotplug;
-- 
2.26.2

___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization