Skip to contentSkip to conversation

examples/vhost: reduce number of hugepages needed

PATCH Superseded Bernard Iremonger 5 participants 11 messages Dec 10, 2015 – Dec 11, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples/vhost: reduce number of hugepages needed

Change MAX_QUEUES to 128 to reduce the number of hugepages required by the vhost-switch program.

---
 examples/vhost/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
examples/vhost/main.c +3 -2
index b30f1bd..8fb0adb 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -53,7 +53,8 @@
 
 #include "main.h"
 
-#define MAX_QUEUES 512
+/* decrease MAX_QUEUES from 512 to reduce number of hugepages needed */
+#define MAX_QUEUES 128
 
 /* the maximum number of external ports supported */
 #define MAX_SUP_PORTS 1
Signature · 1 line
2.6.3
Acked-by on v1 1/1
#1 lore raw
Quoted 22 lines · Bernard Iremonger

Change MAX_QUEUES to 128 to reduce the number of hugepages required by the vhost-switch program.

---
 examples/vhost/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
examples/vhost/main.c +1 -1
index b30f1bd..8fb0adb 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without

examples/vhost/main.c line 56

Quoted 5 lines
examples/vhost/main.c +1 -1
@@ -53,7 +53,8 @@
 
 #include "main.h"
 
-#define MAX_QUEUES 512
+/* decrease MAX_QUEUES from 512 to reduce number of hugepages needed */

Minor nit: I would suggest to simply remove this comment, which might be a bit confusing without the content (that 512 would let vhost-switch fail to start if given memory is small).

Otherwise, this patch looks good to me.

Thanks.

	--yliu
Quoted 6 lines
examples/vhost/main.c +1 -0
+#define MAX_QUEUES 128
 
 /* the maximum number of external ports supported */
 #define MAX_SUP_PORTS 1
Signature · 1 line
2.6.3
#2 lore raw

Hi Yuanhan,

<snip>

Quoted 21 lines
Quoted 9 lines

/*-
* BSD LICENSE
*

- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
  *   All rights reserved.

*
* Redistribution and use in source and binary forms, with or without

examples/vhost/main.c line 56

Quoted 5 lines
examples/vhost/main.c +1 -1
@@ -53,7 +53,8 @@
 
 #include "main.h"
 
-#define MAX_QUEUES 512
+/* decrease MAX_QUEUES from 512 to reduce number of hugepages

needed

Review line 57

Quoted 1 line
(quoted diff) +1 -0
+*/

Minor nit: I would suggest to simply remove this comment, which might be a bit confusing without the content (that 512 would let vhost-switch fail to start if given memory is small).

Quoted 8 lines

Otherwise, this patch looks good to me.

Thanks.

	--yliu

<snip>

I will remove the comment.
Can I keep your ack.

Regards,

Bernard.

#3 lore raw
Quoted 29 lines · Bernard

Hi Yuanhan,

<snip>

Quoted 25 lines
Quoted 9 lines

/*-
* BSD LICENSE
*

- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
  *   All rights reserved.

*
* Redistribution and use in source and binary forms, with or without

examples/vhost/main.c line 56

Quoted 5 lines
examples/vhost/main.c +1 -1
@@ -53,7 +53,8 @@
 
 #include "main.h"
 
-#define MAX_QUEUES 512
+/* decrease MAX_QUEUES from 512 to reduce number of hugepages

needed

Review line 57

Quoted 1 line
(quoted diff) +1 -0
+*/

Minor nit: I would suggest to simply remove this comment, which might be a bit confusing without the content (that 512 would let vhost-switch fail to start if given memory is small).

Otherwise, this patch looks good to me.

Quoted 8 lines
Quoted 4 lines

Thanks.

	--yliu

<snip>

I will remove the comment.
Can I keep your ack.

Thanks and sure, you can always keep one's ACK if you just need fix some minor nits when he has already given the ack.

	--yliu
#4 lore raw

PATCH v2 1/1 examples/vhost: reduce number of hugepages needed

In reply to Bernard Iremonger

Change MAX_QUEUES from 512 to 128 to reduce the number of hugepages required by the vhost-switch program.

Changes in v2:
remove comment added before #define MAX_QUEUES in v1 patch.

---
 examples/vhost/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
examples/vhost/main.c +2 -2
index b30f1bd..5ce5926 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -53,7 +53,7 @@
 
 #include "main.h"
 
-#define MAX_QUEUES 512
+#define MAX_QUEUES 128
 
 /* the maximum number of external ports supported */
 #define MAX_SUP_PORTS 1
Signature · 1 line
2.6.3
#5 lore raw
Quoted 8 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Bernard Iremonger
Sent: Thursday, December 10, 2015 1:53 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH v2] examples/vhost: reduce number of hugepages needed

Quoted 8 lines

Change MAX_QUEUES from 512 to 128 to reduce the number of hugepages required by the vhost-switch program.

Changes in v2:
remove comment added before #define MAX_QUEUES in v1 patch.

Wasn't it increased a while ago, because someone complained that 128 queues might not be enough on FVL?

Quoted 1 line

From git log I can see that it was first increased from 128 to 256,

then from 256 to 512.
The reason mentioned - HW that has bigger number of queues. Isn't it not the case anymore?
If yes, why?

BTW, shouldn't it be then at least:

+#ifndef MAX_QUEUES
+#define MAX_QUEUES 128
+#endif

So people can just do -D MAX_QUEUES=X at build time if they like(need) to. Konstantin

Quoted 28 lines
---
 examples/vhost/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
