summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2012-03-20 17:11:04 +0530
committerVijay Bellur <vijay@gluster.com>2012-03-20 10:42:42 -0700
commitb8e98e8d6fa1a783f9dac4eb17609f799fde4b2b (patch)
treee2a89c818c5bbf7edbb0280a8fd2ca3ae562686d /xlators
parentdbae3d58d7dbfb404211866a17da1559cdde3387 (diff)
performance/read-ahead: destroy pages which survived from being flushed
in flush_region because of frames waiting on them, after those frames are served. Change-Id: Ic8402f3da32058a1a11e62124b598b0ec3befeff BUG: 767948 Signed-off-by: Raghavendra G <raghavendra@gluster.com> Reviewed-on: http://review.gluster.com/2982 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/performance/read-ahead/src/page.c3
-rw-r--r--xlators/performance/read-ahead/src/read-ahead.c8
-rw-r--r--xlators/performance/read-ahead/src/read-ahead.h1
3 files changed, 10 insertions, 2 deletions
diff --git a/xlators/performance/read-ahead/src/page.c b/xlators/performance/read-ahead/src/page.c
index 1e6a92087a5..52b3fdaf367 100644
--- a/xlators/performance/read-ahead/src/page.c
+++ b/xlators/performance/read-ahead/src/page.c
@@ -508,6 +508,9 @@ ra_page_wakeup (ra_page_t *page)
ra_frame_fill (page, frame);
}
+ if (page->stale) {
+ ra_page_purge (page);
+ }
out:
return waitq;
}
diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c
index f7f16115b93..718bf3398dd 100644
--- a/xlators/performance/read-ahead/src/read-ahead.c
+++ b/xlators/performance/read-ahead/src/read-ahead.c
@@ -248,8 +248,12 @@ flush_region (call_frame_t *frame, ra_file_t *file, off_t offset, off_t size,
if (!trav->waitq) {
ra_page_purge (trav);
}
- else if (for_write) {
- trav->poisoned = 1;
+ else {
+ trav->stale = 1;
+
+ if (for_write) {
+ trav->poisoned = 1;
+ }
}
}
trav = next;
diff --git a/xlators/performance/read-ahead/src/read-ahead.h b/xlators/performance/read-ahead/src/read-ahead.h
index f5e73cb6697..4102a052d2c 100644
--- a/xlators/performance/read-ahead/src/read-ahead.h
+++ b/xlators/performance/read-ahead/src/read-ahead.h
@@ -85,6 +85,7 @@ struct ra_page {
size_t size;
struct ra_waitq *waitq;
struct iobref *iobref;
+ char stale;
};