[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZxC+mr5PcGv4fBcY@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com>
Date: Thu, 17 Oct 2024 09:36:58 +0200
From: Alexander Gordeev <agordeev@...ux.ibm.com>
To: David Hildenbrand <david@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-s390@...r.kernel.org, virtualization@...ts.linux.dev,
linux-doc@...r.kernel.org, kvm@...r.kernel.org,
Heiko Carstens <hca@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>, Thomas Huth <thuth@...hat.com>,
Cornelia Huck <cohuck@...hat.com>,
Janosch Frank <frankja@...ux.ibm.com>,
Claudio Imbrenda <imbrenda@...ux.ibm.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Eugenio PĂ©rez <eperezma@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Jonathan Corbet <corbet@....net>, Mario Casquero <mcasquer@...hat.com>
Subject: Re: [PATCH v2 4/7] s390/physmem_info: query diag500(STORAGE LIMIT)
to support QEMU/KVM memory devices
On Mon, Oct 14, 2024 at 04:46:16PM +0200, David Hildenbrand wrote:
Hi David!
> @@ -157,7 +189,9 @@ unsigned long detect_max_physmem_end(void)
> {
> unsigned long max_physmem_end = 0;
>
> - if (!sclp_early_get_memsize(&max_physmem_end)) {
> + if (!diag500_storage_limit(&max_physmem_end)) {
> + physmem_info.info_source = MEM_DETECT_DIAG500_STOR_LIMIT;
> + } else if (!sclp_early_get_memsize(&max_physmem_end)) {
> physmem_info.info_source = MEM_DETECT_SCLP_READ_INFO;
> } else {
> max_physmem_end = search_mem_end();
> @@ -170,11 +204,17 @@ void detect_physmem_online_ranges(unsigned long max_physmem_end)
> {
> if (!sclp_early_read_storage_info()) {
> physmem_info.info_source = MEM_DETECT_SCLP_STOR_INFO;
> + return;
> } else if (!diag260()) {
> physmem_info.info_source = MEM_DETECT_DIAG260;
> - } else if (max_physmem_end) {
> - add_physmem_online_range(0, max_physmem_end);
> + return;
> + } else if (physmem_info.info_source == MEM_DETECT_DIAG500_STOR_LIMIT) {
> + max_physmem_end = 0;
> + if (!sclp_early_get_memsize(&max_physmem_end))
> + physmem_info.info_source = MEM_DETECT_SCLP_READ_INFO;
Why search_mem_end() is not tried in case sclp_early_get_memsize() failed?
> }
> + if (max_physmem_end)
> + add_physmem_online_range(0, max_physmem_end);
> }
>
> void physmem_set_usable_limit(unsigned long limit)
> diff --git a/arch/s390/include/asm/physmem_info.h b/arch/s390/include/asm/physmem_info.h
> index f45cfc8bc233..51b68a43e195 100644
> --- a/arch/s390/include/asm/physmem_info.h
> +++ b/arch/s390/include/asm/physmem_info.h
> @@ -9,6 +9,7 @@ enum physmem_info_source {
> MEM_DETECT_NONE = 0,
> MEM_DETECT_SCLP_STOR_INFO,
> MEM_DETECT_DIAG260,
> + MEM_DETECT_DIAG500_STOR_LIMIT,
> MEM_DETECT_SCLP_READ_INFO,
> MEM_DETECT_BIN_SEARCH
> };
> @@ -107,6 +108,8 @@ static inline const char *get_physmem_info_source(void)
> return "sclp storage info";
> case MEM_DETECT_DIAG260:
> return "diag260";
> + case MEM_DETECT_DIAG500_STOR_LIMIT:
> + return "diag500 storage limit";
AFAIU you want to always override MEM_DETECT_DIAG500_STOR_LIMIT method
with an online memory detection method. In that case this code is dead.
> case MEM_DETECT_SCLP_READ_INFO:
> return "sclp read info";
> case MEM_DETECT_BIN_SEARCH:
Thanks!
Powered by blists - more mailing lists