examples/vhost/main.c +2 -3
index b30f1bd..5ce5926 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -53,7 +53,7 @@
 
 #include "main.h"
 
-#define MAX_QUEUES 512
+#define MAX_QUEUES 128
 
 /* the maximum number of external ports supported */
 #define MAX_SUP_PORTS 1
--

2.6.3

#6 lore raw

Hi Konstantin,

<snip>

Quoted 27 lines
Quoted 11 lines

Subject: [dpdk-dev] [PATCH v2] examples/vhost: reduce number of hugepages needed

Change MAX_QUEUES from 512 to 128 to reduce the number of hugepages required by the vhost-switch program.

Changes in v2:
remove comment added before #define MAX_QUEUES in v1 patch.

Wasn't it increased a while ago, because someone complained that 128 queues might not be enough on FVL?
From git log I can see that it was first increased from 128 to 256, then from 256 to 512.
The reason mentioned - HW that has bigger number of queues.
Isn't it not the case anymore?
If yes, why?

BTW, shouldn't it be then at least:

(quoted diff) +3 -0
+#ifndef MAX_QUEUES
+#define MAX_QUEUES 128
+#endif
Quoted 3 lines

So people can just do -D MAX_QUEUES=X at build time if they like(need) to. Konstantin

<snip>

I will add #ifndef MAX_QUEUES and #endif.

Regards,

Bernard.

#7 lore raw
In reply to Ananyev, Konstantin
Quoted 32 lines · Konstantin
Quoted 8 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Bernard Iremonger
Sent: Thursday, December 10, 2015 1:53 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH v2] examples/vhost: reduce number of hugepages needed

Quoted 8 lines

Change MAX_QUEUES from 512 to 128 to reduce the number of hugepages required by the vhost-switch program.

Changes in v2:
remove comment added before #define MAX_QUEUES in v1 patch.

Wasn't it increased a while ago, because someone complained that 128 queues might not be enough on FVL?
From git log I can see that it was first increased from 128 to 256,
then from 256 to 512.
The reason mentioned - HW that has bigger number of queues. Isn't it not the case anymore?
If yes, why?

BTW, shouldn't it be then at least:

(quoted diff) +3 -0
+#ifndef MAX_QUEUES
+#define MAX_QUEUES 128
+#endif
Quoted 1 line

So people can just do -D MAX_QUEUES=X at build time if they like(need) to.

Being subject to constant changes back and forth suggests this really should be a runtime tunable rather than build time constant.

- Panu -

#8 lore raw

PATCH v3 1/1 examples/vhost: reduce number of hugepages needed

In reply to Bernard Iremonger

Add #ifndef MAX_QUEUES to change MAX_QUEUES at compile time if needed. Change MAX_QUEUES from 512 to 128 to reduce the number of hugepages required by the vhost-switch program.

To change MAX_QUEUES add '-D MAX_QUEUES=512' to the EXTRA_CFLAGS variable, before building the application.

Changes in v3:
Added #ifndef MAX_QUEUES line before #define MAX_QUEUES 128

Changes in v2:
remove comment added before #define MAX_QUEUES in v1 patch.

---
 examples/vhost/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
examples/vhost/main.c +4 -2
index b30f1bd..2dcdacb 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -53,7 +53,9 @@
 
 #include "main.h"
 
-#define MAX_QUEUES 512
+#ifndef MAX_QUEUES
+#define MAX_QUEUES 128
+#endif
 
 /* the maximum number of external ports supported */
 #define MAX_SUP_PORTS 1
Signature · 1 line
2.6.3
Acked-by on v3 1/1
#9 lore raw
Quoted 42 lines

-----Original Message-----
From: Iremonger, Bernard
Sent: Thursday, December 10, 2015 3:49 PM
To: [email protected]
Cc: Xie, Huawei; [email protected]; Ananyev, Konstantin; Iremonger, Bernard
Subject: [PATCH v3] examples/vhost: reduce number of hugepages needed

Add #ifndef MAX_QUEUES to change MAX_QUEUES at compile time if needed. Change MAX_QUEUES from 512 to 128 to reduce the number of hugepages required by the vhost-switch program.

To change MAX_QUEUES add '-D MAX_QUEUES=512' to the EXTRA_CFLAGS variable, before building the application.

Changes in v3:
Added #ifndef MAX_QUEUES line before #define MAX_QUEUES 128

Changes in v2:
remove comment added before #define MAX_QUEUES in v1 patch.

---
 examples/vhost/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
examples/vhost/main.c +1 -1
index b30f1bd..2dcdacb 100644
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -53,7 +53,9 @@
 

examples/vhost/main.c

Quoted 10 lines
examples/vhost/main.c +3 -2
 #include "main.h"
 
-#define MAX_QUEUES 512
+#ifndef MAX_QUEUES
+#define MAX_QUEUES 128
+#endif
 
 /* the maximum number of external ports supported */
 #define MAX_SUP_PORTS 1
--
Quoted 1 line

2.6.3

#10 lore raw
Quoted 10 lines
Quoted 10 lines

Add #ifndef MAX_QUEUES to change MAX_QUEUES at compile time if needed. Change MAX_QUEUES from 512 to 128 to reduce the number of hugepages required by the vhost-switch program.

To change MAX_QUEUES add '-D MAX_QUEUES=512' to the EXTRA_CFLAGS variable, before building the application.

Changes in v3:
Added #ifndef MAX_QUEUES line before #define MAX_QUEUES 128

Quoted 6 lines
Quoted 4 lines

Changes in v2:
remove comment added before #define MAX_QUEUES in v1 patch.

Applied, thanks