mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
media: atomisp: remove hmm_mem_stats
Without pool support the (optional) debug logging done by these is not really meaningful, drop it all. Link: https://lore.kernel.org/linux-media/20220615205037.16549-13-hdegoede@redhat.com Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
c35f36b7c1
commit
454da4d2a4
@@ -87,14 +87,6 @@ ia_css_ptr hmm_host_vaddr_to_hrt_vaddr(const void *ptr);
|
||||
*/
|
||||
int hmm_mmap(struct vm_area_struct *vma, ia_css_ptr virt);
|
||||
|
||||
/* show memory statistic
|
||||
*/
|
||||
void hmm_show_mem_stat(const char *func, const int line);
|
||||
|
||||
/* init memory statistic
|
||||
*/
|
||||
void hmm_init_mem_stat(int res_pgnr, int dyc_en, int dyc_pgnr);
|
||||
|
||||
extern bool dypool_enable;
|
||||
extern unsigned int dypool_pgnr;
|
||||
extern struct hmm_bo_device bo_device;
|
||||
|
||||
@@ -68,30 +68,4 @@
|
||||
#define check_null_return_void(ptr, fmt, arg ...) \
|
||||
var_equal_return_void(ptr, NULL, fmt, ## arg)
|
||||
|
||||
/* hmm_mem_stat is used to trace the hmm mem used by ISP pipe. The unit is page
|
||||
* number.
|
||||
*
|
||||
* res_size: reserved mem pool size, being allocated from system at system boot time.
|
||||
* res_size >= res_cnt.
|
||||
* sys_size: system mem pool size, being allocated from system at camera running time.
|
||||
* dyc_size: dynamic mem pool size.
|
||||
* dyc_thr: dynamic mem pool high watermark.
|
||||
* dyc_size <= dyc_thr.
|
||||
* usr_size: user ptr mem size.
|
||||
*
|
||||
* res_cnt: track the mem allocated from reserved pool at camera running time.
|
||||
* tol_cnt: track the total mem used by ISP pipe at camera running time.
|
||||
*/
|
||||
struct _hmm_mem_stat {
|
||||
int res_size;
|
||||
int sys_size;
|
||||
int dyc_size;
|
||||
int dyc_thr;
|
||||
int usr_size;
|
||||
int res_cnt;
|
||||
int tol_cnt;
|
||||
};
|
||||
|
||||
extern struct _hmm_mem_stat hmm_mem_stat;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -45,10 +45,8 @@ struct _iunit_debug {
|
||||
|
||||
#define OPTION_BIN_LIST BIT(0)
|
||||
#define OPTION_BIN_RUN BIT(1)
|
||||
#define OPTION_MEM_STAT BIT(2)
|
||||
#define OPTION_VALID (OPTION_BIN_LIST \
|
||||
| OPTION_BIN_RUN \
|
||||
| OPTION_MEM_STAT)
|
||||
| OPTION_BIN_RUN)
|
||||
|
||||
static struct _iunit_debug iunit_debug = {
|
||||
.dbglvl = 0,
|
||||
@@ -81,9 +79,6 @@ static inline int iunit_dump_dbgopt(struct atomisp_device *isp,
|
||||
goto opt_err;
|
||||
}
|
||||
}
|
||||
|
||||
if (opt & OPTION_MEM_STAT)
|
||||
hmm_show_mem_stat(__func__, __LINE__);
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
dev_err(isp->dev, "%s dump nothing[ret=%d]\n", __func__, ret);
|
||||
|
||||
@@ -1770,7 +1770,6 @@ static int atomisp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
|
||||
pm_runtime_put_noidle(&pdev->dev);
|
||||
pm_runtime_allow(&pdev->dev);
|
||||
|
||||
hmm_init_mem_stat(repool_pgnr, dypool_enable, dypool_pgnr);
|
||||
/* Init ISP memory management */
|
||||
hmm_init();
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
struct hmm_bo_device bo_device;
|
||||
static ia_css_ptr dummy_ptr = mmgr_EXCEPTION;
|
||||
static bool hmm_initialized;
|
||||
struct _hmm_mem_stat hmm_mem_stat;
|
||||
|
||||
/*
|
||||
* p: private
|
||||
@@ -209,8 +208,6 @@ ia_css_ptr hmm_alloc(size_t bytes, enum hmm_bo_type type,
|
||||
goto bind_err;
|
||||
}
|
||||
|
||||
hmm_mem_stat.tol_cnt += pgnr;
|
||||
|
||||
if (attrs & ATOMISP_MAP_FLAG_CLEARED)
|
||||
hmm_set(bo->start, 0, bytes);
|
||||
|
||||
@@ -246,8 +243,6 @@ void hmm_free(ia_css_ptr virt)
|
||||
return;
|
||||
}
|
||||
|
||||
hmm_mem_stat.tol_cnt -= bo->pgnr;
|
||||
|
||||
hmm_bo_unbind(bo);
|
||||
hmm_bo_free_pages(bo);
|
||||
hmm_bo_unref(bo);
|
||||
@@ -637,34 +632,3 @@ ia_css_ptr hmm_host_vaddr_to_hrt_vaddr(const void *ptr)
|
||||
ptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void hmm_show_mem_stat(const char *func, const int line)
|
||||
{
|
||||
pr_info("tol_cnt=%d usr_size=%d res_size=%d res_cnt=%d sys_size=%d dyc_thr=%d dyc_size=%d.\n",
|
||||
hmm_mem_stat.tol_cnt,
|
||||
hmm_mem_stat.usr_size, hmm_mem_stat.res_size,
|
||||
hmm_mem_stat.res_cnt, hmm_mem_stat.sys_size,
|
||||
hmm_mem_stat.dyc_thr, hmm_mem_stat.dyc_size);
|
||||
}
|
||||
|
||||
void hmm_init_mem_stat(int res_pgnr, int dyc_en, int dyc_pgnr)
|
||||
{
|
||||
hmm_mem_stat.res_size = res_pgnr;
|
||||
/* If reserved mem pool is not enabled, set its "mem stat" values as -1. */
|
||||
if (hmm_mem_stat.res_size == 0) {
|
||||
hmm_mem_stat.res_size = -1;
|
||||
hmm_mem_stat.res_cnt = -1;
|
||||
}
|
||||
|
||||
/* If dynamic memory pool is not enabled, set its "mem stat" values as -1. */
|
||||
if (!dyc_en) {
|
||||
hmm_mem_stat.dyc_size = -1;
|
||||
hmm_mem_stat.dyc_thr = -1;
|
||||
} else {
|
||||
hmm_mem_stat.dyc_size = 0;
|
||||
hmm_mem_stat.dyc_thr = dyc_pgnr;
|
||||
}
|
||||
hmm_mem_stat.usr_size = 0;
|
||||
hmm_mem_stat.sys_size = 0;
|
||||
hmm_mem_stat.tol_cnt = 0;
|
||||
}
|
||||
|
||||
@@ -651,7 +651,6 @@ static void free_private_bo_pages(struct hmm_buffer_object *bo,
|
||||
*/
|
||||
if (!ret) {
|
||||
__free_pages(bo->page_obj[i].page, 0);
|
||||
hmm_mem_stat.sys_size--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -762,7 +761,6 @@ retry:
|
||||
}
|
||||
|
||||
pgnr -= blk_pgnr;
|
||||
hmm_mem_stat.sys_size += blk_pgnr;
|
||||
|
||||
/*
|
||||
* if order is not reduced this time, clear
|
||||
@@ -796,8 +794,6 @@ static void free_user_pages(struct hmm_buffer_object *bo,
|
||||
{
|
||||
int i;
|
||||
|
||||
hmm_mem_stat.usr_size -= bo->pgnr;
|
||||
|
||||
if (bo->mem_type == HMM_BO_MEM_TYPE_PFN) {
|
||||
unpin_user_pages(bo->pages, page_nr);
|
||||
} else {
|
||||
@@ -870,8 +866,6 @@ static int alloc_user_pages(struct hmm_buffer_object *bo,
|
||||
bo->pgnr,
|
||||
bo->mem_type == HMM_BO_MEM_TYPE_USER ? "user" : "pfn", page_nr);
|
||||
|
||||
hmm_mem_stat.usr_size += bo->pgnr;
|
||||
|
||||
/* can be written by caller, not forced */
|
||||
if (page_nr != bo->pgnr) {
|
||||
dev_err(atomisp_dev,
|
||||
|
||||
Reference in New Issue
Block a user