changeset a59c189de383 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=a59c189de383
description:
        cpu: Remove unused deallocateContext calls

        The call paths for de-scheduling a thread are halt() and suspend(), from
        the thread context. There is no call to deallocateContext() in general,
        though some CPUs chose to define it. This patch removes the function
        from BaseCPU and the cores which do not require it.

diffstat:

 src/cpu/base.hh                     |   3 ---
 src/cpu/inorder/inorder_dyn_inst.cc |   6 ------
 src/cpu/inorder/inorder_dyn_inst.hh |   7 -------
 src/cpu/inorder/thread_context.hh   |   3 ---
 src/cpu/o3/cpu.cc                   |  16 +++++-----------
 src/cpu/o3/cpu.hh                   |   5 -----
 src/cpu/simple/base.cc              |   8 --------
 src/cpu/simple/base.hh              |   1 -
 8 files changed, 5 insertions(+), 44 deletions(-)

diffs (140 lines):

diff -r a9023811bf9e -r a59c189de383 src/cpu/base.hh
--- a/src/cpu/base.hh   Sat Sep 20 17:18:35 2014 -0400
+++ b/src/cpu/base.hh   Sat Sep 20 17:18:36 2014 -0400
@@ -257,9 +257,6 @@
     /// Notify the CPU that the indicated context is now suspended.
     virtual void suspendContext(ThreadID thread_num) {}
 
-    /// Notify the CPU that the indicated context is now deallocated.
-    virtual void deallocateContext(ThreadID thread_num) {}
-
     /// Notify the CPU that the indicated context is now halted.
     virtual void haltContext(ThreadID thread_num) {}
 
diff -r a9023811bf9e -r a59c189de383 src/cpu/inorder/inorder_dyn_inst.cc
--- a/src/cpu/inorder/inorder_dyn_inst.cc       Sat Sep 20 17:18:35 2014 -0400
+++ b/src/cpu/inorder/inorder_dyn_inst.cc       Sat Sep 20 17:18:36 2014 -0400
@@ -571,12 +571,6 @@
     }
 }
 
-void
-InOrderDynInst::deallocateContext(int thread_num)
-{
-    this->cpu->deallocateContext(thread_num);
-}
-
 Fault
 InOrderDynInst::readMem(Addr addr, uint8_t *data,
                         unsigned size, unsigned flags)
diff -r a9023811bf9e -r a59c189de383 src/cpu/inorder/inorder_dyn_inst.hh
--- a/src/cpu/inorder/inorder_dyn_inst.hh       Sat Sep 20 17:18:35 2014 -0400
+++ b/src/cpu/inorder/inorder_dyn_inst.hh       Sat Sep 20 17:18:36 2014 -0400
@@ -533,13 +533,6 @@
 
     ////////////////////////////////////////////////////////////
     //
-    // MULTITHREADING INTERFACE TO CPU MODELS
-    //
-    ////////////////////////////////////////////////////////////
-    virtual void deallocateContext(int thread_num);
-
-    ////////////////////////////////////////////////////////////
-    //
     //  PROGRAM COUNTERS - PC/NPC/NPC
     //
     ////////////////////////////////////////////////////////////
diff -r a9023811bf9e -r a59c189de383 src/cpu/inorder/thread_context.hh
--- a/src/cpu/inorder/thread_context.hh Sat Sep 20 17:18:35 2014 -0400
+++ b/src/cpu/inorder/thread_context.hh Sat Sep 20 17:18:36 2014 -0400
@@ -281,9 +281,6 @@
     void activateContext()
     { cpu->activateContext(thread->threadId()); }
 
-    void deallocateContext()
-    { cpu->deallocateContext(thread->threadId()); }
-
     /** Returns the number of consecutive store conditional failures. */
     // @todo: Figure out where these store cond failures should go.
     unsigned readStCondFailures()
diff -r a9023811bf9e -r a59c189de383 src/cpu/o3/cpu.cc
--- a/src/cpu/o3/cpu.cc Sat Sep 20 17:18:35 2014 -0400
+++ b/src/cpu/o3/cpu.cc Sat Sep 20 17:18:36 2014 -0400
@@ -730,20 +730,12 @@
 
 template <class Impl>
 void
-FullO3CPU<Impl>::deallocateContext(ThreadID tid, bool remove)
-{
-    deactivateThread(tid);
-    if (remove)
-        removeThread(tid);
-}
-
-template <class Impl>
-void
 FullO3CPU<Impl>::suspendContext(ThreadID tid)
 {
     DPRINTF(O3CPU,"[tid: %i]: Suspending Thread Context.\n", tid);
     assert(!switchedOut());
-    deallocateContext(tid, false);
+
+    deactivateThread(tid);
 
     // If this was the last thread then unschedule the tick event.
     if (activeThreads.size() == 0)
@@ -761,7 +753,9 @@
     //For now, this is the same as deallocate
     DPRINTF(O3CPU,"[tid:%i]: Halt Context called. Deallocating", tid);
     assert(!switchedOut());
-    deallocateContext(tid, true);
+
+    deactivateThread(tid);
+    removeThread(tid);
 }
 
 template <class Impl>
diff -r a9023811bf9e -r a59c189de383 src/cpu/o3/cpu.hh
--- a/src/cpu/o3/cpu.hh Sat Sep 20 17:18:35 2014 -0400
+++ b/src/cpu/o3/cpu.hh Sat Sep 20 17:18:36 2014 -0400
@@ -326,11 +326,6 @@
     void suspendContext(ThreadID tid);
 
     /** Remove Thread from Active Threads List &&
-     *  Possibly Remove Thread Context from CPU.
-     */
-    void deallocateContext(ThreadID tid, bool remove);
-
-    /** Remove Thread from Active Threads List &&
      *  Remove Thread Context from CPU.
      */
     void haltContext(ThreadID tid);
diff -r a9023811bf9e -r a59c189de383 src/cpu/simple/base.cc
--- a/src/cpu/simple/base.cc    Sat Sep 20 17:18:35 2014 -0400
+++ b/src/cpu/simple/base.cc    Sat Sep 20 17:18:36 2014 -0400
@@ -133,14 +133,6 @@
 }
 
 void
-BaseSimpleCPU::deallocateContext(ThreadID thread_num)
-{
-    // for now, these are equivalent
-    suspendContext(thread_num);
-}
-
-
-void
 BaseSimpleCPU::haltContext(ThreadID thread_num)
 {
     // for now, these are equivalent
diff -r a9023811bf9e -r a59c189de383 src/cpu/simple/base.hh
--- a/src/cpu/simple/base.hh    Sat Sep 20 17:18:35 2014 -0400
+++ b/src/cpu/simple/base.hh    Sat Sep 20 17:18:36 2014 -0400
@@ -170,7 +170,6 @@
     void postExecute();
     void advancePC(const Fault &fault);
 
-    virtual void deallocateContext(ThreadID thread_num);
     virtual void haltContext(ThreadID thread_num);
 
     // statistics
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to