DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wang, Haiyue" <haiyue.wang@intel.com>
To: Don Wallwork <donw@xsightlabs.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "stephen@networkplumber.org" <stephen@networkplumber.org>,
	"mb@smartsharesystems.com" <mb@smartsharesystems.com>,
	"Burakov, Anatoly" <anatoly.burakov@intel.com>,
	"dmitry.kozliuk@gmail.com" <dmitry.kozliuk@gmail.com>,
	"Richardson, Bruce" <bruce.richardson@intel.com>,
	 "Honnappa.Nagarahalli@arm.com" <Honnappa.Nagarahalli@arm.com>,
	"nd@arm.com" <nd@arm.com>
Subject: RE: [PATCH] eal: allow worker lcore stacks to be allocated from hugepage memory
Date: Wed, 4 May 2022 03:08:15 +0000	[thread overview]
Message-ID: <BYAPR11MB3495C4D2DAAB4F58A48FB1D8F7C39@BYAPR11MB3495.namprd11.prod.outlook.com> (raw)
In-Reply-To: <8f603ca2-e4d9-696e-db2d-6d90d2ccc50f@xsightlabs.com>

> -----Original Message-----
> From: Don Wallwork <donw@xsightlabs.com>
> Sent: Wednesday, May 4, 2022 03:47
> To: Wang, Haiyue <haiyue.wang@intel.com>; dev@dpdk.org
> Cc: stephen@networkplumber.org; mb@smartsharesystems.com; Burakov, Anatoly <anatoly.burakov@intel.com>;
> dmitry.kozliuk@gmail.com; Richardson, Bruce <bruce.richardson@intel.com>; Honnappa.Nagarahalli@arm.com;
> nd@arm.com
> Subject: Re: [PATCH] eal: allow worker lcore stacks to be allocated from hugepage memory
> 
> On 5/3/2022 9:08 AM, Wang, Haiyue wrote:
> >> -----Original Message-----
> >> From: Don Wallwork <donw@xsightlabs.com>
> >> Sent: Monday, May 2, 2022 22:11
> >> To: dev@dpdk.org
> >> Cc: donw@xsightlabs.com; stephen@networkplumber.org; mb@smartsharesystems.com; Burakov, Anatoly
> >> <anatoly.burakov@intel.com>; dmitry.kozliuk@gmail.com; Richardson, Bruce
> <bruce.richardson@intel.com>;
> >> Honnappa.Nagarahalli@arm.com; nd@arm.com
> >> Subject: [PATCH] eal: allow worker lcore stacks to be allocated from hugepage memory
> >>
> >> Add support for using hugepages for worker lcore stack memory.  The
> >> intent is to improve performance by reducing stack memory related TLB
> >> misses and also by using memory local to the NUMA node of each lcore.
> >>
> >> EAL option '--huge-worker-stack [stack-size-kbytes]' is added to allow
> >> the feature to be enabled at runtime.  If the size is not specified,
> >> the system pthread stack size will be used.
> >>
> >> Signed-off-by: Don Wallwork <donw@xsightlabs.com>
> >> ---
> >>   lib/eal/common/eal_common_options.c | 31 ++++++++++++++
> >>   lib/eal/common/eal_internal_cfg.h   |  4 ++
> >>   lib/eal/common/eal_options.h        |  2 +
> >>   lib/eal/linux/eal.c                 | 65 ++++++++++++++++++++++++++++-
> >>   4 files changed, 100 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
> >> index f247a42455..be9db9ee37 100644
> >> --- a/lib/eal/common/eal_common_options.c
> >> +++ b/lib/eal/common/eal_common_options.c
> >> @@ -103,6 +103,7 @@ eal_long_options[] = {
> >>   	{OPT_TELEMETRY,         0, NULL, OPT_TELEMETRY_NUM        },
> >>   	{OPT_NO_TELEMETRY,      0, NULL, OPT_NO_TELEMETRY_NUM     },
> >>   	{OPT_FORCE_MAX_SIMD_BITWIDTH, 1, NULL, OPT_FORCE_MAX_SIMD_BITWIDTH_NUM},
> >> +	{OPT_HUGE_WORKER_STACK, 2, NULL, OPT_HUGE_WORKER_STACK_NUM     },
> >>
> >>   	{0,                     0, NULL, 0                        }
> >>   };
> >> @@ -1618,6 +1619,22 @@ eal_parse_huge_unlink(const char *arg, struct hugepage_file_discipline *out)
> >>   	return -1;
> >>   }
> >>
> >> +static int
> >> +eal_parse_huge_worker_stack(const char *arg, size_t *huge_worker_stack_size)
> >> +{
> >> +	size_t worker_stack_size;
> >> +	if (arg == NULL) {
> >> +		*huge_worker_stack_size = USE_OS_STACK_SIZE;
> >> +		return 0;
> >> +	}
> >> +	worker_stack_size = atoi(arg);
> >> +	if (worker_stack_size == 0)
> >> +		return -1;
> > Should we also to check "worker_stack_size *1024  < PTHREAD_STACK_MIN" ?
> This may be too restrictive in certain environments.  For example,
> memory constrained platforms may require a smaller worker stack size
> than this limit would allow.

Understood, thanks.

> >> +
> >> +	*huge_worker_stack_size = worker_stack_size * 1024;
> >> +	return 0;
> >> +}
> >> +
> >
> >> --
> >> 2.17.1


  reply	other threads:[~2022-05-04  3:08 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02 14:10 Don Wallwork
2022-05-03  6:10 ` Morten Brørup
2022-05-03 13:08 ` Wang, Haiyue
2022-05-03 19:46   ` Don Wallwork
2022-05-04  3:08     ` Wang, Haiyue [this message]
2022-05-13 17:58 ` [PATCH v2] " Don Wallwork
2022-05-13 21:38   ` Stephen Hemminger
2022-05-16 19:43     ` Don Wallwork
2022-05-13 21:41   ` Stephen Hemminger
2022-05-14  3:31   ` fengchengwen
2022-05-16 19:47     ` Don Wallwork
2022-05-17  6:28       ` Morten Brørup
2022-05-16 19:50 ` [PATCH v3] " Don Wallwork
2022-05-16 20:28   ` Stephen Hemminger
2022-05-16 20:29     ` Don Wallwork
2022-05-17 15:31 ` [PATCH v4] " Don Wallwork
2022-05-17 15:56   ` Stephen Hemminger
2022-05-18 14:10     ` Don Wallwork
2022-05-20  8:30   ` fengchengwen
2022-05-23 22:35   ` Kathleen Capella
2022-05-24 13:48     ` Don Wallwork
2022-05-24 14:40   ` Burakov, Anatoly
2022-05-24 19:38     ` Don Wallwork
2022-05-24 19:46 ` [PATCH v5] " Don Wallwork
2022-05-24 19:51 ` [PATCH v6] " Don Wallwork
2022-06-01  0:05   ` Kathleen Capella
2022-06-20  8:35   ` David Marchand
2022-06-21 10:37     ` Thomas Monjalon
2022-06-21 12:31       ` Don Wallwork
2022-06-21 14:42         ` Thomas Monjalon
2022-06-21 14:52           ` Don Wallwork
2022-06-21 15:00             ` Thomas Monjalon
2022-06-21 16:32               ` Honnappa Nagarahalli
2022-06-21 19:33               ` David Marchand
2022-06-23 11:21 ` [PATCH v7] " Don Wallwork
2022-06-23 20:32   ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR11MB3495C4D2DAAB4F58A48FB1D8F7C39@BYAPR11MB3495.namprd11.prod.outlook.com \
    --to=haiyue.wang@intel.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=donw@xsightlabs.com \
    --cc=mb@smartsharesystems.com \
    --cc=nd@arm.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).