Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/librump/rumpkern track cpu_onproc
details: https://anonhg.NetBSD.org/src/rev/006cb3c39c94
branches: trunk
changeset: 337643:006cb3c39c94
user: pooka <pooka%NetBSD.org@localhost>
date: Wed Apr 22 16:01:07 2015 +0000
description:
track cpu_onproc
diffstat:
sys/rump/librump/rumpkern/scheduler.c | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
diffs (57 lines):
diff -r 0acca3d83eac -r 006cb3c39c94 sys/rump/librump/rumpkern/scheduler.c
--- a/sys/rump/librump/rumpkern/scheduler.c Wed Apr 22 15:04:57 2015 +0000
+++ b/sys/rump/librump/rumpkern/scheduler.c Wed Apr 22 16:01:07 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: scheduler.c,v 1.39 2014/06/07 11:08:09 rmind Exp $ */
+/* $NetBSD: scheduler.c,v 1.40 2015/04/22 16:01:07 pooka Exp $ */
/*
* Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.39 2014/06/07 11:08:09 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.40 2015/04/22 16:01:07 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -280,6 +280,7 @@
rump_schedule_cpu_interlock(struct lwp *l, void *interlock)
{
struct rumpcpu *rcpu;
+ struct cpu_info *ci;
void *old;
bool domigrate;
bool bound = l->l_pflag & LP_BOUND;
@@ -354,12 +355,19 @@
rumpuser_mutex_exit(rcpu->rcpu_mtx);
fastlane:
- l->l_cpu = l->l_target_cpu = rcpu->rcpu_ci;
+ ci = rcpu->rcpu_ci;
+ l->l_cpu = l->l_target_cpu = ci;
l->l_mutex = rcpu->rcpu_ci->ci_schedstate.spc_mutex;
l->l_ncsw++;
l->l_stat = LSONPROC;
- rcpu->rcpu_ci->ci_curlwp = l;
+ /*
+ * No interrupts, so ci_curlwp === cpu_onproc.
+ * Okay, we could make an attempt to not set cpu_onproc
+ * in the case that an interrupt is scheduled immediately
+ * after a user proc, but leave that for later.
+ */
+ ci->ci_curlwp = ci->ci_data.cpu_onproc = l;
}
void
@@ -431,7 +439,7 @@
void *old;
ci = l->l_cpu;
- ci->ci_curlwp = NULL;
+ ci->ci_curlwp = ci->ci_data.cpu_onproc = NULL;
rcpu = &rcpu_storage[ci-&rump_cpus[0]];
KASSERT(rcpu->rcpu_ci == ci);
Home |
Main Index |
Thread Index |
Old Index