All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Brown <david.brown@hesbynett.no>
To: NeilBrown <neilb@suse.de>
Cc: Shaohua Li <shli@kernel.org>,
	linux-raid@vger.kernel.org, dan.j.williams@intel.com
Subject: Re: [RFC]raid5: multiple thread handle stripe
Date: Tue, 17 Jul 2012 16:17:16 +0200	[thread overview]
Message-ID: <500573EC.4040409@hesbynett.no> (raw)
In-Reply-To: <20120716144746.08d26926@notabene.brown>

On 16/07/12 06:47, NeilBrown wrote:
> On Mon, 9 Jul 2012 16:00:24 +0800 Shaohua Li<shli@kernel.org>  wrote:
>
>> I had another implementation of raid5 mult-thread. The basic idea is to record
>> stripe submitted CPU. Each cpu has a thread, which only handles stripes
>> submitted from this cpu.
>>
>> Dan mentioned similar idea several day ago. I used to think we need make
>> conf->device_lock per-cpu to make this work, but turn out that isn't required.
>> Simply using percpu list and still using global device_lock works here.
>> Performance is good too.
>>
>> This is a RFC patch, I'll resubmit in a better reviewable way if you like the idea.
>
> I mostly like this, thanks.  It seems to take a fairly simple approach -
> having a single list of pending stripes and each thread just takes the ones
> that are relevant for it.
>
> I'm not convinced of the idea of having one thread for every CPU though. I
> wonder if we should be more NUMA-aware.
> E.g. on an Intel core with SMT we want at most one thread per core, not one
> thread per control thread.
> Similarly in a larger NUMA machine we might want one or 2 threads per node
> even if they have multiple CPUs.  Does that seem reasonable?
>

Raid can't be the only task in the kernel that has this sort of balanced 
requirement of multiple threads, but for which one thread per virtual 
cpu would be overkill.  A brief look at my own system shows multiple 
per-cpu threads for things like block devices and ext4 systems, which 
would surely have the same requirements here.  It strikes me that if it 
is currently not considered excessive to have one thread per cpu per 
mounted ext4 filesystem, for example, then one thread per cpu per raid 
device is not going to have excessive overheads either.  Conversely, if 
it /does/ make sense to limit the thread count for raid on larger 
machines, then perhaps the same logic should be used for other related 
tasks such as block drivers and filesystem threads.

mvh.,

David


  reply	other threads:[~2012-07-17 14:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09  8:00 [RFC]raid5: multiple thread handle stripe Shaohua Li
2012-07-16  4:47 ` NeilBrown
2012-07-17 14:17   ` David Brown [this message]
2012-07-17 20:03   ` Shaohua Li

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=500573EC.4040409@hesbynett.no \
    --to=david.brown@hesbynett.no \
    --cc=dan.j.williams@intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=shli@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.