qcacmn: Replace kzalloc/kfree with vmalloc/vfree
At continuous physical address limited telematics platform, in order to avoid occasional memory alloc failure with big kzalloc size, it's better to use virtual memory allocation API instead. And below items will be refined to replace malloc with valloc if CONFIG_ENABLE_VALLOC_REPLACE_MALLOC=y. 1 x 30488 = 30488B @dp_soc_attach:15189 1 x 52096 = 52096B @hal_attach:1104 4096 x 64 = 262144B @dp_rx_desc_pool_alloc:337 Change-Id: I57a6f78f690b5be1838de954933ae36129cea234 CRs-Fixed: 3426935
This commit is contained in:

committed by
Madan Koyyalamudi

parent
a3a4e67eed
commit
ddabd3eda4
@@ -6511,7 +6511,7 @@ static void dp_soc_detach(struct cdp_soc_t *txrx_soc)
|
||||
}
|
||||
|
||||
qdf_mem_free(soc->cdp_soc.ops);
|
||||
qdf_mem_free(soc);
|
||||
qdf_mem_common_free(soc);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -15586,7 +15586,7 @@ dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
|
||||
goto fail0;
|
||||
}
|
||||
arch_id = cdp_get_arch_type_from_devid(device_id);
|
||||
soc = qdf_mem_malloc(dp_get_soc_context_size(device_id));
|
||||
soc = qdf_mem_common_alloc(dp_get_soc_context_size(device_id));
|
||||
if (!soc) {
|
||||
dp_err("DP SOC memory allocation failed");
|
||||
goto fail0;
|
||||
@@ -15713,7 +15713,7 @@ fail3:
|
||||
fail2:
|
||||
qdf_mem_free(soc->cdp_soc.ops);
|
||||
fail1:
|
||||
qdf_mem_free(soc);
|
||||
qdf_mem_common_free(soc);
|
||||
fail0:
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -288,7 +288,7 @@ QDF_STATUS dp_rx_desc_pool_alloc(struct dp_soc *soc,
|
||||
uint32_t pool_size,
|
||||
struct rx_desc_pool *rx_desc_pool)
|
||||
{
|
||||
rx_desc_pool->array = qdf_mem_malloc(pool_size *
|
||||
rx_desc_pool->array = qdf_mem_common_alloc(pool_size *
|
||||
sizeof(union dp_rx_desc_list_elem_t));
|
||||
|
||||
if (!(rx_desc_pool->array)) {
|
||||
@@ -363,7 +363,7 @@ void dp_rx_desc_nbuf_and_pool_free(struct dp_soc *soc, uint32_t pool_id,
|
||||
dp_rx_nbuf_free(nbuf);
|
||||
}
|
||||
}
|
||||
qdf_mem_free(rx_desc_pool->array);
|
||||
qdf_mem_common_free(rx_desc_pool->array);
|
||||
qdf_spin_unlock_bh(&rx_desc_pool->lock);
|
||||
qdf_spinlock_destroy(&rx_desc_pool->lock);
|
||||
}
|
||||
@@ -426,7 +426,7 @@ qdf_export_symbol(dp_rx_desc_frag_free);
|
||||
void dp_rx_desc_pool_free(struct dp_soc *soc,
|
||||
struct rx_desc_pool *rx_desc_pool)
|
||||
{
|
||||
qdf_mem_free(rx_desc_pool->array);
|
||||
qdf_mem_common_free(rx_desc_pool->array);
|
||||
}
|
||||
|
||||
qdf_export_symbol(dp_rx_desc_pool_free);
|
||||
|
@@ -1091,7 +1091,7 @@ void *hal_attach(struct hif_opaque_softc *hif_handle, qdf_device_t qdf_dev)
|
||||
struct hal_soc *hal;
|
||||
int i;
|
||||
|
||||
hal = qdf_mem_malloc(sizeof(*hal));
|
||||
hal = qdf_mem_common_alloc(sizeof(*hal));
|
||||
|
||||
if (!hal) {
|
||||
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
|
||||
@@ -1177,7 +1177,7 @@ fail2:
|
||||
sizeof(*(hal->shadow_rdptr_mem_vaddr)) * HAL_SRNG_ID_MAX,
|
||||
hal->shadow_rdptr_mem_vaddr, hal->shadow_rdptr_mem_paddr, 0);
|
||||
fail1:
|
||||
qdf_mem_free(hal);
|
||||
qdf_mem_common_free(hal);
|
||||
fail0:
|
||||
return NULL;
|
||||
}
|
||||
@@ -1215,7 +1215,7 @@ void hal_detach(void *hal_soc)
|
||||
qdf_mem_free_consistent(hal->qdf_dev, hal->qdf_dev->dev,
|
||||
sizeof(*(hal->shadow_wrptr_mem_vaddr)) * HAL_MAX_LMAC_RINGS,
|
||||
hal->shadow_wrptr_mem_vaddr, hal->shadow_wrptr_mem_paddr, 0);
|
||||
qdf_mem_free(hal);
|
||||
qdf_mem_common_free(hal);
|
||||
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user