summaryrefslogtreecommitdiff
path: root/sys/src/9/port/alarm.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2022-09-03 17:30:04 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2022-09-03 17:30:04 +0000
commit3e115487969570445a58a5a351a7bf0e0ab5fc21 (patch)
tree98d03736051c50aee5b5b59250f35000532a8fd8 /sys/src/9/port/alarm.c
parent99529b80a3bbe35c5cd5dadf5f106632a2449e84 (diff)
kernel: half NERR, refcount Note's to avoid excessive allocations for 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.
Diffstat (limited to 'sys/src/9/port/alarm.c')
-rw-r--r--sys/src/9/port/alarm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/src/9/port/alarm.c b/sys/src/9/port/alarm.c
index 233e88768..49dec2ccb 100644
--- a/sys/src/9/port/alarm.c
+++ b/sys/src/9/port/alarm.c
@@ -27,7 +27,13 @@ alarmkproc(void*)
if(!canqlock(&rp->debug))
break;
if(rp->alarm != 0){
- postnote(rp, 0, "alarm", NUser);
+ static Note alarm = {
+ "alarm",
+ NUser,
+ 1,
+ };
+ incref(&alarm);
+ pushnote(rp, &alarm);
rp->alarm = 0;
}
qunlock(&rp->debug);