Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165800
b: refs/heads/master
c: 07a3b41
h: refs/heads/master
v: v3
  • Loading branch information
Dan Williams committed Aug 30, 2009
1 parent 635a295 commit 0184ffd
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b774ef491b4edf6876077014ecbb87f10c69c10f
refs/heads/master: 07a3b417dc3d00802bd7b4874c3e811f0b015a7d
11 changes: 11 additions & 0 deletions trunk/drivers/md/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,17 @@ config MD_RAID456

If unsure, say Y.

config MULTICORE_RAID456
bool "RAID-4/RAID-5/RAID-6 Multicore processing (EXPERIMENTAL)"
depends on MD_RAID456
depends on SMP
depends on EXPERIMENTAL
---help---
Enable the raid456 module to dispatch per-stripe raid operations to a
thread pool.

If unsure, say N.

config MD_RAID6_PQ
tristate

Expand Down
36 changes: 34 additions & 2 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <linux/kthread.h>
#include <linux/raid/pq.h>
#include <linux/async_tx.h>
#include <linux/async.h>
#include <linux/seq_file.h>
#include <linux/cpu.h>
#include "md.h"
Expand Down Expand Up @@ -4314,6 +4315,36 @@ static int retry_aligned_read(raid5_conf_t *conf, struct bio *raid_bio)
return handled;
}

#ifdef CONFIG_MULTICORE_RAID456
static void __process_stripe(void *param, async_cookie_t cookie)
{
struct stripe_head *sh = param;

handle_stripe(sh);
release_stripe(sh);
}

static void process_stripe(struct stripe_head *sh, struct list_head *domain)
{
async_schedule_domain(__process_stripe, sh, domain);
}

static void synchronize_stripe_processing(struct list_head *domain)
{
async_synchronize_full_domain(domain);
}
#else
static void process_stripe(struct stripe_head *sh, struct list_head *domain)
{
handle_stripe(sh);
release_stripe(sh);
cond_resched();
}

static void synchronize_stripe_processing(struct list_head *domain)
{
}
#endif


/*
Expand All @@ -4328,6 +4359,7 @@ static void raid5d(mddev_t *mddev)
struct stripe_head *sh;
raid5_conf_t *conf = mddev_to_conf(mddev);
int handled;
LIST_HEAD(raid_domain);

pr_debug("+++ raid5d active\n");

Expand Down Expand Up @@ -4364,15 +4396,15 @@ static void raid5d(mddev_t *mddev)
spin_unlock_irq(&conf->device_lock);

handled++;
handle_stripe(sh);
release_stripe(sh);
process_stripe(sh, &raid_domain);

spin_lock_irq(&conf->device_lock);
}
pr_debug("%d stripes handled\n", handled);

spin_unlock_irq(&conf->device_lock);

synchronize_stripe_processing(&raid_domain);
async_tx_issue_pending_all();
unplug_slaves(mddev);

Expand Down

0 comments on commit 0184ffd

Please sign in to comment.