Revert "Pre-allocate vdev I/O buffers"

Commit 86dd0fd added preallocated I/O buffers.  This is no longer
required after the recent kmem changes designed to make our memory
allocation interfaces behave more like those found on Illumos.  A
deadlock in this situation is no longer possible.

However, these allocations still have the potential to be expensive.
So a potential future optimization might be to perform then KM_NOSLEEP
so that they either succeed of fail quicky.  Either case is acceptable
here because we can safely abort the aggregation.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Brian Behlendorf
2014-12-12 16:40:21 -08:00
parent 60e1eda929
commit 285b29d959
4 changed files with 2 additions and 72 deletions
-22
View File
@@ -55,7 +55,6 @@ const char *zio_type_name[ZIO_TYPES] = {
*/
kmem_cache_t *zio_cache;
kmem_cache_t *zio_link_cache;
kmem_cache_t *zio_vdev_cache;
kmem_cache_t *zio_buf_cache[SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT];
kmem_cache_t *zio_data_buf_cache[SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT];
int zio_bulk_flags = 0;
@@ -132,8 +131,6 @@ zio_init(void)
zio_cons, zio_dest, NULL, NULL, NULL, 0);
zio_link_cache = kmem_cache_create("zio_link_cache",
sizeof (zio_link_t), 0, NULL, NULL, NULL, NULL, NULL, 0);
zio_vdev_cache = kmem_cache_create("zio_vdev_cache", sizeof (vdev_io_t),
PAGESIZE, NULL, NULL, NULL, NULL, NULL, 0);
/*
* For small buffers, we want a cache for each multiple of
@@ -218,7 +215,6 @@ zio_fini(void)
zio_data_buf_cache[c] = NULL;
}
kmem_cache_destroy(zio_vdev_cache);
kmem_cache_destroy(zio_link_cache);
kmem_cache_destroy(zio_cache);
@@ -285,24 +281,6 @@ zio_data_buf_free(void *buf, size_t size)
kmem_cache_free(zio_data_buf_cache[c], buf);
}
/*
* Dedicated I/O buffers to ensure that memory fragmentation never prevents
* or significantly delays the issuing of a zio. These buffers are used
* to aggregate I/O and could be used for raidz stripes.
*/
void *
zio_vdev_alloc(void)
{
return (kmem_cache_alloc(zio_vdev_cache, KM_PUSHPAGE));
}
void
zio_vdev_free(void *buf)
{
kmem_cache_free(zio_vdev_cache, buf);
}
/*
* ==========================================================================
* Push and pop I/O transform buffers