Skip to contentSkip to conversation

eal: change max hugepage sizes to 4

PATCH Superseded Gagandeep Singh 8 participants 19 messages Aug 7, 2019 – Aug 12, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal: change max hugepage sizes to 4

DPDK currently is supporting maximum 3 hugepage, sizes whereas system can support more than this e.g. 64K, 2M, 32M and 1G.

Having these four hugepage sizes available to use by DPDK, which is valid in case of '--in-memory' EAL option or using 4 separate mount points for each hugepage size; hugepage_info_init() API reports an error.

This change increases the maximum supported mount points to 4.

---

On ARM platform when the translation granule is 4KB, there are 4 hugepage sizes supported.
On kernel 5.2, we can see below directories in /sys/kernel/mm/hugepages:

hugepages-1048576kB
hugepages-2048kB
hugepages-32768kB
hugepages-64kB

 lib/librte_eal/common/eal_internal_cfg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eal/common/eal_internal_cfg.h +1 -1
index edff09d07..abb7ec913 100644
@@ -15,7 +15,7 @@
 
 #include "eal_thread.h"
 
-#define MAX_HUGEPAGE_SIZES 3  /**< support up to 3 page sizes */
+#define MAX_HUGEPAGE_SIZES 4  /**< support up to 4 page sizes */
 
 /*
  * internal configuration structure for the number, size and
Signature · 1 line
2.17.1
#1 lore raw
Quoted 4 lines · Gagandeep Singh

DPDK currently is supporting maximum 3 hugepage, sizes whereas system can support more than this e.g. 64K, 2M, 32M and 1G.

You can mention ARM platform here, and that this issue starts with kernel 5.2 (and I would try to mention this in the title as well). This is better than an annotation that will be lost.

Quoted 4 lines

Having these four hugepage sizes available to use by DPDK, which is valid in case of '--in-memory' EAL option or using 4 separate mount points for each hugepage size; hugepage_info_init() API reports an error.

Can you describe what is the impact from a user point of view rather than mentioning this internal function?

Quoted 2 lines

This change increases the maximum supported mount points to 4.

I suppose this fix does the trick for you.
However, we are in internal structures and I can't think of an impact on datapath.
So we might as well use dynamic allocations rather than just enlarge this array.

Did you consider this?

Signature · 1 line
David Marchand
#2 lore raw

07/08/2019 14:00, David Marchand:

Quoted 11 lines · Gagandeep Singh
Quoted 4 lines

DPDK currently is supporting maximum 3 hugepage, sizes whereas system can support more than this e.g. 64K, 2M, 32M and 1G.

You can mention ARM platform here, and that this issue starts with kernel 5.2 (and I would try to mention this in the title as well). This is better than an annotation that will be lost.

Quoted 7 lines
Quoted 4 lines

Having these four hugepage sizes available to use by DPDK, which is valid in case of '--in-memory' EAL option or using 4 separate mount points for each hugepage size; hugepage_info_init() API reports an error.

Can you describe what is the impact from a user point of view rather than mentioning this internal function?

Yes please, we need to understand how much it is critical. Should we Cc [email protected] for backport?
Should it be merged at the last minute in 19.08?

Quoted 9 lines
Quoted 2 lines

This change increases the maximum supported mount points to 4.

I suppose this fix does the trick for you.
However, we are in internal structures and I can't think of an impact on datapath.
So we might as well use dynamic allocations rather than just enlarge this array.

Did you consider this?

#3 lore raw

HI Thomas,

Quoted 14 lines
Quoted 14 lines
Quoted 3 lines

DPDK currently is supporting maximum 3 hugepage, sizes whereas system can support more than this e.g.
64K, 2M, 32M and 1G.

You can mention ARM platform here, and that this issue starts with kernel 5.2 (and I would try to mention this in the title as well). This is better than an annotation that will be lost.

Quoted 4 lines

Having these four hugepage sizes available to use by DPDK, which is valid in case of '--in-memory' EAL option or using 4 separate mount points for each hugepage size;
hugepage_info_init() API reports an error.

Quoted 7 lines
Quoted 2 lines

Can you describe what is the impact from a user point of view rather than mentioning this internal function?

Yes please, we need to understand how much it is critical. Should we Cc [email protected] for backport?
Should it be merged at the last minute in 19.08?

VPP usages in-memory option. So, VPP on ARM with kernel 5.2 wont' work without this patch.

#15 lore raw
In reply to Gagandeep Singh
Quoted 34 lines · On Wed, 7 Aug 2019 15:42:04 +0530 Gagandeep Singh <[email protected]> wrote:

DPDK currently is supporting maximum 3 hugepage, sizes whereas system can support more than this e.g. 64K, 2M, 32M and 1G.

Having these four hugepage sizes available to use by DPDK, which is valid in case of '--in-memory' EAL option or using 4 separate mount points for each hugepage size; hugepage_info_init() API reports an error.

This change increases the maximum supported mount points to 4.

---

On ARM platform when the translation granule is 4KB, there are 4 hugepage sizes supported.
On kernel 5.2, we can see below directories in /sys/kernel/mm/hugepages:

hugepages-1048576kB
hugepages-2048kB
hugepages-32768kB
hugepages-64kB

 lib/librte_eal/common/eal_internal_cfg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eal/common/eal_internal_cfg.h +0 -0
index edff09d07..abb7ec913 100644

lib/librte_eal/common/eal_internal_cfg.h line 18

Quoted 5 lines
lib/librte_eal/common/eal_internal_cfg.h +1 -1
@@ -15,7 +15,7 @@
 
 #include "eal_thread.h"
 
-#define MAX_HUGEPAGE_SIZES 3  /**< support up to 3 page sizes */
+#define MAX_HUGEPAGE_SIZES 4  /**< support up to 4 page sizes */

