From bcb741691a6b2ffbcb610e68e354ff73cb62453f Mon Sep 17 00:00:00 2001 From: Clark Williams Date: Mon, 5 Feb 2024 14:04:38 -0600 Subject: [PATCH 190/204] arch/riscv: check_unaligned_acces(): don't alloc page for check Drop the alloc_pages() call since the page is passed in as a parameter and the alloced page will not be freed. Reported-by: Sebastian Andrzej Siewior Signed-off-by: Clark Williams --- arch/riscv/kernel/cpufeature.c | 6 ------ 1 file changed, 6 deletions(-) Index: linux-6.6.58-rt45/arch/riscv/kernel/cpufeature.c =================================================================== --- linux-6.6.58-rt45.orig/arch/riscv/kernel/cpufeature.c +++ linux-6.6.58-rt45/arch/riscv/kernel/cpufeature.c @@ -594,12 +594,6 @@ static int check_unaligned_access(void * if (per_cpu(misaligned_access_speed, cpu) != RISCV_HWPROBE_MISALIGNED_UNKNOWN) return; - page = alloc_pages(GFP_NOWAIT, get_order(MISALIGNED_BUFFER_SIZE)); - if (!page) { - pr_warn("Can't alloc pages to measure memcpy performance"); - return; - } - /* Make an unaligned destination buffer. */ dst = (void *)((unsigned long)page_address(page) | 0x1); /* Unalign src as well, but differently (off by 1 + 2 = 3). */