LinuxPPC-Dev Archive on lore.kernel.org
 help / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nathan Lynch <nathanl@linux.ibm.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	Mingming Cao <mingming.cao@ibm.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: [PATCH v2 2/9] powerpc/pseries: Do not save the previous DTL mask value
Date: Fri, 14 Jun 2019 21:14:00 +0530
Message-ID: <bffc6b74c78c3e3bb54cc7fc79816d5f39775db4.1560526066.git.naveen.n.rao@linux.vnet.ibm.com> (raw)
In-Reply-To: <cover.1560526066.git.naveen.n.rao@linux.vnet.ibm.com>

When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is enabled, we always initialize
DTL enable mask to DTL_LOG_PREEMPT (0x2). There are no other places
where the mask is changed. As such, when reading the DTL log buffer
through debugfs, there is no need to save and restore the previous mask
value.

We don't need to save and restore the earlier mask value if
CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not enabled. So, remove the field
from the structure as well.

Acked-by: Nathan Lynch <nathanl@linux.ibm.com>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/pseries/dtl.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/dtl.c b/arch/powerpc/platforms/pseries/dtl.c
index 337378f3d1fd..a88176afba32 100644
--- a/arch/powerpc/platforms/pseries/dtl.c
+++ b/arch/powerpc/platforms/pseries/dtl.c
@@ -42,7 +42,6 @@ struct dtl_ring {
 	struct dtl_entry *write_ptr;
 	struct dtl_entry *buf;
 	struct dtl_entry *buf_end;
-	u8	saved_dtl_mask;
 };
 
 static DEFINE_PER_CPU(struct dtl_ring, dtl_rings);
@@ -92,7 +91,6 @@ static int dtl_start(struct dtl *dtl)
 	dtlr->write_ptr = dtl->buf;
 
 	/* enable event logging */
-	dtlr->saved_dtl_mask = lppaca_of(dtl->cpu).dtl_enable_mask;
 	lppaca_of(dtl->cpu).dtl_enable_mask |= dtl_event_mask;
 
 	dtl_consumer = consume_dtle;
@@ -110,7 +108,7 @@ static void dtl_stop(struct dtl *dtl)
 	dtlr->buf = NULL;
 
 	/* restore dtl_enable_mask */
-	lppaca_of(dtl->cpu).dtl_enable_mask = dtlr->saved_dtl_mask;
+	lppaca_of(dtl->cpu).dtl_enable_mask = DTL_LOG_PREEMPT;
 
 	if (atomic_dec_and_test(&dtl_count))
 		dtl_consumer = NULL;
-- 
2.21.0


  parent reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 15:43 [PATCH v2 0/9] Provide vcpu dispatch statistics Naveen N. Rao
2019-06-14 15:43 ` [PATCH v2 1/9] powerpc/pseries: Use macros for referring to the DTL enable mask Naveen N. Rao
2019-06-14 15:44 ` Naveen N. Rao [this message]
2019-06-14 15:44 ` [PATCH v2 3/9] powerpc/pseries: Factor out DTL buffer allocation and registration routines Naveen N. Rao
2019-06-14 15:44 ` [PATCH v2 4/9] powerpc/pseries: Introduce helpers to gatekeep DTLB usage Naveen N. Rao
2019-06-14 15:44 ` [PATCH v2 5/9] powerpc/pseries: Generalize hcall_vphn() Naveen N. Rao
2019-06-14 15:44 ` [PATCH v2 6/9] powerpc/pseries: Move mm/book3s64/vphn.c under platforms/pseries/ Naveen N. Rao
2019-06-14 15:44 ` [PATCH v2 7/9] powerpc/pseries: Provide vcpu dispatch statistics Naveen N. Rao
2019-06-14 15:44 ` [PATCH v2 8/9] powerpc/pseries: Protect against hogging the cpu while setting up the stats Naveen N. Rao
2019-06-14 15:44 ` [PATCH v2 9/9] powerpc/pseries: Add documentation for vcpudispatch_stats Naveen N. Rao

Reply instructions:

You may reply publically 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=bffc6b74c78c3e3bb54cc7fc79816d5f39775db4.1560526066.git.naveen.n.rao@linux.vnet.ibm.com \
    --to=naveen.n.rao@linux.vnet.ibm.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mingming.cao@ibm.com \
    --cc=mpe@ellerman.id.au \
    --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

LinuxPPC-Dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linuxppc-dev/0 linuxppc-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linuxppc-dev linuxppc-dev/ https://lore.kernel.org/linuxppc-dev \
		linuxppc-dev@lists.ozlabs.org linuxppc-dev@ozlabs.org linuxppc-dev@archiver.kernel.org
	public-inbox-index linuxppc-dev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.ozlabs.lists.linuxppc-dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox