Skip to content

Commit 7afccde

Browse files
wangrongweictmarinas
authored andcommitted
arm64: kexec: reduce calls to page_address()
In kexec_page_alloc(), page_address() is called twice. This patch add a new variable to help to reduce calls to page_address(). Signed-off-by: Rongwei Wang <rongwei.wang@linux.alibaba.com> Link: https://lore.kernel.org/r/20211125170600.1608-3-rongwei.wang@linux.alibaba.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent fde046e commit 7afccde

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

arch/arm64/kernel/machine_kexec.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,15 @@ static void *kexec_page_alloc(void *arg)
104104
{
105105
struct kimage *kimage = (struct kimage *)arg;
106106
struct page *page = kimage_alloc_control_pages(kimage, 0);
107+
void *vaddr = NULL;
107108

108109
if (!page)
109110
return NULL;
110111

111-
memset(page_address(page), 0, PAGE_SIZE);
112+
vaddr = page_address(page);
113+
memset(vaddr, 0, PAGE_SIZE);
112114

113-
return page_address(page);
115+
return vaddr;
114116
}
115117

116118
int machine_kexec_post_load(struct kimage *kimage)

0 commit comments

Comments
 (0)