All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] acpi: enlarge NUM_FIXMAP_ACPI_PAGES to support larger scale boards
@ 2017-05-15  7:04 Zhangbo (Oscar)
  2017-05-15  9:58 ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Zhangbo (Oscar) @ 2017-05-15  7:04 UTC (permalink / raw)
  To: xen-devel; +Cc: george.dunlap, jbeulich

In acpi_tb_verify_table()->__acpi_map_table(), it suppose all ACPI tables
may not exceed 4 pages, the tables includes SRAT/APIC/ERST etc.
Please note that the table DSDT is not mapped through
acpi_tb_verify_table(), thus we don't care its size although it's usually
the largest table among all the ACPI tables. Then the biggest table we
concern is SRAT.
As we know, the size of SRAT if affected by both CPU number and memory
slot number, each CPU costs 24B, and each memory slot costs 40B.
....
[030h 0048   1]                Subtable Type : 02 [Processor Local x2APIC
Affinity]
[031h 0049   1]                       Length : 18

[032h 0050   2]                    Reserved1 : 0000
[034h 0052   4]             Proximity Domain : 00000000
[038h 0056   4]                      Apic ID : 00000000
[03Ch 0060   4]        Flags (decoded below) : 00000001
                                     Enabled : 1
[040h 0064   4]                 Clock Domain : 00000000
[044h 0068   4]                    Reserved2 : 00000000
....
[7090h 28816   1]                Subtable Type : 01 [Memory Affinity]
[7091h 28817   1]                       Length : 28

[7092h 28818   4]             Proximity Domain : 0000001A
[7096h 28822   2]                    Reserved1 : 0000
[7098h 28824   8]                 Base Address : 00000E0000000000
[70A0h 28832   8]               Address Length : 0000000000000000
[70A8h 28840   4]                    Reserved2 : 00000000
[70ACh 28844   4]        Flags (decoded below) : 00000001
                                       Enabled : 1
                                 Hot Pluggable : 0
                                  Non-Volatile : 0
[70B0h 28848   8]                    Reserved3 : 0000000000000000
....

Please note: even when SRAT table is within 4 pages, eg. 14128B, in
__acpi_map_table(), it maps pages to get the table. suppose the start
address is near the end of the first page:

       1000B    4096B         4096B          4096B      840B
       |___|_____________|______________|______________|____|

although the total page is within 4 pages , but it may be in fact across 5
pages, as shown above. Thus the NUM_FIXMAP_ACPI_PAGES should be much
larger nowadays. If not, xen would wrongly thinks no NUMA configuration
could be found as that it could not get SRAT table.

Thus, we make NUM_FIXMAP_ACPI_PAGES much larger, to 64(256KB). it's
calculated for that the theoretical largest CPU number on main Linux
distros is about 8092, and memory slots number should be within 1000,
that's 24B*8092+40B*1000 = 234208B. Meanwhile, because IOREMAP_VIRT_*
region is 16GB, thus I think extending it to 256KB is safe enough.

Of course, there's much more work to do to support large scale boards of
that many(8092) CPUs and 1000 memory slots. We just make life easier for
boards with serveral hundreds of CPUs and serveral TBs of memory.

Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com>
---
 xen/include/xen/acpi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index 30ec0ee..9409350 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -41,9 +41,9 @@

 /*
  * Fixmap pages to reserve for ACPI boot-time tables (see asm-x86/fixmap.h or
- * asm-arm/config.h)
+ * asm-arm/config.h, 64 pages(256KB) is large enough for most cases.)
  */
-#define NUM_FIXMAP_ACPI_PAGES  4
+#define NUM_FIXMAP_ACPI_PAGES  64

 #define BAD_MADT_ENTRY(entry, end) (                                        \
                 (!(entry)) || (unsigned long)(entry) + sizeof(*(entry)) > (end) ||  \

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] acpi: enlarge NUM_FIXMAP_ACPI_PAGES to support larger scale boards
  2017-05-15  7:04 [PATCH V2] acpi: enlarge NUM_FIXMAP_ACPI_PAGES to support larger scale boards Zhangbo (Oscar)
@ 2017-05-15  9:58 ` Jan Beulich
  2017-05-15 11:00   ` Zhangbo (Oscar)
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2017-05-15  9:58 UTC (permalink / raw)
  To: Zhangbo (Oscar); +Cc: george.dunlap, xen-devel

