From: Balbir Singh <bsingharora@gmail•com>
To: linuxppc-dev@lists•ozlabs.org
Cc: mpe@ellerman•id.au, rashmica.g@gmail•com,
benh@kernel•crashing.org, Balbir Singh <bsingharora@gmail•com>
Subject: [PATCH 2/2] powerpc/mm/memtrace: Let the arch hotunplug code flush cache
Date: Fri, 6 Apr 2018 15:24:24 +1000 [thread overview]
Message-ID: <20180406052424.29841-2-bsingharora@gmail.com> (raw)
In-Reply-To: <20180406052424.29841-1-bsingharora@gmail.com>
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.
Fixes: 9d5171a8f248 ("powerpc/powernv: Enable removal of memory for in memory tracing")
because the older code uses ppc64_caches.l1d.size instead of
ppc64_caches.l1d.line_size
Signed-off-by: Balbir Singh <bsingharora@gmail•com>
---
arch/powerpc/platforms/powernv/memtrace.c | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platforms/powernv/memtrace.c
index de470caf0784..fc222a0c2ac4 100644
--- a/arch/powerpc/platforms/powernv/memtrace.c
+++ b/arch/powerpc/platforms/powernv/memtrace.c
@@ -82,19 +82,6 @@ static const struct file_operations memtrace_fops = {
.open = simple_open,
};
-static void flush_memory_region(u64 base, u64 size)
-{
- unsigned long line_size = ppc64_caches.l1d.size;
- u64 end = base + size;
- u64 addr;
-
- base = round_down(base, line_size);
- end = round_up(end, line_size);
-
- for (addr = base; addr < end; addr += line_size)
- asm volatile("dcbf 0,%0" : "=r" (addr) :: "memory");
-}
-
static int check_memblock_online(struct memory_block *mem, void *arg)
{
if (mem->state != MEM_ONLINE)
@@ -132,10 +119,6 @@ static bool memtrace_offline_pages(u32 nid, u64 start_pfn, u64 nr_pages)
walk_memory_range(start_pfn, end_pfn, (void *)MEM_OFFLINE,
change_memblock_state);
- /* RCU grace period? */
- flush_memory_region((u64)__va(start_pfn << PAGE_SHIFT),
- nr_pages << PAGE_SHIFT);
-
lock_device_hotplug();
remove_memory(nid, start_pfn << PAGE_SHIFT, nr_pages << PAGE_SHIFT);
unlock_device_hotplug();
--
2.13.6
next prev parent reply other threads:[~2018-04-06 5:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-06 5:24 [PATCH 1/2] powerpc/mm: Flush cache on memory hot(un)plug Balbir Singh
2018-04-06 5:24 ` Balbir Singh [this message]
2018-04-11 4:01 ` [PATCH 2/2] powerpc/mm/memtrace: Let the arch hotunplug code flush cache rashmica
2018-04-11 11:05 ` Michael Ellerman
2018-04-11 11:25 ` Balbir Singh
2018-04-09 21:14 ` [PATCH 1/2] powerpc/mm: Flush cache on memory hot(un)plug Reza Arbab
2018-04-11 4:00 ` rashmica
2018-04-24 3:48 ` [1/2] " Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180406052424.29841-2-bsingharora@gmail.com \
--to=bsingharora@gmail$(echo .)com \
--cc=benh@kernel$(echo .)crashing.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=mpe@ellerman$(echo .)id.au \
--cc=rashmica.g@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox