> On July 4, 2015, 6:32 p.m., Steve Reinhardt wrote: > > So is the assumption here that, if you're switching memory modes, you will > > always call switchCpus with do_drain=True? Other than that I don't see > > where the redundant drain is coming from. > > > > Also, if the system is already drained, how long does a redundant drain > > take? That is, how much are we really saving here? > > Steve Reinhardt wrote: > OK, looking at patch 2874 I see that this code will be changing anyway. > So I think this patch makes sense in the context of the future > implementation. I'm still not sure it makes sense in the context of the > current implementation, but that's moot. I'd feel slightly better if you > reordered the patches to make this one come after 2874 though...
The assumption is, and has always been, that a system is drained when the CPU switch takes place. All CPU models, including the atomic CPU require this. The reason we have do_drain as a keyword parameter is because there were cases (particularly in test cases where we test CPU switching and checkpoints) when we wanted to explicitly call drain and perform multiple operations that required a drained simulator in one go. In practice, the cost of an additional drain is probably not huge, but it's not needed since the system should be drained already so I'd argue that it should go. - Andreas ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviews.gem5.org/r/2871/#review6700 ----------------------------------------------------------- On June 8, 2015, 12:32 p.m., Andreas Sandberg wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviews.gem5.org/r/2871/ > ----------------------------------------------------------- > > (Updated June 8, 2015, 12:32 p.m.) > > > Review request for Default. > > > Repository: gem5 > > > Description > ------- > > Changeset 10869:996b20e55386 > --------------------------- > python: Remove redundant drain when changing memory modes > > When the Python helper code switches CPU models, it sometimes also > needs to change the memory mode of the simulator. When this happens, > it accidentally tried to drain the simulator despite having done so > already. This changeset removes the redundant drain. > > > Diffs > ----- > > src/python/m5/simulate.py 282c2a89ace8 > > Diff: http://reviews.gem5.org/r/2871/diff/ > > > Testing > ------- > > Long regressions (including switcheroos pass) > > > Thanks, > > Andreas Sandberg > > _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