At least this is hidden in internal config.

#4 lore raw
In reply to Hemant Agrawal

07/08/2019 15:28, Hemant Agrawal:

Quoted 16 lines

HI Thomas,

Quoted 14 lines
Quoted 14 lines
Quoted 3 lines

DPDK currently is supporting maximum 3 hugepage, sizes whereas system can support more than this e.g.
64K, 2M, 32M and 1G.

You can mention ARM platform here, and that this issue starts with kernel 5.2 (and I would try to mention this in the title as well). This is better than an annotation that will be lost.

Quoted 4 lines

Having these four hugepage sizes available to use by DPDK, which is valid in case of '--in-memory' EAL option or using 4 separate mount points for each hugepage size;
hugepage_info_init() API reports an error.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Can you describe what is the impact from a user point of view rather than mentioning this internal function?

Yes please, we need to understand how much it is critical. Should we Cc [email protected] for backport?
Should it be merged at the last minute in 19.08?

VPP usages in-memory option. So, VPP on ARM with kernel 5.2 wont' work without this patch.

Do you want to send a v2 with a better explanation?

I would suggest to restrict the change to Arm only with an ifdef, in order to limit the risk for this release.
We can think about a dynamic hugepage scan in the next release.

#9 lore raw
In reply to Hemant Agrawal
Quoted 20 lines · Hemant Agrawal

HI Thomas,

Quoted 17 lines
Quoted 16 lines
Quoted 3 lines

DPDK currently is supporting maximum 3 hugepage, sizes whereas system can support more than this e.g.
64K, 2M, 32M and 1G.

You can mention ARM platform here, and that this issue starts with kernel 5.2 (and I would try to mention this in the title as well). This is better than an annotation that will be lost.

Quoted 4 lines

Having these four hugepage sizes available to use by DPDK, which is valid in case of '--in-memory' EAL option or using 4 separate mount points for each hugepage size;
hugepage_info_init() API reports an error.

Can you describe what is the impact from a user point of view rather than mentioning this internal function?

