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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent fde046e commit 7afccde

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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)