PERFORCE change 128269 for review

John Birrell jb at FreeBSD.org
Sun Oct 28 19:34:02 PDT 2007


http://perforce.freebsd.org/chv.cgi?CH=128269

Change 128269 by jb at jb_freebsd1 on 2007/10/29 02:33:18

	Don't assume it's OK to override FreeBSD's global 'lbolt'
	variable with a Solaris-centric one. Change Solaris references
	to upper-case to avoid the clash.

Affected files ...

.. //depot/projects/dtrace/src/sys/compat/opensolaris/sys/time.h#3 edit
.. //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/fs/zfs/arc.c#2 edit
.. //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c#2 edit
.. //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c#2 edit
.. //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/fs/zfs/zil.c#2 edit
.. //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/fs/zfs/zio.c#2 edit

Differences ...

==== //depot/projects/dtrace/src/sys/compat/opensolaris/sys/time.h#3 (text+ko) ====

@@ -39,8 +39,8 @@
 typedef longlong_t	hrtime_t;
 
 #ifdef _KERNEL
-#define	lbolt	((gethrtime() * hz) / NANOSEC)
-#define	lbolt64	(int64_t)(lbolt)
+#define	LBOLT	((gethrtime() * hz) / NANOSEC)
+#define	lbolt64	(int64_t)(LBOLT)
 
 static __inline hrtime_t
 gethrtime(void) {

==== //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/fs/zfs/arc.c#2 (text+ko) ====

@@ -1148,7 +1148,7 @@
 		/* prefetch buffers have a minimum lifespan */
 		if (HDR_IO_IN_PROGRESS(ab) ||
 		    (ab->b_flags & (ARC_PREFETCH|ARC_INDIRECT) &&
-		    lbolt - ab->b_arc_access < arc_min_prefetch_lifespan)) {
+		    LBOLT - ab->b_arc_access < arc_min_prefetch_lifespan)) {
 			skipped++;
 			continue;
 		}
@@ -1525,7 +1525,7 @@
 			}
 
 			/* reset the growth delay for every reclaim */
-			growtime = lbolt + (arc_grow_retry * hz);
+			growtime = LBOLT + (arc_grow_retry * hz);
 			ASSERT(growtime > 0);
 
 			if (zfs_needfree && last_reclaim == ARC_RECLAIM_CONS) {
@@ -1538,7 +1538,7 @@
 				last_reclaim = ARC_RECLAIM_AGGR;
 			}
 			arc_kmem_reap_now(last_reclaim);
-		} else if ((growtime > 0) && ((growtime - lbolt) <= 0)) {
+		} else if ((growtime > 0) && ((growtime - LBOLT) <= 0)) {
 			arc_no_grow = FALSE;
 		}
 
@@ -1757,7 +1757,7 @@
 		 */
 
 		ASSERT(buf->b_arc_access == 0);
-		buf->b_arc_access = lbolt;
+		buf->b_arc_access = LBOLT;
 		DTRACE_PROBE1(new_state__mru, arc_buf_hdr_t *, buf);
 		arc_change_state(arc_mru, buf, hash_lock);
 
@@ -1781,7 +1781,7 @@
 				buf->b_flags &= ~ARC_PREFETCH;
 				ARCSTAT_BUMP(arcstat_mru_hits);
 			}
-			buf->b_arc_access = lbolt;
+			buf->b_arc_access = LBOLT;
 			return;
 		}
 
@@ -1790,13 +1790,13 @@
 		 * but it is still in the cache. Move it to the MFU
 		 * state.
 		 */
-		if (lbolt > buf->b_arc_access + ARC_MINTIME) {
+		if (LBOLT > buf->b_arc_access + ARC_MINTIME) {
 			/*
 			 * More than 125ms have passed since we
 			 * instantiated this buffer.  Move it to the
 			 * most frequently used state.
 			 */
-			buf->b_arc_access = lbolt;
+			buf->b_arc_access = LBOLT;
 			DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, buf);
 			arc_change_state(arc_mfu, buf, hash_lock);
 		}
@@ -1819,7 +1819,7 @@
 			DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, buf);
 		}
 
-		buf->b_arc_access = lbolt;
+		buf->b_arc_access = LBOLT;
 		arc_change_state(new_state, buf, hash_lock);
 
 		ARCSTAT_BUMP(arcstat_mru_ghost_hits);