Quoted 7 lines
Quoted 4 lines

Yes please, we need to understand how much it is critical. Should we Cc [email protected] for backport?
Should it be merged at the last minute in 19.08?

VPP usages in-memory option. So, VPP on ARM with kernel 5.2 wont' work without this patch.

I have been looking at the changes in the linux kernel. Can you pinpoint at the commit that changed this in 5.2?

I can see a change in the code, but in 5.0, or maybe something changed in the configuration.

The patch you propose is not that risky (x86 supports two pagesizes, and max hugepage is already at 3, so we know the code works fine with less than the max).
Yet, I want to understand why this is urgent now.

CCing other architecture maintainers.

Signature · 1 line
David Marchand
#10 lore raw
Quoted 49 lines

-----Original Message-----
From: David Marchand <[email protected]>
Sent: Thursday, August 8, 2019 1:03 PM
To: Hemant Agrawal <[email protected]>
Cc: Thomas Monjalon <[email protected]>; Gagandeep Singh <[email protected]>; dev <[email protected]>; Burakov, Anatoly <[email protected]>; Olivier Matz <[email protected]>; Andrew Rybchenko <[email protected]>; Nipun Gupta <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Gavin Hu <[email protected]>; Bruce Richardson <[email protected]>
Subject: [EXT] Re: [dpdk-dev] [PATCH] eal: change max hugepage sizes to 4

Quoted 20 lines · Hemant Agrawal

HI Thomas,

Quoted 17 lines
Quoted 16 lines
Quoted 3 lines

DPDK currently is supporting maximum 3 hugepage, sizes whereas system can support more than this e.g.
64K, 2M, 32M and 1G.

You can mention ARM platform here, and that this issue starts with kernel 5.2 (and I would try to mention this in the title as well). This is better than an annotation that will be lost.

Quoted 4 lines

Having these four hugepage sizes available to use by DPDK, which is valid in case of '--in-memory' EAL option or using 4 separate mount points for each hugepage size; hugepage_info_init() API reports an error.

Can you describe what is the impact from a user point of view rather than mentioning this internal function?

Quoted 6 lines
Quoted 4 lines

Yes please, we need to understand how much it is critical. Should we Cc [email protected] for backport?
Should it be merged at the last minute in 19.08?

VPP usages in-memory option. So, VPP on ARM with kernel 5.2 wont' work

without this patch.

Quoted 1 line

I have been looking at the changes in the linux kernel. Can you pinpoint at the commit that changed this in 5.2?

I can see a change in the code, but in 5.0, or maybe something changed in the configuration.

Quoted 6 lines

The patch you propose is not that risky (x86 supports two pagesizes, and max hugepage is already at 3, so we know the code works fine with less than the max).
Yet, I want to understand why this is urgent now.

CCing other architecture maintainers.

Tested this change with an arm64 machine + 4.18 kernel. Looks OK.

Quoted 4 lines

--
David Marchand

#11 lore raw
In reply to David Marchand

Hi David,

Quoted 9 lines
Quoted 1 line

VPP usages in-memory option. So, VPP on ARM with kernel 5.2 wont' work

without this patch.

Quoted 1 line

I have been looking at the changes in the linux kernel. Can you pinpoint at the commit that changed this in 5.2?

I can see a change in the code, but in 5.0, or maybe something changed in the configuration.

[Hemant] I am not aware of exact patch, which changed the behavior. May be Honnappa/Steve can help here.

Regards,
Hemant

Quoted 11 lines

The patch you propose is not that risky (x86 supports two pagesizes, and max hugepage is already at 3, so we know the code works fine with less than the max).
Yet, I want to understand why this is urgent now.

CCing other architecture maintainers.

--
David Marchand

#16 lore raw

PATCH v2 1/1 eal: change max hugepage sizes to 4 for ARM platforms

In reply to Gagandeep Singh

