svn commit: r186943 - in user/luigi/geom_sched/sys/geom: . sched
Luigi Rizzo
luigi at FreeBSD.org
Fri Jan 9 03:46:24 PST 2009
Author: luigi
Date: Fri Jan 9 11:46:23 2009
New Revision: 186943
URL: http://svn.freebsd.org/changeset/base/186943
Log:
for the time being, avoid patching the kernel and do the marking
in g_io_request
Modified:
user/luigi/geom_sched/sys/geom/geom_io.c
user/luigi/geom_sched/sys/geom/sched/g_sched.c
Modified: user/luigi/geom_sched/sys/geom/geom_io.c
==============================================================================
--- user/luigi/geom_sched/sys/geom/geom_io.c Fri Jan 9 11:45:45 2009 (r186942)
+++ user/luigi/geom_sched/sys/geom/geom_io.c Fri Jan 9 11:46:23 2009 (r186943)
@@ -369,7 +369,7 @@ g_io_request(struct bio *bp, struct g_co
bp->bio_error = 0;
bp->bio_completed = 0;
-#if 0
+#if 1
/*
* Scheduler support: if this is the first element in the geom
* chain (we know from bp->bio_parent == NULL), store
@@ -377,12 +377,25 @@ g_io_request(struct bio *bp, struct g_co
* which should be unused in this particular entry (at least
* with the code in 7.1/8.0).
*/
- if (bp->bio_parent == NULL) {
- if (bp->bio_caller1 != NULL)
- printf("unexpected bio_caller1 %p\n", bp->bio_caller1);
- else
- bp->bio_caller1 = (void *)curthread->td_tid;
+{
+ struct bio *top = bp;
+ static int good = 0, req = 0;
+ static int last = 0;
+
+ while (top->bio_parent)
+ top = top->bio_parent;
+ req++;
+ if (top->bio_caller1 == NULL) {
+ top->bio_caller1 = (void *)curthread->td_tid;
+ if (0) printf("new label %p (thr %p) size %d\n",
+ top->bio_caller1, curthread, (int)top->bio_length);
+ good++;
+ }
+ if (ticks > last) {
+ last = last + hz;
+ printf("at %d total %d good %d\n", ticks, req, good);
}
+}
#endif
KASSERT(!(bp->bio_flags & BIO_ONQUEUE),
Modified: user/luigi/geom_sched/sys/geom/sched/g_sched.c
==============================================================================
--- user/luigi/geom_sched/sys/geom/sched/g_sched.c Fri Jan 9 11:45:45 2009 (r186942)
+++ user/luigi/geom_sched/sys/geom/sched/g_sched.c Fri Jan 9 11:46:23 2009 (r186943)
@@ -452,6 +452,7 @@ static int g_io_patched = 0;
static int
g_io_patch(void *f, void *p, void *new_f)
{
+ return 0;
int found = bcmp(f, (const char *)p + 5, 5);
printf("match result %d\n", found);
if (found == 0) {
More information about the svn-src-user
mailing list