Storage Performance Development Kit (SPDK)
 help / color / mirror / Atom feed
From: E.W.Z. <kreuzerkrieg at gmail.com>
To: spdk@lists.01.org
Subject: Re: [SPDK] core_mask and spawning new threads
Date: Wed, 21 Feb 2018 19:00:42 +0200	[thread overview]
Message-ID: <5a8da5b9.54081c0a.482b5.7263@mx.google.com> (raw)
In-Reply-To: FBE7E039FA50BF47A673AD0BD3CD56A83758CB8B@HASMSX105.ger.corp.intel.com

[-- Attachment #1: Type: text/plain, Size: 3317 bytes --]

Thanks, I already checked this document, as well as the one Benjamin provided. I resorted to more C++-ish solution using promise/future, which was mentioned in Bejamin’s link


Sent from Mail for Windows 10

From: Stojaczyk, DariuszX
Sent: Wednesday, February 21, 2018 6:09 PM
To: Storage Performance Development Kit
Subject: Re: [SPDK] core_mask and spawning new threads

For integrating your application further with SPDK, you might also want to check the following document:

http://www.spdk.io/doc/event.html

Regards,
D.

From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Stojaczyk, DariuszX
Sent: Wednesday, February 21, 2018 4:34 PM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: Re: [SPDK] core_mask and spawning new threads

> in case I'm integrating the SPDK into my existing application, I have to change the way I'm spawning thread in the whole application, right?
That's correct.
Regards,
D.

From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Ernest Zed
Sent: Wednesday, February 21, 2018 1:18 PM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: Re: [SPDK] core_mask and spawning new threads

Thanks for the explanation. Just to make it clear, in case I'm integrating the SPDK into my existing application, I have to change the way I'm spawning thread in the whole application, right?
Sincerely,
E.

On Wed, Feb 21, 2018 at 1:43 PM, Stojaczyk, DariuszX <dariuszx.stojaczyk(a)intel.com> wrote:
Hi Ernest,
This is expected behavior. SPDK starts a fixed number of affinitized threads on startup, and the core mask parameter you've mentioned is what specifies the affinity and number of those. Each thread is bound to a single CPU. The one thread that called `spdk_env_init` becomes a master thread and is affinitized to the `opts.master_core`. To spawn additional POSIX threads from any SPDK-affinitized thread, you should use `spdk_call_unaffinitized()` (include/spdk/env.h). 
 
(There's also an `spdk_unaffinitize_thread()`, but it's restricted to very specific workloads and probably shouldn't be used at all.)
Best regards,
D.
 
From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Ernest Zed
Sent: Wednesday, February 21, 2018 10:47 AM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: [SPDK] core_mask and spawning new threads
 
Hi all,
I see that all threads I create within my application are running on the same core. Looks like core_mask is the right parameter to adjust, however I dont see core usage affected by changing the core_mask on spdk_env_opts
The code:
    spdk_env_opts opts;
    spdk_env_opts_init(&opts);
    opts.name = "blah";
    opts.core_mask = "0xFFFF";
    opts.master_core = 1;
    opts.shm_id = 0;
    if (spdk_env_init(&opts) < 0) {
        throw std::runtime_error("Unable to initialize SPDK env");
    }
Whatever value I assign to the core_mask everything runs on the same core defined in master_core. If I set affinity to my threads manually everything works as expected. Is it a spdk_env_init bug? Am I doing something wrong?
Sincerely,
Ernest

_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk



[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 13863 bytes --]

             reply	other threads:[~2018-02-21 17:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21 17:00 E.W.Z. [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-02-22  8:27 [SPDK] core_mask and spawning new threads Wodkowski, PawelX
2018-02-21 17:40 E.W.Z.
2018-02-21 16:48 Walker, Benjamin
2018-02-21 16:09 Stojaczyk, DariuszX
2018-02-21 15:33 Stojaczyk, DariuszX
2018-02-21 12:18 Ernest Zed
2018-02-21 11:43 Stojaczyk, DariuszX
2018-02-21  9:46 Ernest Zed

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=5a8da5b9.54081c0a.482b5.7263@mx.google.com \
    --to=spdk@lists.01.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