Skip to content

Commit 7fd6641

Browse files
bsingharorampe
authored andcommitted
powerpc/powernv/memtrace: Let the arch hotunplug code flush cache
Don't do this via custom code, instead now that we have support in the arch hotplug/hotunplug code, rely on those routines to do the right thing. The existing flush doesn't work because it uses ppc64_caches.l1d.size instead of ppc64_caches.l1d.line_size. Fixes: 9d5171a ("powerpc/powernv: Enable removal of memory for in memory tracing") Signed-off-by: Balbir Singh <[email protected]> Reviewed-by: Rashmica Gupta <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent fb5924f commit 7fd6641

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

arch/powerpc/platforms/powernv/memtrace.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,6 @@ static const struct file_operations memtrace_fops = {
8282
.open = simple_open,
8383
};
8484

85-
static void flush_memory_region(u64 base, u64 size)
86-
{
87-
unsigned long line_size = ppc64_caches.l1d.size;
88-
u64 end = base + size;
89-
u64 addr;
90-
91-
base = round_down(base, line_size);
92-
end = round_up(end, line_size);
93-
94-
for (addr = base; addr < end; addr += line_size)
95-
asm volatile("dcbf 0,%0" : "=r" (addr) :: "memory");
96-
}
97-
9885
static int check_memblock_online(struct memory_block *mem, void *arg)
9986
{
10087
if (mem->state != MEM_ONLINE)
@@ -132,10 +119,6 @@ static bool memtrace_offline_pages(u32 nid, u64 start_pfn, u64 nr_pages)
132119
walk_memory_range(start_pfn, end_pfn, (void *)MEM_OFFLINE,
133120
change_memblock_state);
134121

135-
/* RCU grace period? */
136-
flush_memory_region((u64)__va(start_pfn << PAGE_SHIFT),
137-
nr_pages << PAGE_SHIFT);
138-
139122
lock_device_hotplug();
140123
remove_memory(nid, start_pfn << PAGE_SHIFT, nr_pages << PAGE_SHIFT);
141124
unlock_device_hotplug();

0 commit comments

Comments
 (0)