Commit graph

10 commits

Author SHA1 Message Date
cinap_lenrek 28836f3ff5 kernel: avoid useless mmu flushes, implement better wait condition for procflushmmu()
procflushmmu() returns once all *OTHER* processors that had
matching processes running on them flushed ther tlb/mmu state.
the caller of procflush...() takes care of flushing "up" by
calling flushmmu() later.

if the current process matched, then that means m->flushmmu
would be set, and hzclock() would call flushmmu() again.

to avoid this, we now check up->newtlb in addition to m->flushmmu
in hzclock() before calling flushmmu().

we also maintain information on which process on what processor
to wait for locally, which helps making progress when multiple
procflushmmu()'s are running concurrently.

in addition, this makes the wait condition for procflushmmu()
more sophisticated, by validating if the processor still runs
the selected process and only if it matchatches, considers
the MACHP(nm)->flushmmu flag.
2019-12-07 02:13:51 +01:00
cinap_lenrek 6891093034 kernel: remove unused static variable "sofar" from timerintr() (thanks mischief) 2018-12-05 03:59:08 +01:00
cinap_lenrek d15aca0532 kernel: fix tprof on multiprocessor
segclock() has to be called from hzclock(), otherwise
only processes running on cpu0 would catche the interrupt
and the time delta would be wrong.

lock the segment when allocating Seg->profile as
profile ctl might be issued from multiple processes.
Proc->debug qlock is not sufficient.

Seg->profile can never be freed or reallocated once
set as the timer interrupt accesses it without any
locking.
2018-12-05 01:43:19 +01:00
cinap_lenrek 0c1110ace2 kernel: fix twakeup()/timerdel() race condition
timerdel() did not make sure that the timer function
is not active (on another cpu). just acquiering the
Timer lock in the timer function only blocks the caller
of timerdel()/timeradd() but not the other way arround
(on a multiprocessor).

this changes the timer code to track activity of
the timer function, having timerdel() wait until
the timer has finished executing.
2017-03-29 00:30:53 +02:00
cinap_lenrek 41383ad012 kernel: change active.machs from bitmap to char array to support up to 64 cpus on pc64 2016-01-05 05:32:40 +01:00
cinap_lenrek f2f46f4a33 pc64: amd64 kernel reboot support 2014-03-16 20:22:59 +01:00
cinap_lenrek 58f8d7874b alarm: run checkalarms() only on cpu0 (from eriks alarm-once patch) 2013-06-22 09:53:14 +02:00
cinap_lenrek bf3476d661 kernel: fix inproper use of malloc/smalloc 2011-12-12 16:55:26 +01:00
Taru Karttunen a9060cc06b Import sources from 2011-03-30 iso image - lib 2011-03-30 19:35:09 +03:00
Taru Karttunen e5888a1ffd Import sources from 2011-03-30 iso image 2011-03-30 15:46:40 +03:00