revert patch: threading by io unit instead of stripe

sorry, earlier Casey, but the patch 'threading by io unit instead of stripe' from 6/20/2010 was nuts!  with PNFS_THREAD_BY_SERVER disabled, we definitely -don't- want to create a separate thread for each io unit (each READ/WRITE request to a ds).  we just want the one per stripe, as the intended alternative to PNFS_THREAD_BY_SERVER

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-08-31 11:38:56 -04:00 committed by unknown
parent e3cbc70f14
commit 641d9cf14b
2 changed files with 2 additions and 32 deletions

View file

@ -230,7 +230,6 @@ typedef struct __pnfs_io_pattern {
typedef struct __pnfs_io_thread { typedef struct __pnfs_io_thread {
pnfs_io_pattern *pattern; pnfs_io_pattern *pattern;
uint64_t offset; uint64_t offset;
uint64_t offset_end;
uint32_t id; uint32_t id;
enum stable_how4 stable; enum stable_how4 stable;
} pnfs_io_thread; } pnfs_io_thread;

View file

@ -35,14 +35,6 @@
#define IOLVL 2 /* dprintf level for pnfs io logging */ #define IOLVL 2 /* dprintf level for pnfs io logging */
static uint32_t io_unit_count(
const pnfs_file_layout *layout,
uint64_t length)
{
const uint32_t unit_size = layout_unit_size(layout);
return (uint32_t)(length / unit_size) + (length % unit_size ? 1 : 0);
}
static enum pnfs_status pattern_init( static enum pnfs_status pattern_init(
IN pnfs_io_pattern *pattern, IN pnfs_io_pattern *pattern,
IN nfs41_root *root, IN nfs41_root *root,
@ -54,9 +46,6 @@ static enum pnfs_status pattern_init(
IN uint64_t length, IN uint64_t length,
IN uint32_t default_lease) IN uint32_t default_lease)
{ {
#ifndef PNFS_THREAD_BY_SERVER
pnfs_io_unit io;
#endif
uint64_t pos; uint64_t pos;
uint32_t i; uint32_t i;
enum pnfs_status status; enum pnfs_status status;
@ -69,7 +58,7 @@ static enum pnfs_status pattern_init(
#ifdef PNFS_THREAD_BY_SERVER #ifdef PNFS_THREAD_BY_SERVER
pattern->count = state->layout->device->servers.count; pattern->count = state->layout->device->servers.count;
#else #else
pattern->count = io_unit_count(state->layout, length); pattern->count = state->layout->device->stripes.count;
#endif #endif
pattern->threads = calloc(pattern->count, sizeof(pnfs_io_thread)); pattern->threads = calloc(pattern->count, sizeof(pnfs_io_thread));
if (pattern->threads == NULL) { if (pattern->threads == NULL) {
@ -92,26 +81,8 @@ static enum pnfs_status pattern_init(
for (i = 0; i < pattern->count; i++) { for (i = 0; i < pattern->count; i++) {
pattern->threads[i].pattern = pattern; pattern->threads[i].pattern = pattern;
pattern->threads[i].stable = FILE_SYNC4; pattern->threads[i].stable = FILE_SYNC4;
#ifdef PNFS_THREAD_BY_SERVER
pattern->threads[i].offset = pattern->offset_start; pattern->threads[i].offset = pattern->offset_start;
pattern->threads[i].offset_end = pattern->offset_end;
pattern->threads[i].id = i; pattern->threads[i].id = i;
#else
pnfs_file_device_io_unit(pattern, pos, &io);
pattern->threads[i].offset = pos;
pattern->threads[i].offset_end = pos += io.length;
pattern->threads[i].id = io.stripeid;
if (pattern->threads[i].offset > pattern->offset_end)
pattern->threads[i].offset = pattern->offset_end;
if (pattern->threads[i].offset_end > pattern->offset_end)
pattern->threads[i].offset_end = pattern->offset_end;
dprintf(IOLVL, "io_unit(off=%llu end=%llu id=%u)\n",
pattern->threads[i].offset,
pattern->threads[i].offset_end,
pattern->threads[i].id);
#endif
} }
out: out:
return status; return status;
@ -146,7 +117,7 @@ static enum pnfs_status thread_next_unit(
} }
/* loop until we find an io unit that matches this thread */ /* loop until we find an io unit that matches this thread */
while (thread->offset < thread->offset_end) { while (thread->offset < pattern->offset_end) {
status = pnfs_file_device_io_unit(pattern, thread->offset, io); status = pnfs_file_device_io_unit(pattern, thread->offset, io);
if (status) if (status)
break; break;