From: Gautham R Shenoy <ego.lkml@gmail.com>
To: Nathan Lynch <nathanl@linux.ibm.com>, ego@linux.vnet.ibm.com
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH 1/3] powerpc/cacheinfo: add cacheinfo_teardown, cacheinfo_rebuild
Date: Fri, 14 Jun 2019 11:25:09 +0530 [thread overview]
Message-ID: <CAHZ_5Wx12GBbBw1caWa8c31XOE3pVSOTHAYdJ37mdheFjn58Kw@mail.gmail.com> (raw)
In-Reply-To: <20190612044506.16392-2-nathanl@linux.ibm.com>
On Wed, Jun 12, 2019 at 10:15 AM Nathan Lynch <nathanl@linux.ibm.com> wrote:
>
> Allow external callers to force the cacheinfo code to release all its
> references to cache nodes, e.g. before processing device tree updates
> post-migration, and to rebuild the hierarchy afterward.
>
> CPU online/offline must be blocked by callers; enforce this.
>
> Fixes: 410bccf97881 ("powerpc/pseries: Partition migration in the kernel")
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
> ---
> arch/powerpc/kernel/cacheinfo.c | 21 +++++++++++++++++++++
> arch/powerpc/kernel/cacheinfo.h | 4 ++++
> 2 files changed, 25 insertions(+)
>
> diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
> index 862e2890bd3d..42c559efe060 100644
> --- a/arch/powerpc/kernel/cacheinfo.c
> +++ b/arch/powerpc/kernel/cacheinfo.c
> @@ -896,4 +896,25 @@ void cacheinfo_cpu_offline(unsigned int cpu_id)
> if (cache)
> cache_cpu_clear(cache, cpu_id);
> }
> +
> +void cacheinfo_teardown(void)
> +{
> + unsigned int cpu;
> +
> + lockdep_assert_cpus_held();
> +
> + for_each_online_cpu(cpu)
> + cacheinfo_cpu_offline(cpu);
> +}
> +
> +void cacheinfo_rebuild(void)
> +{
> + unsigned int cpu;
> +
> + lockdep_assert_cpus_held();
> +
> + for_each_online_cpu(cpu)
> + cacheinfo_cpu_online(cpu);
> +}
> +
> #endif /* (CONFIG_PPC_PSERIES && CONFIG_SUSPEND) || CONFIG_HOTPLUG_CPU */
> diff --git a/arch/powerpc/kernel/cacheinfo.h b/arch/powerpc/kernel/cacheinfo.h
> index 955f5e999f1b..52bd3fc6642d 100644
> --- a/arch/powerpc/kernel/cacheinfo.h
> +++ b/arch/powerpc/kernel/cacheinfo.h
> @@ -6,4 +6,8 @@
> extern void cacheinfo_cpu_online(unsigned int cpu_id);
> extern void cacheinfo_cpu_offline(unsigned int cpu_id);
>
> +/* Allow migration/suspend to tear down and rebuild the hierarchy. */
> +extern void cacheinfo_teardown(void);
> +extern void cacheinfo_rebuild(void);
> +
> #endif /* _PPC_CACHEINFO_H */
> --
> 2.20.1
>
--
Thanks and Regards
gautham.
next prev parent reply other threads:[~2019-06-14 5:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-12 4:45 [PATCH 0/3] live partition migration vs cacheinfo Nathan Lynch
2019-06-12 4:45 ` [PATCH 1/3] powerpc/cacheinfo: add cacheinfo_teardown, cacheinfo_rebuild Nathan Lynch
2019-06-14 5:55 ` Gautham R Shenoy [this message]
2019-06-15 13:36 ` Michael Ellerman
2019-06-12 4:45 ` [PATCH 2/3] powerpc/pseries/mobility: prevent cpu hotplug during DT update Nathan Lynch
2019-06-13 16:52 ` Gautham R Shenoy
2019-06-12 4:45 ` [PATCH 3/3] powerpc/pseries/mobility: rebuild cacheinfo hierarchy post-migration Nathan Lynch
2019-06-14 5:56 ` Gautham R Shenoy
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=CAHZ_5Wx12GBbBw1caWa8c31XOE3pVSOTHAYdJ37mdheFjn58Kw@mail.gmail.com \
--to=ego.lkml@gmail.com \
--cc=ego@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nathanl@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).