linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: mikey@neuling.org, anton@samba.org
Subject: [PATCH 4/5] powerpc, dscr: Added some in-code documentation
Date: Mon,  8 Dec 2014 12:00:11 +0530	[thread overview]
Message-ID: <1418020212-4303-4-git-send-email-khandual@linux.vnet.ibm.com> (raw)
In-Reply-To: <1418020212-4303-1-git-send-email-khandual@linux.vnet.ibm.com>

This patch adds some in-code documentation to the DSCR related
code to make it more readable without having any functional
change to it.

Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/processor.h |  8 ++++++++
 arch/powerpc/kernel/sysfs.c          | 13 +++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h
index dda7ac4..81c1aeb 100644
--- a/arch/powerpc/include/asm/processor.h
+++ b/arch/powerpc/include/asm/processor.h
@@ -295,6 +295,14 @@ struct thread_struct {
 #endif
 #ifdef CONFIG_PPC64
 	unsigned long	dscr;
+	/*
+	 * XXX: dscr_inherit indicates that the process has explicitly
+	 * attempted and changed the DSCR register value for itself.
+	 * Hence kernel wont use the default CPU DSCR value contained
+	 * in the PACA structure anymore during process context switch.
+	 * Once this variable is set, this behaviour will be inherited
+	 * to all the children of this process from that point onwards.
+	 */
 	int		dscr_inherit;
 	unsigned long	ppr;	/* used to save/restore SMT priority */
 #endif
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 67fd2fd..edde3f0 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -496,8 +496,21 @@ static DEVICE_ATTR(spurr, 0400, show_spurr, NULL);
 static DEVICE_ATTR(purr, 0400, show_purr, store_purr);
 static DEVICE_ATTR(pir, 0400, show_pir, NULL);
 
+/*
+ * XXX: This is the system wide DSCR register default value.
+ * Any change to this value through the sysfs interface will
+ * update all per-cpu DSCR default values across the system
+ * stored in their respective PACA structures.
+ */
 static unsigned long dscr_default;
 
+/*
+ * XXX: read_dscr and write_dscr are the functions for the
+ * per-cpu DSCR default sysfs files present for each cpu.
+ * Though updates to per-cpu DSCR value also gets called
+ * for all the CPUs on the system when the system wide
+ * global dscr_default gets changed.
+ */
 static void read_dscr(void *val)
 {
 	*(unsigned long *)val = get_paca()->dscr_default;
-- 
1.9.3

  parent reply	other threads:[~2014-12-08  6:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08  6:30 [PATCH 1/5] powerpc: Fix handling of DSCR related facility unavailable exception Anshuman Khandual
2014-12-08  6:30 ` [PATCH 2/5] powerpc, process: Remove the unused extern dscr_default Anshuman Khandual
2014-12-08  6:30 ` [PATCH 3/5] powerpc, offset: Change PACA_DSCR to PACA_DSCR_DEFAULT Anshuman Khandual
2014-12-08  6:30 ` Anshuman Khandual [this message]
2014-12-09 10:03   ` [4/5] powerpc, dscr: Added some in-code documentation Michael Ellerman
2014-12-09 13:03     ` Anshuman Khandual
2014-12-08  6:30 ` [PATCH 5/5] documentation, powerpc: Add documentation for DSCR support Anshuman Khandual
2014-12-09 10:11 ` [1/5] powerpc: Fix handling of DSCR related facility unavailable exception Michael Ellerman
2014-12-09 13:15   ` Anshuman Khandual
2014-12-18  5:10     ` Anton Blanchard

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=1418020212-4303-4-git-send-email-khandual@linux.vnet.ibm.com \
    --to=khandual@linux.vnet.ibm.com \
    --cc=anton@samba.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mikey@neuling.org \
    /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).