2020-08-21 10:37:17

by David Hildenbrand

[permalink] [raw]
Subject: [PATCH v1 5/5] hv_balloon: try to merge system ram resources

Let's use 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 <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: "K. Y. Srinivasan" <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Cc: Stephen Hemminger <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Pankaj Gupta <[email protected]>
Cc: Baoquan He <[email protected]>
Cc: Wei Yang <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
---
drivers/hv/hv_balloon.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index 32e3bc0aa665a..49a6305f0fb73 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -745,6 +745,9 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size,
has->covered_end_pfn -= processed_pfn;
spin_unlock_irqrestore(&dm_device.ha_lock, flags);
break;
+ } else {
+ /* Try to reduce the number of system ram resources. */
+ merge_system_ram_resources(&iomem_resource);
}

/*
--
2.26.2


2020-09-04 17:31:31

by Wei Liu

[permalink] [raw]
Subject: Re: [PATCH v1 5/5] hv_balloon: try to merge system ram resources

On Fri, Aug 21, 2020 at 12:34:31PM +0200, David Hildenbrand wrote:
> Let's use 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 <[email protected]>
> Cc: Michal Hocko <[email protected]>
> Cc: "K. Y. Srinivasan" <[email protected]>
> Cc: Haiyang Zhang <[email protected]>
> Cc: Stephen Hemminger <[email protected]>
> Cc: Wei Liu <[email protected]>
> Cc: Pankaj Gupta <[email protected]>
> Cc: Baoquan He <[email protected]>
> Cc: Wei Yang <[email protected]>
> Signed-off-by: David Hildenbrand <[email protected]>
> ---
> drivers/hv/hv_balloon.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
> index 32e3bc0aa665a..49a6305f0fb73 100644
> --- a/drivers/hv/hv_balloon.c
> +++ b/drivers/hv/hv_balloon.c
> @@ -745,6 +745,9 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size,
> has->covered_end_pfn -= processed_pfn;
> spin_unlock_irqrestore(&dm_device.ha_lock, flags);
> break;
> + } else {
> + /* Try to reduce the number of system ram resources. */
> + merge_system_ram_resources(&iomem_resource);
> }

You don't need to put the call under the "else" branch. It will have
broken out of the loop if ret is not zero.

Wei.

>
> /*
> --
> 2.26.2
>

2020-09-08 10:30:20

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH v1 5/5] hv_balloon: try to merge system ram resources

On 04.09.20 19:30, Wei Liu wrote:
> On Fri, Aug 21, 2020 at 12:34:31PM +0200, David Hildenbrand wrote:
>> Let's use 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 <[email protected]>
>> Cc: Michal Hocko <[email protected]>
>> Cc: "K. Y. Srinivasan" <[email protected]>
>> Cc: Haiyang Zhang <[email protected]>
>> Cc: Stephen Hemminger <[email protected]>
>> Cc: Wei Liu <[email protected]>
>> Cc: Pankaj Gupta <[email protected]>
>> Cc: Baoquan He <[email protected]>
>> Cc: Wei Yang <[email protected]>
>> Signed-off-by: David Hildenbrand <[email protected]>
>> ---
>> drivers/hv/hv_balloon.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
>> index 32e3bc0aa665a..49a6305f0fb73 100644
>> --- a/drivers/hv/hv_balloon.c
>> +++ b/drivers/hv/hv_balloon.c
>> @@ -745,6 +745,9 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size,
>> has->covered_end_pfn -= processed_pfn;
>> spin_unlock_irqrestore(&dm_device.ha_lock, flags);
>> break;
>> + } else {
>> + /* Try to reduce the number of system ram resources. */
>> + merge_system_ram_resources(&iomem_resource);
>> }
>
> You don't need to put the call under the "else" branch. It will have
> broken out of the loop if ret is not zero.
>

Agreed, thanks!


--
Thanks,

David / dhildenb