ARM is supporting maximum 4 hugepage sizes (64K, 2M, 32M and 1G) when granule is 4KB since very long and DPDK support maximum 3 hugepage sizes.

With all 4 hugepage sizes enabled, applications and some stacks like VPP which are working over DPDK and using "in-memory" eal option, or using separate mount points on ARM based platform, fails at huge page initialization, reporting error messages from eal:

EAL: FATAL: Cannot get hugepage information.
EAL: Cannot get hugepage information.
EAL: Error - exiting with code: 1

This issue is visible on kernel 5.2 (stable rel), where kernel is by default creating directories for each supported hugepage size in /sys/kernel/mm/hugepages/

On earlier Stable Kernel LTR's, the directories visible in /sys/kernel/mm/hugepages/ were dependent upon what hugepage sizes are configured at boot time.

This change increases the maximum supported mount points to 4 for ARM based platforms.

---

Changes in V2:
- restricted this change specific to ARM
- commit message updated
- stable added to cc

 lib/librte_eal/common/eal_internal_cfg.h | 4 ++++
 1 file changed, 4 insertions(+)
lib/librte_eal/common/eal_internal_cfg.h +4 -0
index edff09d07..a42f34923 100644
@@ -15,7 +15,11 @@
 
 #include "eal_thread.h"
 
+#if defined(RTE_ARCH_ARM) || defined(RTE_ARCH_ARM64)
+#define MAX_HUGEPAGE_SIZES 4  /**< support up to 4 page sizes */
+#else
 #define MAX_HUGEPAGE_SIZES 3  /**< support up to 3 page sizes */
