Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 10 years ago

Closed 10 years ago

#149 closed enhancement (fixed)

Flush windows in context_save_arch() instead of context_restore_arch()

Reported by: Jakub Jermář Owned by: Jakub Jermář
Priority: major Milestone: 0.4.2
Component: helenos/kernel/sparc64 Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

Gedare Bloom suggests:

Issue the flushw instruction in context_save_arch instead of context_restore_arch, overwriting the window at cwp with the restored thread state, and "pretending" a flushw occurred by setting CANRESTORE to 0 and CANSAVE to NWINDOWS - 2

The reason I think this would be an improvement is that (1) it makes more sense to me to flush the windows while saving state, and (2) yousave a register spill and register fill of scheduler()'s window.

Change History (3)

comment:1 Changed 10 years ago by Jakub Jermář

I already tried this optimization and it appears to be a correct one. The only question is whether it will have the performance benefit it promises.

Moreover, if the windows are not flushed in context_save_arch(), there may be a problem with thread migration: thread is restored on processor 2 while its windows are still on processor 1. This is fortunately not possible in the current code due to an unrelated context_restore() at the end of scheduler() which flushes the windows.

comment:2 Changed 10 years ago by Jakub Jermář

Summary: Flush windows in context_save_arch() instead of context_reostre_arch()Flush windows in context_save_arch() instead of context_restore_arch()

comment:3 Changed 10 years ago by Jakub Jermář

Resolution: fixed
Status: newclosed

Fixed in revision 181.

Note: See TracTickets for help on using tickets.