Catch stream heisenbug, initialize scheduler IRQs before smp_init (), reduce stream max size
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m29s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m29s
This commit is contained in:
@@ -78,6 +78,9 @@ void bootmain (void) {
|
||||
struct device* temp0 = device_find ("temp0");
|
||||
vfs_create_volume (thiscpu->kproc, &rctx, "temp", FS_FAT16, temp0, true);
|
||||
|
||||
irq_attach (&proc_irq_sched, NULL, SCHED_PREEMPT_TIMER);
|
||||
irq_attach (&proc_irq_sched, NULL, CPU_REQUEST_SCHED);
|
||||
|
||||
smp_init ();
|
||||
|
||||
proc_init ();
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#include <sys/smp.h>
|
||||
|
||||
void do_sched (struct proc* proc, spin_lock_t* cpu_lock, uint64_t lockflags) {
|
||||
__asm__ volatile ("cli");
|
||||
|
||||
uint64_t fp;
|
||||
|
||||
spin_lock (&proc->lock, &fp);
|
||||
@@ -32,5 +30,7 @@ void do_sched (struct proc* proc, spin_lock_t* cpu_lock, uint64_t lockflags) {
|
||||
spin_unlock (&proc->lock, fp);
|
||||
spin_unlock (cpu_lock, lockflags);
|
||||
|
||||
__asm__ volatile ("cli");
|
||||
|
||||
do_sched1 ((void*)®s, cr3);
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ void proc_wait_for (struct proc* proc, struct reschedule_ctx* rctx, struct proc*
|
||||
proc_sq_suspend (proc, &wait_proc->done_sq, NULL, 0, rctx);
|
||||
}
|
||||
|
||||
static void proc_irq_sched (void* arg, void* regs, bool user, struct reschedule_ctx* rctx) {
|
||||
void proc_irq_sched (void* arg, void* regs, bool user, struct reschedule_ctx* rctx) {
|
||||
(void)arg, (void)regs, (void)rctx, (void)user;
|
||||
|
||||
rctx_insert_cpu (rctx, thiscpu);
|
||||
@@ -338,11 +338,6 @@ static void proc_irq_sched (void* arg, void* regs, bool user, struct reschedule_
|
||||
void proc_init (void) {
|
||||
uint64_t fc;
|
||||
|
||||
#if defined(__x86_64__)
|
||||
irq_attach (&proc_irq_sched, NULL, SCHED_PREEMPT_TIMER);
|
||||
irq_attach (&proc_irq_sched, NULL, CPU_REQUEST_SCHED);
|
||||
#endif
|
||||
|
||||
struct reschedule_ctx rctx;
|
||||
memset (&rctx, 0, sizeof (rctx));
|
||||
|
||||
|
||||
@@ -75,6 +75,8 @@ void proc_pid_alloc_init (void);
|
||||
|
||||
void proc_wait_for (struct proc* proc, struct reschedule_ctx* rctx, struct proc* wait_proc);
|
||||
|
||||
void proc_irq_sched (void* arg, void* regs, bool user, struct reschedule_ctx* rctx);
|
||||
|
||||
void proc_init (void);
|
||||
|
||||
struct proc* kproc_create (void);
|
||||
|
||||
@@ -120,7 +120,7 @@ struct proc_resource* proc_create_resource_stream (struct procgroup* procgroup)
|
||||
|
||||
resource->lock = SPIN_LOCK_INIT;
|
||||
resource->ops.cleanup = &proc_cleanup_resource_stream;
|
||||
resource->u.mail.resource = resource;
|
||||
resource->u.stream.resource = resource;
|
||||
resource->type = PR_STREAM;
|
||||
|
||||
if (!ringbuffer_init (&resource->u.stream.ringbuffer, PROC_STREAM_MAX, 1)) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <libk/std.h>
|
||||
#include <proc/suspension_q.h>
|
||||
|
||||
#define PROC_STREAM_MAX (1024 * 1024)
|
||||
#define PROC_STREAM_MAX (64 * 1024)
|
||||
|
||||
struct proc;
|
||||
struct proc_resource;
|
||||
|
||||
Reference in New Issue
Block a user