+#endif
 
 /*
  * internal configuration structure for the number, size and
Signature · 1 line
2.17.1
#17 lore raw

Re: [dpdk-dev] [dpdk-stable] [PATCH v2] eal: change max hugepage sizes to 4 for ARM platforms

Quoted 11 lines · Gagandeep Singh

ARM is supporting maximum 4 hugepage sizes (64K, 2M, 32M and 1G) when granule is 4KB since very long and DPDK support maximum 3 hugepage sizes.

With all 4 hugepage sizes enabled, applications and some stacks like VPP which are working over DPDK and using "in-memory" eal option, or using separate mount points on ARM based platform, fails at huge page initialization, reporting error messages from eal:

Quoted 7 lines

EAL: FATAL: Cannot get hugepage information.
EAL: Cannot get hugepage information.
EAL: Error - exiting with code: 1

This issue is visible on kernel 5.2 (stable rel), where kernel is by default creating directories for each supported hugepage size in /sys/kernel/mm/hugepages/

Yes, any supported hugepage size is announced in sysfs.

Quoted 3 lines

On earlier Stable Kernel LTR's, the directories visible in /sys/kernel/mm/hugepages/ were dependent upon what hugepage sizes are configured at boot time.

The change is in kernel 5.0 with:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a21b0b78

where all supported sizes are now registered.

Quoted 6 lines

This change increases the maximum supported mount points to 4 for ARM based platforms.

Quoted 8 lines

---

Changes in V2:
- restricted this change specific to ARM
- commit message updated
- stable added to cc

Please keep me Cc:.

Signature · 1 line
David Marchand
#13 lore raw
In reply to Steve Capper
Quoted 16 lines · Steve Capper

Hello,

Quoted 12 lines · Hemant Agrawal

Hi David,

Quoted 9 lines
Quoted 1 line

VPP usages in-memory option. So, VPP on ARM with kernel 5.2 wont' work

without this patch.

Quoted 1 line

I have been looking at the changes in the linux kernel. Can you pinpoint at the commit that changed this in 5.2?

I can see a change in the code, but in 5.0, or maybe something changed in the configuration.

Quoted 8 lines
Quoted 2 lines

[Hemant] I am not aware of exact patch, which changed the behavior. May be Honnappa/Steve can help here.

All the possible hugetlb sizes being advertised was added in v5.0 by:
a21b0b78eaf7 arm64: hugetlb: Register hugepages during arch init

(Some more recent patches changed the constants used but the logic remained the same).

Ah, thanks for confirming :-).

Signature · 1 line
David Marchand
#12 lore raw
In reply to Hemant Agrawal

Hello,

Quoted 6 lines · Hemant Agrawal

Hi David,

Quoted 4 lines
Quoted 1 line

VPP usages in-memory option. So, VPP on ARM with kernel 5.2 wont' work

without this patch.

Quoted 1 line
Quoted 8 lines
Quoted 5 lines

I have been looking at the changes in the linux kernel. Can you pinpoint at the commit that changed this in 5.2?

I can see a change in the code, but in 5.0, or maybe something changed in the configuration.

[Hemant] I am not aware of exact patch, which changed the behavior. May be Honnappa/Steve can help here.

All the possible hugetlb sizes being advertised was added in v5.0 by:
a21b0b78eaf7 arm64: hugetlb: Register hugepages during arch init

(Some more recent patches changed the constants used but the logic remained the same).

Cheers,

Signature · 1 line
Steve
#18 lore raw

Re: [dpdk-dev] [dpdk-stable] [PATCH v2] eal: change max hugepage sizes to 4 for ARM platforms

In reply to David Marchand

08/08/2019 14:37, David Marchand:

Quoted 22 lines · Gagandeep Singh
Quoted 11 lines

ARM is supporting maximum 4 hugepage sizes (64K, 2M, 32M and 1G) when granule is 4KB since very long and DPDK support maximum 3 hugepage sizes.

With all 4 hugepage sizes enabled, applications and some stacks like VPP which are working over DPDK and using "in-memory" eal option, or using separate mount points on ARM based platform, fails at huge page initialization, reporting error messages from eal:

Quoted 7 lines

EAL: FATAL: Cannot get hugepage information.
EAL: Cannot get hugepage information.
EAL: Error - exiting with code: 1

This issue is visible on kernel 5.2 (stable rel), where kernel is by default creating directories for each supported hugepage size in /sys/kernel/mm/hugepages/

Yes, any supported hugepage size is announced in sysfs.

Quoted 17 lines
Quoted 3 lines

On earlier Stable Kernel LTR's, the directories visible in /sys/kernel/mm/hugepages/ were dependent upon what hugepage sizes are configured at boot time.

The change is in kernel 5.0 with:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a21b0b78

where all supported sizes are now registered.

Quoted 8 lines

This change increases the maximum supported mount points to 4 for ARM based platforms.

Applied with small updates in commit log (especially commit origin in 5.0), thanks.

#14 lore raw
In reply to Hemant Agrawal
Quoted 19 lines · Hemant Agrawal

HI Thomas,

Quoted 17 lines
Quoted 16 lines
Quoted 3 lines

DPDK currently is supporting maximum 3 hugepage, sizes whereas system can support more than this e.g.
64K, 2M, 32M and 1G.

You can mention ARM platform here, and that this issue starts with kernel 5.2 (and I would try to mention this in the title as well). This is better than an annotation that will be lost.

Quoted 4 lines

Having these four hugepage sizes available to use by DPDK, which is valid in case of '--in-memory' EAL option or using 4 separate mount points for each hugepage size;
hugepage_info_init() API reports an error.

Can you describe what is the impact from a user point of view rather than mentioning this internal function?

Quoted 7 lines
Quoted 4 lines

Yes please, we need to understand how much it is critical. Should we Cc [email protected] for backport?
Should it be merged at the last minute in 19.08?

VPP usages in-memory option. So, VPP on ARM with kernel 5.2 wont' work without this patch.

Off-topic, but it's nice to see real-world usage for this option!

Signature · 2 lines
Thanks,
Anatoly
#5 lore raw
In reply to Thomas Monjalon
Quoted 24 lines · Thomas Monjalon

07/08/2019 15:28, Hemant Agrawal:

Quoted 23 lines

HI Thomas,

Quoted 20 lines
Quoted 9 lines
Quoted 3 lines

DPDK currently is supporting maximum 3 hugepage, sizes whereas system can support more than this e.g.
64K, 2M, 32M and 1G.

You can mention ARM platform here, and that this issue starts with kernel 5.2 (and I would try to mention this in the title as well). This is better than an annotation that will be lost.

Quoted 7 lines
Quoted 4 lines

Having these four hugepage sizes available to use by DPDK, which is valid in case of '--in-memory' EAL option or using 4 separate mount points for each hugepage size;
hugepage_info_init() API reports an error.

Can you describe what is the impact from a user point of view rather than mentioning this internal function?

Yes please, we need to understand how much it is critical. Should we Cc [email protected] for backport?
Should it be merged at the last minute in 19.08?

Quoted 8 lines
Quoted 1 line

VPP usages in-memory option. So, VPP on ARM with kernel 5.2 wont' work without this patch.

Do you want to send a v2 with a better explanation?

I would suggest to restrict the change to Arm only with an ifdef, in order to limit the risk for this release.
We can think about a dynamic hugepage scan in the next release.

I don't see how this is necessary. The 3 is an arbitrary number here, and the ABI isn't broken as this is an internal structure. We could increase it to 16 for all i care, and it wouldn't make any difference to the rest of the code - we never populate more than we can find anyway.

Signature · 2 lines
Thanks,
Anatoly
#6 lore raw
Quoted 10 lines · Anatoly
Quoted 4 lines · Thomas Monjalon

I would suggest to restrict the change to Arm only with an ifdef, in order to limit the risk for this release.
We can think about a dynamic hugepage scan in the next release.

I don't see how this is necessary. The 3 is an arbitrary number here, and the ABI isn't broken as this is an internal structure. We could increase it to 16 for all i care, and it wouldn't make any difference to the rest of the code - we never populate more than we can find anyway.

I agree on the principle.
But at the time this popped up, we were really close to the release. It seemed a way to mitigate any unforeseen issue by limiting to the platform that was affected.

Signature · 1 line
David Marchand
#7 lore raw

12/08/2019 11:49, David Marchand:

Quoted 12 lines
Quoted 9 lines · Anatoly
Quoted 3 lines · Thomas Monjalon

I would suggest to restrict the change to Arm only with an ifdef, in order to limit the risk for this release.
We can think about a dynamic hugepage scan in the next release.

I don't see how this is necessary. The 3 is an arbitrary number here, and the ABI isn't broken as this is an internal structure. We could increase it to 16 for all i care, and it wouldn't make any difference to the rest of the code - we never populate more than we can find anyway.

Quoted 4 lines

I agree on the principle.
But at the time this popped up, we were really close to the release. It seemed a way to mitigate any unforeseen issue by limiting to the platform that was affected.

Exactly, we were extra cautious.

Please increase the value for everybody, thanks.

#8 lore raw
In reply to David Marchand
Quoted 13 lines · David Marchand
Quoted 10 lines · Anatoly
Quoted 4 lines · Thomas Monjalon

I would suggest to restrict the change to Arm only with an ifdef, in order to limit the risk for this release.
We can think about a dynamic hugepage scan in the next release.

I don't see how this is necessary. The 3 is an arbitrary number here, and the ABI isn't broken as this is an internal structure. We could increase it to 16 for all i care, and it wouldn't make any difference to the rest of the code - we never populate more than we can find anyway.

Quoted 5 lines

I agree on the principle.
But at the time this popped up, we were really close to the release. It seemed a way to mitigate any unforeseen issue by limiting to the platform that was affected.

Fair enough. A follow up is needed so. Frankly, i don't see the need to complicate things with "dynamic" stuff here - a static array of 8 or 16 page sizes should be enough for everyone (TM).

Signature · 2 lines
Thanks,
Anatoly