From: Tejun Heo <tj@kernel.org>
To: shli@kernel.org
Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
neilb@suse.de, djbw@fb.com
Subject: Re: [patch 1/3] raid5: offload stripe handle to workqueue
Date: Tue, 30 Jul 2013 08:53:06 -0400 [thread overview]
Message-ID: <20130730125306.GC2599@htj.dyndns.org> (raw)
In-Reply-To: <20130730055257.527231772@kernel.org>
Hello,
On Tue, Jul 30, 2013 at 01:52:08PM +0800, shli@kernel.org wrote:
> +static void raid5_wakeup_stripe_thread(struct stripe_head *sh)
> +{
> + struct r5conf *conf = sh->raid_conf;
> + struct r5worker_group *group;
> + int i;
> +
> + if (conf->worker_cnt_per_group == 0) {
> + md_wakeup_thread(conf->mddev->thread);
> + return;
> + }
> +
> + group = conf->worker_groups + cpu_to_group(sh->cpu);
> +
> + for (i = 0; i < conf->worker_cnt_per_group; i++)
> + queue_work_on(sh->cpu, raid5_wq, &group->workers[i].work);
> +}
Another general suggestion. Using workqueue mechanism simply as
thread dispatching mechanism like above and then buliding your own
work dispatching code on top is usually a poor form. It usually is
much better to assign a single unit of work to a single work item as
it allows things like per work unit flushing and much easier
implementation of freezing. It's possible that you have some
overriding constraints here but if so it'd be nice if you can explain
it.
Thanks.
--
tejun
next prev parent reply other threads:[~2013-07-30 12:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-30 5:52 [patch 0/3] raid5: make stripe handling multi-threading shli
2013-07-30 5:52 ` [patch 1/3] raid5: offload stripe handle to workqueue shli
2013-07-30 11:46 ` Tejun Heo
2013-07-30 12:53 ` Tejun Heo [this message]
2013-07-30 13:07 ` Shaohua Li
2013-07-30 13:57 ` Tejun Heo
2013-07-31 1:24 ` Shaohua Li
2013-07-31 10:33 ` Tejun Heo
2013-08-01 2:01 ` Shaohua Li
2013-08-01 12:15 ` Tejun Heo
2013-07-30 5:52 ` [patch 2/3] raid5: sysfs entry to control worker thread number shli
2013-07-30 5:52 ` [patch 3/3] raid5: only wakeup necessary threads shli
2013-07-30 12:46 ` Tejun Heo
2013-07-30 13:24 ` Shaohua Li
2013-07-30 14:01 ` Tejun Heo
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=20130730125306.GC2599@htj.dyndns.org \
--to=tj@kernel.org \
--cc=djbw@fb.com \
--cc=linux-kernel@vger.kernel.org \
--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 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).