From: Andi Kleen <andi@firstfloor.org>
To: Anatol Pomozov <anatol.pomozov@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: Solving M produces N consumers scalability problem
Date: Mon, 04 Nov 2013 10:53:59 -0800 [thread overview]
Message-ID: <87wqkovvzs.fsf@tassilo.jf.intel.com> (raw)
In-Reply-To: <CAOMFOmWzERR7MDe65YHo--GdbO+QfnxZK=uWd7d3vCZ6ca97fw@mail.gmail.com> (Anatol Pomozov's message of "Fri, 1 Nov 2013 13:48:10 -0700")
Anatol Pomozov <anatol.pomozov@gmail.com> writes:
>
> One idea is not to use the spin_lock. It is the 'fair spin_lock' that
> has scalability problems
> http://pdos.csail.mit.edu/papers/linux:lock.pdf Maybe lockless
> datastructures can help here?
The standard spin lock is already improved.
But better locks just give you a small advantage, they don't
solve the real scaling problem.
>
> Another idea is avoid global datasctructures but I have a few
> questions here. Let's say we want to use per-CPU lists. But the
> problem is that producers/consumers are not distributed across all
> CPUs. Some CPU might have too many producers, some other might not
> have consumers at all. So we need some kind of migration from hot CPU
> to the cold one. What is the best way to achieve it? Are there any
> examples how to do this? Any other ideas?
per cpu is the standard approach, but usually overkill. Also
requires complex code to drain etc.
Some older patches also use per node, but that works very poorly
these days (nodes are far too big)
One way I like is to simply use a global (allocated) array of queues,
sized by total number of possible cpus (but significantly smaller) and
use the cpu number as a hash into the array.
-Andi
--
ak@linux.intel.com -- Speaking for myself only
next prev parent reply other threads:[~2013-11-04 18:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-01 20:48 Solving M produces N consumers scalability problem Anatol Pomozov
2013-11-04 18:53 ` Andi Kleen [this message]
2013-11-04 20:23 ` Anatol Pomozov
2013-11-04 20:28 ` Andi Kleen
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=87wqkovvzs.fsf@tassilo.jf.intel.com \
--to=andi@firstfloor.org \
--cc=anatol.pomozov@gmail.com \
--cc=linux-kernel@vger.kernel.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