>>> On 15.05.17 at 09:04, <oscar.zhangbo@huawei.com> wrote:
> In acpi_tb_verify_table()->__acpi_map_table(), it suppose all ACPI tables
> may not exceed 4 pages, the tables includes SRAT/APIC/ERST etc.
> Please note that the table DSDT is not mapped through
> acpi_tb_verify_table(), thus we don't care its size although it's usually
> the largest table among all the ACPI tables. Then the biggest table we
> concern is SRAT.
> As we know, the size of SRAT if affected by both CPU number and memory
> slot number, each CPU costs 24B, and each memory slot costs 40B.
> ....
> [030h 0048   1]                Subtable Type : 02 [Processor Local x2APIC
> Affinity]
> [031h 0049   1]                       Length : 18
> 
> [032h 0050   2]                    Reserved1 : 0000
> [034h 0052   4]             Proximity Domain : 00000000
> [038h 0056   4]                      Apic ID : 00000000
> [03Ch 0060   4]        Flags (decoded below) : 00000001
>                                      Enabled : 1
> [040h 0064   4]                 Clock Domain : 00000000
> [044h 0068   4]                    Reserved2 : 00000000
> ....
> [7090h 28816   1]                Subtable Type : 01 [Memory Affinity]
> [7091h 28817   1]                       Length : 28
> 
> [7092h 28818   4]             Proximity Domain : 0000001A
> [7096h 28822   2]                    Reserved1 : 0000
> [7098h 28824   8]                 Base Address : 00000E0000000000
> [70A0h 28832   8]               Address Length : 0000000000000000
> [70A8h 28840   4]                    Reserved2 : 00000000
> [70ACh 28844   4]        Flags (decoded below) : 00000001
>                                        Enabled : 1
>                                  Hot Pluggable : 0
>                                   Non-Volatile : 0
> [70B0h 28848   8]                    Reserved3 : 0000000000000000
> ....
> 
> Please note: even when SRAT table is within 4 pages, eg. 14128B, in
> __acpi_map_table(), it maps pages to get the table. suppose the start
> address is near the end of the first page:
> 
>        1000B    4096B         4096B          4096B      840B
>        |___|_____________|______________|______________|____|
> 
> although the total page is within 4 pages , but it may be in fact across 5
> pages, as shown above. Thus the NUM_FIXMAP_ACPI_PAGES should be much
> larger nowadays. If not, xen would wrongly thinks no NUMA configuration
> could be found as that it could not get SRAT table.
> 
> Thus, we make NUM_FIXMAP_ACPI_PAGES much larger, to 64(256KB). it's
> calculated for that the theoretical largest CPU number on main Linux
> distros is about 8092, and memory slots number should be within 1000,
> that's 24B*8092+40B*1000 = 234208B. Meanwhile, because IOREMAP_VIRT_*
> region is 16GB, thus I think extending it to 256KB is safe enough.
> 
> Of course, there's much more work to do to support large scale boards of
> that many(8092) CPUs and 1000 memory slots. We just make life easier for
> boards with serveral hundreds of CPUs and serveral TBs of memory.
> 
> Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com>

Much better, but how did you arrive at 8092? Did you mean 8192
(2**13)? Also I don't think the table entry fields should be listed,
stating their size is good enough (if anyone cares to check the
sizes are correct, (s)he'd need to go look at the spec or some
header anyway). I'd be fine with adjusting the commit message
accordingly while committing. With such adjustments

Reviewed-by: Jan Beulich <jbeulich@suse.com>

You didn't Cc Julien, so I assume (and agree) that this is rather
meant for post-4.9. Whether to backport we can decide later.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH V2] acpi: enlarge NUM_FIXMAP_ACPI_PAGES to support larger scale boards
  2017-05-15  9:58 ` Jan Beulich
@ 2017-05-15 11:00   ` Zhangbo (Oscar)
  0 siblings, 0 replies; 3+ messages in thread
From: Zhangbo (Oscar) @ 2017-05-15 11:00 UTC (permalink / raw)
  To: Jan Beulich; +Cc: george.dunlap, xen-devel

>
>>
>> Thus, we make NUM_FIXMAP_ACPI_PAGES much larger, to 64(256KB). it's
>> calculated for that the theoretical largest CPU number on main Linux
>> distros is about 8092, and memory slots number should be within 1000,
>> that's 24B*8092+40B*1000 = 234208B. Meanwhile, because
>IOREMAP_VIRT_*
>> region is 16GB, thus I think extending it to 256KB is safe enough.
>>
>> Of course, there's much more work to do to support large scale boards of
>> that many(8092) CPUs and 1000 memory slots. We just make life easier for
>> boards with serveral hundreds of CPUs and serveral TBs of memory.
>>
>> Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com>
>
>Much better, but how did you arrive at 8092? Did you mean 8192
>(2**13)? Also I don't think the table entry fields should be listed,
>stating their size is good enough (if anyone cares to check the
>sizes are correct, (s)he'd need to go look at the spec or some
>header anyway). I'd be fine with adjusting the commit message
>accordingly while committing. With such adjustments
>

Thanks, Jan!
Yes, that's 8192 :) 
The sites I referenced are:
https://www.suse.com/products/server/technical-information/#Kernel (8192)
https://access.redhat.com/articles/rhel-limits (5120)

>Reviewed-by: Jan Beulich <jbeulich@suse.com>
>
>You didn't Cc Julien, so I assume (and agree) that this is rather
>meant for post-4.9. Whether to backport we can decide later.
>
>Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-15 11:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-15  7:04 [PATCH V2] acpi: enlarge NUM_FIXMAP_ACPI_PAGES to support larger scale boards Zhangbo (Oscar)
2017-05-15  9:58 ` Jan Beulich
2017-05-15 11:00   ` Zhangbo (Oscar)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.