diff options
Diffstat (limited to 'litmus/bank_proc.c')
-rw-r--r-- | litmus/bank_proc.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/litmus/bank_proc.c b/litmus/bank_proc.c index bd1fb961436f..08b58f94c391 100644 --- a/litmus/bank_proc.c +++ b/litmus/bank_proc.c | |||
@@ -145,6 +145,7 @@ unsigned int num_by_bitmask_index(unsigned int bitmask, unsigned int index) | |||
145 | return pos; | 145 | return pos; |
146 | } | 146 | } |
147 | 147 | ||
148 | /* helper functions to find the next colored pool index */ | ||
148 | static inline unsigned int first_index(unsigned long node) | 149 | static inline unsigned int first_index(unsigned long node) |
149 | { | 150 | { |
150 | unsigned int bank_no = 0, color_no = 0; | 151 | unsigned int bank_no = 0, color_no = 0; |
@@ -227,7 +228,7 @@ static inline unsigned int next_bank(unsigned long node, unsigned int current_ba | |||
227 | static inline unsigned int get_next_index(unsigned long node, unsigned int current_index) | 228 | static inline unsigned int get_next_index(unsigned long node, unsigned int current_index) |
228 | { | 229 | { |
229 | unsigned int bank_no, color_no, color_ret, bank_ret; | 230 | unsigned int bank_no, color_no, color_ret, bank_ret; |
230 | bank_no = current_index>>4; | 231 | bank_no = current_index>>4; // 2^4 = 16 colors |
231 | color_no = current_index - bank_no*NUM_COLORS; | 232 | color_no = current_index - bank_no*NUM_COLORS; |
232 | bank_ret = bank_no; | 233 | bank_ret = bank_no; |
233 | color_ret = next_color(node, color_no); | 234 | color_ret = next_color(node, color_no); |
@@ -455,37 +456,10 @@ struct page* get_colored_page(unsigned long color) | |||
455 | */ | 456 | */ |
456 | struct page *new_alloc_page(struct page *page, unsigned long node, int **x) | 457 | struct page *new_alloc_page(struct page *page, unsigned long node, int **x) |
457 | { | 458 | { |
458 | // printk("allocate new page node = %d\n", node); | ||
459 | // return alloc_pages_exact_node(node, GFP_HIGHUSER_MOVABLE, 0); | ||
460 | struct color_group *cgroup; | 459 | struct color_group *cgroup; |
461 | struct page *rPage = NULL; | 460 | struct page *rPage = NULL; |
462 | unsigned int color; | 461 | unsigned int color; |
463 | int try = 0; | 462 | int try = 0; |
464 | |||
465 | |||
466 | /* | ||
467 | unsigned int idx = 0; | ||
468 | idx += num_by_bitmask_index(set_partition[node], set_index[node]); | ||
469 | idx += number_cachecolors* num_by_bitmask_index(bank_partition[node], bank_index[node]); | ||
470 | //printk("node = %d, idx = %d\n", node, idx); | ||
471 | |||
472 | rPage = new_alloc_page_color(idx); | ||
473 | |||
474 | set_index[node] = (set_index[node]+1) % counting_one_set(set_partition[node]); | ||
475 | bank_index[node] = (bank_index[node]+1) % counting_one_set(bank_partition[node]); | ||
476 | while (!rPage) { | ||
477 | try++; | ||
478 | if (try>=256) | ||
479 | break; | ||
480 | idx = 0; | ||
481 | idx += num_by_bitmask_index(set_partition[node], set_index[node]); | ||
482 | idx += number_cachecolors* num_by_bitmask_index(bank_partition[node], bank_index[node]); | ||
483 | printk(KERN_ALERT "out of page! requesting node = %d, idx = %d\n", node, idx); | ||
484 | rPage = new_alloc_page_color(idx); | ||
485 | set_index[node] = (set_index[node]+1) % counting_one_set(set_partition[node]); | ||
486 | bank_index[node] = (bank_index[node]+1) % counting_one_set(bank_partition[node]); | ||
487 | } | ||
488 | */ | ||
489 | unsigned int idx; | 463 | unsigned int idx; |
490 | 464 | ||
491 | if (node_index[node] == -1) | 465 | if (node_index[node] == -1) |
@@ -507,7 +481,7 @@ struct page *new_alloc_page(struct page *page, unsigned long node, int **x) | |||
507 | idx = get_next_index(node, idx); | 481 | idx = get_next_index(node, idx); |
508 | printk(KERN_ALERT "try = %d out of page! requesting node = %d, idx = %d\n", try, node, idx); | 482 | printk(KERN_ALERT "try = %d out of page! requesting node = %d, idx = %d\n", try, node, idx); |
509 | BUG_ON(idx<0 || idx>127); | 483 | BUG_ON(idx<0 || idx>127); |
510 | rPage = new_alloc_page_color(idx); | 484 | rPage = new_alloc_page_color(idx); |
511 | } | 485 | } |
512 | node_index[node] = idx; | 486 | node_index[node] = idx; |
513 | return rPage; | 487 | return rPage; |