@@ -1842,7 +1842,7 @@
 			mutex_exit(&arc_mfu->arcs_mtx);
 		}
 		ARCSTAT_BUMP(arcstat_mfu_hits);
-		buf->b_arc_access = lbolt;
+		buf->b_arc_access = LBOLT;
 	} else if (buf->b_state == arc_mfu_ghost) {
 		arc_state_t	*new_state = arc_mfu;
 		/*
@@ -1860,7 +1860,7 @@
 			new_state = arc_mru;
 		}
 
-		buf->b_arc_access = lbolt;
+		buf->b_arc_access = LBOLT;
 		DTRACE_PROBE1(new_state__mfu, arc_buf_hdr_t *, buf);
 		arc_change_state(new_state, buf, hash_lock);
 

==== //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c#2 (text+ko) ====

@@ -128,7 +128,7 @@
 	ASSERT(ve->ve_data != NULL);
 
 	dprintf("evicting %p, off %llx, LRU %llu, age %lu, hits %u, stale %u\n",
-	    vc, ve->ve_offset, ve->ve_lastused, lbolt - ve->ve_lastused,
+	    vc, ve->ve_offset, ve->ve_lastused, LBOLT - ve->ve_lastused,
 	    ve->ve_hits, ve->ve_missed_update);
 
 	avl_remove(&vc->vc_lastused_tree, ve);
@@ -171,7 +171,7 @@
 
 	ve = kmem_zalloc(sizeof (vdev_cache_entry_t), KM_SLEEP);
 	ve->ve_offset = offset;
-	ve->ve_lastused = lbolt;
+	ve->ve_lastused = LBOLT;
 	ve->ve_data = zio_buf_alloc(VCBS);
 
 	avl_add(&vc->vc_offset_tree, ve);
@@ -188,9 +188,9 @@
 	ASSERT(MUTEX_HELD(&vc->vc_lock));
 	ASSERT(ve->ve_fill_io == NULL);
 
-	if (ve->ve_lastused != lbolt) {
+	if (ve->ve_lastused != LBOLT) {
 		avl_remove(&vc->vc_lastused_tree, ve);
-		ve->ve_lastused = lbolt;
+		ve->ve_lastused = LBOLT;
 		avl_add(&vc->vc_lastused_tree, ve);
 	}
 

==== //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c#2 (text+ko) ====

@@ -43,7 +43,7 @@
 int zfs_vdev_max_pending = 35;
 int zfs_vdev_min_pending = 4;
 
-/* deadline = pri + (lbolt >> time_shift) */
+/* deadline = pri + (LBOLT >> time_shift) */
 int zfs_vdev_time_shift = 6;
 
 /* exponential I/O issue ramp-up rate */

==== //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/fs/zfs/zil.c#2 (text+ko) ====

@@ -1553,7 +1553,7 @@
 	txg_wait_synced(zilog->zl_dmu_pool, 0);
 
 	zilog->zl_stop_replay = 0;
-	zilog->zl_replay_time = lbolt;
+	zilog->zl_replay_time = LBOLT;
 	ASSERT(zilog->zl_replay_blks == 0);
 	(void) zil_parse(zilog, zil_incr_blks, zil_replay_log_record, &zr,
 	    zh->zh_claim_txg);

==== //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/fs/zfs/zio.c#2 (text+ko) ====

@@ -1299,7 +1299,7 @@
 	bzero(gbh, gsize);
 
 	/* We need to test multi-level gang blocks */
-	if (maxalloc >= zio_gang_bang && (lbolt & 0x1) == 0)
+	if (maxalloc >= zio_gang_bang && (LBOLT & 0x1) == 0)
 		maxalloc = MAX(maxalloc >> 2, SPA_MINBLOCKSIZE);
 
 	for (loff = 0, i = 0; loff != zio->io_size;
@@ -1375,7 +1375,7 @@
 	ASSERT3U(zio->io_ndvas, <=, spa_max_replication(zio->io_spa));
 
 	/* For testing, make some blocks above a certain size be gang blocks */
-	if (zio->io_size >= zio_gang_bang && (lbolt & 0x3) == 0) {
+	if (zio->io_size >= zio_gang_bang && (LBOLT & 0x3) == 0) {
 		zio_write_allocate_gang_members(zio);
 		return;
 	}


More information about the p4-projects mailing list