From e7e0311ce48bfb318f507cddb7a8dec8b904bdbd Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 14 Jun 2010 16:08:15 -0700 Subject: [PATCH] Update linux-kernel-mem Additional minor memory related tweak to move certain large allocations to virtual memory and in one case to simply suppress the warning message since it is not that far over the warning limit. --- module/zfs/ddt.c | 5 ++++- module/zfs/spa_history.c | 6 +----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/module/zfs/ddt.c b/module/zfs/ddt.c index 7420173cc9..abf371ce6d 100644 --- a/module/zfs/ddt.c +++ b/module/zfs/ddt.c @@ -499,6 +499,7 @@ ddt_get_dedup_stats(spa_t *spa, ddt_stat_t *dds_total) { ddt_histogram_t *ddh_total; + /* XXX: Move to a slab */ ddh_total = kmem_zalloc(sizeof (ddt_histogram_t), KM_SLEEP); ddt_get_dedup_histogram(spa, ddh_total); ddt_histogram_stat(dds_total, ddh_total); @@ -647,6 +648,7 @@ ddt_alloc(const ddt_key_t *ddk) { ddt_entry_t *dde; + /* XXX: Move to a slab */ dde = kmem_zalloc(sizeof (ddt_entry_t), KM_SLEEP); cv_init(&dde->dde_cv, NULL, CV_DEFAULT, NULL); @@ -795,7 +797,8 @@ ddt_table_alloc(spa_t *spa, enum zio_checksum c) { ddt_t *ddt; - ddt = kmem_zalloc(sizeof (*ddt), KM_SLEEP); + /* XXX: Move to a slab */ + ddt = kmem_zalloc(sizeof (*ddt), KM_SLEEP | KM_NODEBUG); mutex_init(&ddt->ddt_lock, NULL, MUTEX_DEFAULT, NULL); avl_create(&ddt->ddt_tree, ddt_entry_compare, diff --git a/module/zfs/spa_history.c b/module/zfs/spa_history.c index a65f16bccd..b7b5e32271 100644 --- a/module/zfs/spa_history.c +++ b/module/zfs/spa_history.c @@ -437,11 +437,7 @@ log_internal(history_internal_events_t event, spa_t *spa, return; ha = kmem_alloc(sizeof (history_arg_t), KM_SLEEP); - ha->ha_history_str = kmem_alloc(vsnprintf(NULL, 0, fmt, adx) + 1, - KM_SLEEP); - - (void) vsprintf(ha->ha_history_str, fmt, adx); - + ha->ha_history_str = kmem_asprintf(fmt, adx); ha->ha_log_type = LOG_INTERNAL; ha->ha_event = event; ha->ha_zone = NULL;