Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Nov 2016 20:44:52 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r308781 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201611172044.uAHKiqWs004484@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Nov 17 20:44:51 2016
New Revision: 308781
URL: https://svnweb.freebsd.org/changeset/base/308781

Log:
  Revert r307392:  I've found a way to avoid big allocations completely.

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Thu Nov 17 20:42:56 2016	(r308780)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c	Thu Nov 17 20:44:51 2016	(r308781)
@@ -1142,11 +1142,6 @@ zil_itx_create(uint64_t txtype, size_t l
 
 	lrsize = P2ROUNDUP_TYPED(lrsize, sizeof (uint64_t), size_t);
 
-#ifdef __FreeBSD__
-	if (offsetof(itx_t, itx_lr) + lrsize > PAGE_SIZE)
-		itx = zio_buf_alloc(offsetof(itx_t, itx_lr) + lrsize);
-	else
-#endif
 	itx = kmem_alloc(offsetof(itx_t, itx_lr) + lrsize, KM_SLEEP);
 	itx->itx_lr.lrc_txtype = txtype;
 	itx->itx_lr.lrc_reclen = lrsize;
@@ -1160,11 +1155,6 @@ zil_itx_create(uint64_t txtype, size_t l
 void
 zil_itx_destroy(itx_t *itx)
 {
-#ifdef __FreeBSD__
-	if (offsetof(itx_t, itx_lr) + itx->itx_lr.lrc_reclen > PAGE_SIZE)
-		zio_buf_free(itx, offsetof(itx_t, itx_lr) + itx->itx_lr.lrc_reclen);
-	else
-#endif
 	kmem_free(itx, offsetof(itx_t, itx_lr) + itx->itx_lr.lrc_reclen);
 }
 
@@ -1184,7 +1174,8 @@ zil_itxg_clean(itxs_t *itxs)
 	list = &itxs->i_sync_list;
 	while ((itx = list_head(list)) != NULL) {
 		list_remove(list, itx);
-		zil_itx_destroy(itx);
+		kmem_free(itx, offsetof(itx_t, itx_lr) +
+		    itx->itx_lr.lrc_reclen);
 	}
 
 	cookie = NULL;
@@ -1193,7 +1184,8 @@ zil_itxg_clean(itxs_t *itxs)
 		list = &ian->ia_list;
 		while ((itx = list_head(list)) != NULL) {
 			list_remove(list, itx);
-			zil_itx_destroy(itx);
+			kmem_free(itx, offsetof(itx_t, itx_lr) +
+			    itx->itx_lr.lrc_reclen);
 		}
 		list_destroy(list);
 		kmem_free(ian, sizeof (itx_async_node_t));
@@ -1258,7 +1250,8 @@ zil_remove_async(zilog_t *zilog, uint64_
 	}
 	while ((itx = list_head(&clean_list)) != NULL) {
 		list_remove(&clean_list, itx);
-		zil_itx_destroy(itx);
+		kmem_free(itx, offsetof(itx_t, itx_lr) +
+		    itx->itx_lr.lrc_reclen);
 	}
 	list_destroy(&clean_list);
 }
@@ -1508,7 +1501,8 @@ zil_commit_writer(zilog_t *zilog)
 		if (txg > spa_last_synced_txg(spa) || txg > spa_freeze_txg(spa))
 			lwb = zil_lwb_commit(zilog, itx, lwb);
 		list_remove(&zilog->zl_itx_commit_list, itx);
-		zil_itx_destroy(itx);
+		kmem_free(itx, offsetof(itx_t, itx_lr)
+		    + itx->itx_lr.lrc_reclen);
 	}
 	DTRACE_PROBE1(zil__cw2, zilog_t *, zilog);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611172044.uAHKiqWs004484>