Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lustre-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
debian-packages
lustre-release
Commits
6e34800c
Commit
6e34800c
authored
17 years ago
by
Jinshan Xiong
Browse files
Options
Downloads
Patches
Plain Diff
fixed some minor issues.
r=alex
parent
5b1dc1a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lustre/kernel_patches/patches/raid5-zerocopy.patch
+21
-19
21 additions, 19 deletions
lustre/kernel_patches/patches/raid5-zerocopy.patch
with
21 additions
and
19 deletions
lustre/kernel_patches/patches/raid5-zerocopy.patch
+
21
−
19
View file @
6e34800c
...
@@ -20,33 +20,35 @@ diff -pru linux-2.6.9.orig/drivers/md/raid5.c linux-2.6.9/drivers/md/raid5.c
...
@@ -20,33 +20,35 @@ diff -pru linux-2.6.9.orig/drivers/md/raid5.c linux-2.6.9/drivers/md/raid5.c
clear_bit(R5_LOCKED, &sh->dev[i].flags);
clear_bit(R5_LOCKED, &sh->dev[i].flags);
set_bit(STRIPE_HANDLE, &sh->state);
set_bit(STRIPE_HANDLE, &sh->state);
__release_stripe(conf, sh);
__release_stripe(conf, sh);
@@ -621,6 +626,25 @@
static sector_t compute_blocknr(struct s
@@ -620,7 +625,27 @@
static sector_t compute_blocknr(struct s
return r_sector;
}
}
+static struct page *zero_copy_data(struct bio *bio, sector_t sector)
+static struct page *zero_copy_data(struct bio *bio, sector_t sector)
+{
+{
+ sector_t bi_sector = bio->bi_sector;
+ sector_t bi_sector = bio->bi_sector;
+ struct page *page;
+ struct page *page
= NULL
;
+ struct bio_vec *bvl;
+ struct bio_vec *bvl;
+ int i;
+ int i;
+
+ bio_for_each_segment(bvl, bio, i) {
+ bio_for_each_segment(bvl, bio, i) {
+ if (sector > bi_sector) {
+ if (sector == bi_sector)
+ bi_sector += bio_iovec_idx(bio, i)->bv_len >> 9;
+ page = bio_iovec_idx(bio, i)->bv_page;
+ continue;
+ bi_sector += bio_iovec_idx(bio, i)->bv_len >> 9;
+ if (bi_sector >= sector + STRIPE_SECTORS) {
+ /* check if the stripe is covered by one page */
+ if (page == bio_iovec_idx(bio, i)->bv_page &&
+ PageConstant(page))
+ return page;
+ return NULL;
+ }
+ }
+ BUG_ON(sector != bi_sector);
+ page = bio_iovec_idx(bio, i)->bv_page;
+ return PageConstant(page) ? page : NULL;
+ }
+ }
+ BUG();
+ return NULL;
+ return NULL;
+}
+}
/*
/*
* Copy data between a page in the stripe cache, and one or more bion
* Copy data between a page in the stripe cache, and one or more bion
@@ -716,8 +74
0
,9 @@
static void compute_parity(struct stripe
@@ -716,8 +74
1
,9 @@
static void compute_parity(struct stripe
{
{
raid5_conf_t *conf = sh->raid_conf;
raid5_conf_t *conf = sh->raid_conf;
int i, pd_idx = sh->pd_idx, disks = conf->raid_disks, count;
int i, pd_idx = sh->pd_idx, disks = conf->raid_disks, count;
...
@@ -57,7 +59,7 @@ diff -pru linux-2.6.9.orig/drivers/md/raid5.c linux-2.6.9/drivers/md/raid5.c
...
@@ -57,7 +59,7 @@ diff -pru linux-2.6.9.orig/drivers/md/raid5.c linux-2.6.9/drivers/md/raid5.c
PRINTK("compute_parity, stripe %llu, method %d\n",
PRINTK("compute_parity, stripe %llu, method %d\n",
(unsigned long long)sh->sector, method);
(unsigned long long)sh->sector, method);
@@ -744,13 +7
69
,14 @@
static void compute_parity(struct stripe
@@ -744,13 +7
70
,14 @@
static void compute_parity(struct stripe
break;
break;
case RECONSTRUCT_WRITE:
case RECONSTRUCT_WRITE:
memset(ptr[0], 0, STRIPE_SIZE);
memset(ptr[0], 0, STRIPE_SIZE);
...
@@ -73,7 +75,7 @@ diff -pru linux-2.6.9.orig/drivers/md/raid5.c linux-2.6.9/drivers/md/raid5.c
...
@@ -73,7 +75,7 @@ diff -pru linux-2.6.9.orig/drivers/md/raid5.c linux-2.6.9/drivers/md/raid5.c
break;
break;
case CHECK_PARITY:
case CHECK_PARITY:
break;
break;
@@ -760,34 +78
6
,88 @@
static void compute_parity(struct stripe
@@ -760,34 +78
7
,88 @@
static void compute_parity(struct stripe
count = 1;
count = 1;
}
}
...
@@ -114,7 +116,7 @@ diff -pru linux-2.6.9.orig/drivers/md/raid5.c linux-2.6.9/drivers/md/raid5.c
...
@@ -114,7 +116,7 @@ diff -pru linux-2.6.9.orig/drivers/md/raid5.c linux-2.6.9/drivers/md/raid5.c
- set_bit(R5_LOCKED, &sh->dev[i].flags);
- set_bit(R5_LOCKED, &sh->dev[i].flags);
- set_bit(R5_UPTODATE, &sh->dev[i].flags);
- set_bit(R5_UPTODATE, &sh->dev[i].flags);
+ atomic_inc(&conf->writes_copied);
+ atomic_inc(&conf->writes_copied);
+
test_and_
clear_bit(R5_OVERWRITE, &sh->dev[i].flags);
+ clear_bit(R5_OVERWRITE, &sh->dev[i].flags);
+ set_bit(R5_UPTODATE, &sh->dev[i].flags);
+ set_bit(R5_UPTODATE, &sh->dev[i].flags);
+ while (wbi && wbi->bi_sector < sector + STRIPE_SECTORS) {
+ while (wbi && wbi->bi_sector < sector + STRIPE_SECTORS) {
+ copy_data(1, wbi, sh->dev[i].page, sector);
+ copy_data(1, wbi, sh->dev[i].page, sector);
...
@@ -179,7 +181,7 @@ diff -pru linux-2.6.9.orig/drivers/md/raid5.c linux-2.6.9/drivers/md/raid5.c
...
@@ -179,7 +181,7 @@ diff -pru linux-2.6.9.orig/drivers/md/raid5.c linux-2.6.9/drivers/md/raid5.c
}
}
if (count != 1)
if (count != 1)
xor_block(count, STRIPE_SIZE, ptr);
xor_block(count, STRIPE_SIZE, ptr);
@@ -1059,13 +11
39
,15 @@
static void handle_stripe(struct stripe_
@@ -1059,13 +11
40
,15 @@
static void handle_stripe(struct stripe_
if (sh->dev[i].written) {
if (sh->dev[i].written) {
dev = &sh->dev[i];
dev = &sh->dev[i];
if (!test_bit(R5_LOCKED, &dev->flags) &&
if (!test_bit(R5_LOCKED, &dev->flags) &&
...
@@ -192,11 +194,11 @@ diff -pru linux-2.6.9.orig/drivers/md/raid5.c linux-2.6.9/drivers/md/raid5.c
...
@@ -192,11 +194,11 @@ diff -pru linux-2.6.9.orig/drivers/md/raid5.c linux-2.6.9/drivers/md/raid5.c
spin_lock_irq(&conf->device_lock);
spin_lock_irq(&conf->device_lock);
wbi = dev->written;
wbi = dev->written;
dev->written = NULL;
dev->written = NULL;
+
test_and_
clear_bit(R5_Direct, &dev->flags);
+ clear_bit(R5_Direct, &dev->flags);
while (wbi && wbi->bi_sector < dev->sector + STRIPE_SECTORS) {
while (wbi && wbi->bi_sector < dev->sector + STRIPE_SECTORS) {
wbi2 = r5_next_bio(wbi, dev->sector);
wbi2 = r5_next_bio(wbi, dev->sector);
if (--wbi->bi_phys_segments == 0) {
if (--wbi->bi_phys_segments == 0) {
@@ -1831,6 +191
3
,7 @@
memory = conf->max_nr_stripes * (sizeof(
@@ -1831,6 +191
4
,7 @@
memory = conf->max_nr_stripes * (sizeof(
if (mddev->queue->backing_dev_info.ra_pages < 2 * stripe)
if (mddev->queue->backing_dev_info.ra_pages < 2 * stripe)
mddev->queue->backing_dev_info.ra_pages = 2 * stripe;
mddev->queue->backing_dev_info.ra_pages = 2 * stripe;
}
}
...
@@ -204,7 +206,7 @@ diff -pru linux-2.6.9.orig/drivers/md/raid5.c linux-2.6.9/drivers/md/raid5.c
...
@@ -204,7 +206,7 @@ diff -pru linux-2.6.9.orig/drivers/md/raid5.c linux-2.6.9/drivers/md/raid5.c
/* Ok, everything is just fine now */
/* Ok, everything is just fine now */
mddev->array_size = mddev->size * (mddev->raid_disks - 1);
mddev->array_size = mddev->size * (mddev->raid_disks - 1);
@@ -1918,9 +200
1
,11 @@
static void status (struct seq_file *seq
@@ -1918,9 +200
2
,11 @@
static void status (struct seq_file *seq
atomic_read(&conf->handled_in_raid5d),
atomic_read(&conf->handled_in_raid5d),
atomic_read(&conf->out_of_stripes),
atomic_read(&conf->out_of_stripes),
atomic_read(&conf->handle_called));
atomic_read(&conf->handle_called));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment