From: David Gibson <david@gibson.dropbear.id.au>
To: paulus@samba.org, benh@kernel.crashing.org,
michael@ellerman.id.au, bharata@linux.vnet.ibm.com
Cc: thuth@redhat.com, lvivier@redhat.com,
linuxppc-dev@lists.ozlabs.org,
David Gibson <david@gibson.dropbear.id.au>
Subject: [RFCv2 3/4] pseries: debugfs hook to trigger a hash page table resize
Date: Mon, 11 Jan 2016 16:52:32 +1100 [thread overview]
Message-ID: <1452491553-26153-4-git-send-email-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <1452491553-26153-1-git-send-email-david@gibson.dropbear.id.au>
This patch adds a special file /sys/kernel/debug/powerpc/pft-size
which can be used to view the current size of the hash page table (as
a bit shift) and to trigger a resize of the hash table on PAPR guests.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
arch/powerpc/platforms/pseries/lpar.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index f6e7af5..dba9644 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -29,6 +29,7 @@
#include <linux/jump_label.h>
#include <linux/delay.h>
#include <linux/stop_machine.h>
+#include <linux/debugfs.h>
#include <asm/processor.h>
#include <asm/mmu.h>
#include <asm/page.h>
@@ -903,3 +904,28 @@ int pseries_lpar_resize_hpt(unsigned long shift)
return 0;
}
+
+static int ppc64_pft_size_get(void *data, u64 *val)
+{
+ *val = ppc64_pft_size;
+ return 0;
+}
+
+static int ppc64_pft_size_set(void *data, u64 val)
+{
+ return pseries_lpar_resize_hpt(val);
+}
+
+DEFINE_SIMPLE_ATTRIBUTE(fops_ppc64_pft_size,
+ ppc64_pft_size_get, ppc64_pft_size_set, "%llu\n");
+
+static int __init pseries_lpar_debugfs(void)
+{
+ if (!debugfs_create_file("pft-size", 0600, powerpc_debugfs_root,
+ NULL, &fops_ppc64_pft_size)) {
+ pr_err("lpar: unable to create ppc64_pft_size debugsfs file\n");
+ }
+
+ return 0;
+}
+machine_device_initcall(pseries, pseries_lpar_debugfs);
--
2.5.0
next prev parent reply other threads:[~2016-01-11 5:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-11 5:52 [RFCv2 0/4] Prototype PAPR hash page table resizing (guest side) David Gibson
2016-01-11 5:52 ` [RFCv2 1/4] pseries: Add hypercall wrappers for hash page table resizing David Gibson
2016-01-11 5:52 ` [RFCv2 2/4] pseries: Add support for hash " David Gibson
2016-01-11 5:52 ` David Gibson [this message]
2016-01-11 5:52 ` [RFCv2 4/4] pseries: Advertise HPT resizing support via CAS David Gibson
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=1452491553-26153-4-git-send-email-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=benh@kernel.crashing.org \
--cc=bharata@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lvivier@redhat.com \
--cc=michael@ellerman.id.au \
--cc=paulus@samba.org \
--cc=thuth@redhat.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).