summaryrefslogtreecommitdiff
path: root/sys/src/9/port/alarm.c
AgeCommit message (Collapse)Author
2022-09-259/port: revert timer wheel change, breaks pi4 boot, needs more time ↵cinap_lenrek
investigating
2022-09-249/port: reimplement timers to use timer wheelOri Bernstein
when many processes go to sleep, our old timer would slow to a crawl; this new implementation does not.
2022-09-03kernel: half NERR, refcount Note's to avoid excessive allocations for ↵cinap_lenrek
postnotepg() Half NERR stack to 32. When posing a note to a large group, avoid allocating Notes for each individual process, but post the reference instread. factor out process interruption into procinterrupt(). Avoid allocation of notes in alarmkproc, just posting the same note to everyone.
2016-09-08kernel: make sure procalarm() remaining time doesnt become negativecinap_lenrek
2014-01-03kernel: simplify procalarm()cinap_lenrek
2014-01-03alarm: skip timed out alarms when inserting in procalarm() (thanks erik)cinap_lenrek
from erik quanstros 9fans post: i think the list insertion code needs a single-read test that f->alarm != 0. to prevent the 0 from acting like a fencepost. e.g. trying to insert -10 into list -40 -30 0 -20. if(alarms.head) { l = &alarms.head; for(f = *l; f; f = f->palarm) { >> fw = f->alarm; >> if(fw != 0 && (long)(fw - when) >= 0) { up->palarm = f; *l = up; goto done; } l = &f->palarm; } *l = up; }
2014-01-01kernel: fix alarm postnote racecinap_lenrek
when alarmkproc is commited to send the alarm note to the process, the process might have exited already, or worse, being reused for another process. pexit() zeros p->alarm at the beginning, but the kalarmproc() might read p->alarm before pexit() zeroed it, decide to send the note, then get preempted and pexit() releases the proc. once kalarmproc() is resumed, the proc might be already something different and we send the note to the wrong thing. we now check p->alarm under the debug qlock. that way, pexit() cannot make progress while we test the condition. remove the error label arround postnote(). postnote does not raise error.
2013-11-22kernel: kproc error and exitcinap_lenrek
catch the error() that can be thrown by sleep() and tsleep() in kprocs. add missing pexit() calls. always set the freemem argument to pexit() from kproc otherwise the process gets added to the broken list.
2013-06-22alarm: run checkalarms() only on cpu0 (from eriks alarm-once patch)cinap_lenrek
2013-05-21kernel: prevent alarm(2) from returning instantly when the tick timer wraps. ↵cinap_lenrek
(from erik quanstros alarmwrap patch)
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso imageTaru Karttunen