aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/bank_proc.c
diff options
context:
space:
mode:
authorNamhoon Kim <namhoonk@cs.unc.edu>2017-04-10 11:10:37 -0400
committerNamhoon Kim <namhoonk@cs.unc.edu>2017-04-10 11:10:37 -0400
commit9309774d024934b71816efa41171f439b007f983 (patch)
tree2f86c57db4c2059c399a8850f480d0898253fa0b /litmus/bank_proc.c
parent0c2ed78df17cc5a41f977f70e1e4ab3b142ffa14 (diff)
patches
Diffstat (limited to 'litmus/bank_proc.c')
-rw-r--r--litmus/bank_proc.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/litmus/bank_proc.c b/litmus/bank_proc.c
index 9bf3dfa99cb2..6f54b770079f 100644
--- a/litmus/bank_proc.c
+++ b/litmus/bank_proc.c
@@ -19,6 +19,9 @@
19#include <litmus/sched_trace.h> 19#include <litmus/sched_trace.h>
20#include <litmus/litmus.h> 20#include <litmus/litmus.h>
21 21
22//#define TRACE(fmt, args...) do {} while (false)
23//#define TRACE_TASK(fmt, args...) do {} while (false)
24
22#define LITMUS_LOCKDEP_NAME_MAX_LEN 50 25#define LITMUS_LOCKDEP_NAME_MAX_LEN 50
23 26
24// This Address Decoding is used in imx6-sabredsd platform 27// This Address Decoding is used in imx6-sabredsd platform
@@ -27,7 +30,7 @@
27#define CACHE_MASK 0x0000f000 30#define CACHE_MASK 0x0000f000
28#define CACHE_SHIFT 12 31#define CACHE_SHIFT 12
29 32
30#define PAGES_PER_COLOR 1024 33#define PAGES_PER_COLOR 1000
31unsigned int NUM_PAGE_LIST; //8*16 34unsigned int NUM_PAGE_LIST; //8*16
32 35
33unsigned int number_banks; 36unsigned int number_banks;
@@ -245,8 +248,8 @@ static int do_add_pages(void)
245 counter[color]++; 248 counter[color]++;
246 // printk("page(%d) = color %x, bank %x, [color] =%d \n", color, page_color(page), page_bank(page), atomic_read(&color_groups[color].nr_pages)); 249 // printk("page(%d) = color %x, bank %x, [color] =%d \n", color, page_color(page), page_bank(page), atomic_read(&color_groups[color].nr_pages));
247 //show_nr_pages(); 250 //show_nr_pages();
248 if (atomic_read(&color_groups[color].nr_pages) < PAGES_PER_COLOR && color>=32) { 251 //if (atomic_read(&color_groups[color].nr_pages) < PAGES_PER_COLOR && color>=32) {
249 //if (atomic_read(&color_groups[color].nr_pages) < PAGES_PER_COLOR) { 252 if (atomic_read(&color_groups[color].nr_pages) < PAGES_PER_COLOR) {
250 //if ( PAGES_PER_COLOR && color>=16*2) { 253 //if ( PAGES_PER_COLOR && color>=16*2) {
251 add_page_to_color_list(page); 254 add_page_to_color_list(page);
252 // printk("add page(%d) = color %x, bank %x\n", color, page_color(page), page_bank(page)); 255 // printk("add page(%d) = color %x, bank %x\n", color, page_color(page), page_bank(page));
@@ -364,6 +367,7 @@ struct page *new_alloc_page(struct page *page, unsigned long node, int **x)
364 struct color_group *cgroup; 367 struct color_group *cgroup;
365 struct page *rPage = NULL; 368 struct page *rPage = NULL;
366 unsigned int color; 369 unsigned int color;
370 int try = 0;
367 371
368 372
369 unsigned int idx = 0; 373 unsigned int idx = 0;
@@ -373,9 +377,20 @@ struct page *new_alloc_page(struct page *page, unsigned long node, int **x)
373 377
374 rPage = new_alloc_page_color(idx); 378 rPage = new_alloc_page_color(idx);
375 379
376
377 set_index[node] = (set_index[node]+1) % counting_one_set(set_partition[node]); 380 set_index[node] = (set_index[node]+1) % counting_one_set(set_partition[node]);
378 bank_index[node] = (bank_index[node]+1) % counting_one_set(bank_partition[node]); 381 bank_index[node] = (bank_index[node]+1) % counting_one_set(bank_partition[node]);
382 while (!rPage) {
383 try++;
384 if (try>=16)
385 break;
386 idx = 0;
387 idx += num_by_bitmask_index(set_partition[node], set_index[node]);
388 idx += number_cachecolors* num_by_bitmask_index(bank_partition[node], bank_index[node]);
389 rPage = new_alloc_page_color(idx);
390 set_index[node] = (set_index[node]+1) % counting_one_set(set_partition[node]);
391 bank_index[node] = (bank_index[node]+1) % counting_one_set(bank_partition[node]);
392 }
393
379 return rPage; 394 return rPage;
380} 395}
381 396