public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] CMC/CPE: Reverse the order of fetching log and checking poll
@ 2006-09-05  8:53 Hidetoshi Seto
  2006-09-08  9:15 ` Hidetoshi Seto
  0 siblings, 1 reply; 2+ messages in thread
From: Hidetoshi Seto @ 2006-09-05  8:53 UTC (permalink / raw)
  To: linux-ia64

This patch reverses the order of fetching log from SAL and
checking poll threshold. This will fix following trivial issues:

- If SAL_GET_SATE_INFO is unbelievably slow (due to huge system
   or just its silly implementation) and if it takes more than
   1/5 sec, CMCI/CPEI will never switch to CMCP/CPEP.
- Assuming terrible flood of interrupt (continuous corrected
   errors let all CPUs enter to handler at once and bind them
   in it), CPUs will be serialized by IA64_LOG_LOCK(*).
   Now we check the poll threshold after the lock and log fetch,
   so we need to call SAL_GET_STATE_INFO (num_online_cpus() + 4)
   times in the worst case.
   if we can check the threshold before the lock, we can shut up
   interrupts quickly without waiting preceding log fetches, and
   the number of times will be reduced to (num_online_cpus()) in
   the same situation.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>

---
  arch/ia64/kernel/mca.c |   18 ++++++++++--------
  1 files changed, 10 insertions(+), 8 deletions(-)

Index: linux-2.6.17-rc6/arch/ia64/kernel/mca.c
=================================--- linux-2.6.17-rc6.orig/arch/ia64/kernel/mca.c
+++ linux-2.6.17-rc6/arch/ia64/kernel/mca.c
@@ -345,9 +345,6 @@
  	/* SAL spec states this should run w/ interrupts enabled */
  	local_irq_enable();

-	/* Get the CPE error record and log it */
-	ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CPE);
-
  	spin_lock(&cpe_history_lock);
  	if (!cpe_poll_enabled && cpe_vector >= 0) {

@@ -376,7 +373,7 @@
  			mod_timer(&cpe_poll_timer, jiffies + MIN_CPE_POLL_INTERVAL);

  			/* lock already released, get out now */
-			return IRQ_HANDLED;
+			goto out;
  		} else {
  			cpe_history[index++] = now;
  			if (index = CPE_HISTORY_LENGTH)
@@ -384,6 +381,10 @@
  		}
  	}
  	spin_unlock(&cpe_history_lock);
+out:
+	/* Get the CPE error record and log it */
+	ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CPE);
+
  	return IRQ_HANDLED;
  }

@@ -1107,9 +1108,6 @@
  	/* SAL spec states this should run w/ interrupts enabled */
  	local_irq_enable();

-	/* Get the CMC error record and log it */
-	ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CMC);
-
  	spin_lock(&cmc_history_lock);
  	if (!cmc_polling_enabled) {
  		int i, count = 1; /* we know 1 happened now */
@@ -1142,7 +1140,7 @@
  			mod_timer(&cmc_poll_timer, jiffies + CMC_POLL_INTERVAL);

  			/* lock already released, get out now */
-			return IRQ_HANDLED;
+			goto out;
  		} else {
  			cmc_history[index++] = now;
  			if (index = CMC_HISTORY_LENGTH)
@@ -1150,6 +1148,10 @@
  		}
  	}
  	spin_unlock(&cmc_history_lock);
+out:
+	/* Get the CMC error record and log it */
+	ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CMC);
+
  	return IRQ_HANDLED;
  }



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] CMC/CPE: Reverse the order of fetching log and checking poll
  2006-09-05  8:53 [PATCH] CMC/CPE: Reverse the order of fetching log and checking poll Hidetoshi Seto
@ 2006-09-08  9:15 ` Hidetoshi Seto
  0 siblings, 0 replies; 2+ messages in thread
From: Hidetoshi Seto @ 2006-09-08  9:15 UTC (permalink / raw)
  To: linux-ia64

(Last patch was based on wrong/old kernel. This is repost.)

This patch reverses the order of fetching log from SAL and
checking poll threshold. This will fix following trivial issues:

- If SAL_GET_SATE_INFO is unbelievably slow (due to huge system
   or just its silly implementation) and if it takes more than
   1/5 sec, CMCI/CPEI will never switch to CMCP/CPEP.
- Assuming terrible flood of interrupt (continuous corrected
   errors let all CPUs enter to handler at once and bind them
   in it), CPUs will be serialized by IA64_LOG_LOCK(*).
   Now we check the poll threshold after the lock and log fetch,
   so we need to call SAL_GET_STATE_INFO (num_online_cpus() + 4)
   times in the worst case.
   if we can check the threshold before the lock, we can shut up
   interrupts quickly without waiting preceding log fetches, and
   the number of times will be reduced to (num_online_cpus()) in
   the same situation.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>

---
  arch/ia64/kernel/mca.c |   18 ++++++++++--------
  1 files changed, 10 insertions(+), 8 deletions(-)

Index: linux-2.6.18-rc6/arch/ia64/kernel/mca.c
=================================--- linux-2.6.18-rc6.orig/arch/ia64/kernel/mca.c
+++ linux-2.6.18-rc6/arch/ia64/kernel/mca.c
@@ -344,9 +344,6 @@
  	/* SAL spec states this should run w/ interrupts enabled */
  	local_irq_enable();

-	/* Get the CPE error record and log it */
-	ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CPE);
-
  	spin_lock(&cpe_history_lock);
  	if (!cpe_poll_enabled && cpe_vector >= 0) {

@@ -375,7 +372,7 @@
  			mod_timer(&cpe_poll_timer, jiffies + MIN_CPE_POLL_INTERVAL);

  			/* lock already released, get out now */
-			return IRQ_HANDLED;
+			goto out;
  		} else {
  			cpe_history[index++] = now;
  			if (index = CPE_HISTORY_LENGTH)
@@ -383,6 +380,10 @@
  		}
  	}
  	spin_unlock(&cpe_history_lock);
+out:
+	/* Get the CPE error record and log it */
+	ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CPE);
+
  	return IRQ_HANDLED;
  }

@@ -1106,9 +1107,6 @@
  	/* SAL spec states this should run w/ interrupts enabled */
  	local_irq_enable();

-	/* Get the CMC error record and log it */
-	ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CMC);
-
  	spin_lock(&cmc_history_lock);
  	if (!cmc_polling_enabled) {
  		int i, count = 1; /* we know 1 happened now */
@@ -1141,7 +1139,7 @@
  			mod_timer(&cmc_poll_timer, jiffies + CMC_POLL_INTERVAL);

  			/* lock already released, get out now */
-			return IRQ_HANDLED;
+			goto out;
  		} else {
  			cmc_history[index++] = now;
  			if (index = CMC_HISTORY_LENGTH)
@@ -1149,6 +1147,10 @@
  		}
  	}
  	spin_unlock(&cmc_history_lock);
+out:
+	/* Get the CMC error record and log it */
+	ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CMC);
+
  	return IRQ_HANDLED;
  }



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-09-08  9:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-05  8:53 [PATCH] CMC/CPE: Reverse the order of fetching log and checking poll Hidetoshi Seto
2006-09-08  9:15 ` Hidetoshi Seto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox