Ejemplo n.º 1
0
        public static void tick()
        {
            RowStat.AccessInfo temp;
            ulong rowkey;

            rowkey = RowStat.KeyGen(Row_Migration_Policies.target_req);

            if (!RowStat.NVMDict.ContainsKey(rowkey))
            {
                return;
            }

            temp = RowStat.NVMDict[rowkey];

            if (temp.addlist)
            {
                return;
            }

            if ((temp.ReadMiss + temp.WriteMiss * weight > MissThresh) && (!Migration.migrationlist.Contains(rowkey)))
            {
                Migration.migrationlist.Add(rowkey);
                Migration.migrationlistPID.Add(temp.pid);
                migration_num++;
                temp.addlist            = true;
                RowStat.NVMDict[rowkey] = temp;
            }
        }
Ejemplo n.º 2
0
        public static void tick()
        {
            RowStat.AccessInfo temp;
            ulong rowkey;

            rowkey = RowStat.KeyGen(Row_Migration_Policies.target_req);

            if (!RowStat.NVMDict.ContainsKey(rowkey))
            {
                return;
            }

            temp = RowStat.NVMDict[rowkey];

            if (temp.addlist)
            {
                return;
            }

            //               double utility = (temp.ReadMiss * RowStat.t_rd_miss_diff * temp.ReadMLPnum + weight * temp.WriteMiss * RowStat.t_wr_miss_diff * temp.WriteMLPnum)  * ThreadWeight[temp.pid];

            double utility = (temp.ReadMiss * diff_read_cost * temp.ReadMLPnum + temp.WriteMiss * diff_write_cost * temp.WriteMLPnum) * ThreadWeight[temp.pid];



            //               if (temp.effectiveness > RowStat.eff[temp.pid])
            if ((utility > eff_thresh) && (!Migration.migrationlist.Contains(rowkey)))
            {
                Migration.migrationlist.Add(rowkey);
                Migration.migrationlistPID.Add(temp.pid);
                migration_num++;
                temp.addlist            = true;
                RowStat.NVMDict[rowkey] = temp;
            }
        }
Ejemplo n.º 3
0
        public static void tick()
        {
            //Console.WriteLine("AC policy tick() called\n");
            RowStat.AccessInfo temp;
            ulong rowkey;

            rowkey = RowStat.KeyGen(Row_Migration_Policies.target_req);

            if (!RowStat.NVMDict.ContainsKey(rowkey))
            {
                return;
            }

            temp = RowStat.NVMDict[rowkey];

            if (temp.addlist)
            {
                return;
            }

            uint   c_value = temp.counter;
            double c_n     = Math.Pow(2, c_value);
            double c_n1    = Math.Pow(2, c_value + 1);

            int    rand_num = randm.Next(0, 99);
            double prob_val = 100 / (c_n1 - c_n);

            if (rand_num < prob_val)
            {
                temp.counter++;
            }

            c_value = temp.counter;
            //double utility = (temp.ReadMiss * diff_read_cost * temp.ReadMLPnum + temp.WriteMiss * diff_write_cost * temp.WriteMLPnum)  * ThreadWeight[temp.pid];


            if ((c_value >= 7) && (!Migration.migrationlist.Contains(rowkey)))
            {
                Migration.migrationlist.Add(rowkey);
                Migration.migrationlistPID.Add(temp.pid);
                migration_num++;
                temp.addlist            = true;
                temp.counter            = 0;
                RowStat.NVMDict[rowkey] = temp;
            }
        }