* [PATCH 0/2] Port MT and SMTC changes from linux-mti
@ 2009-07-10 9:05 Raghu Gandham
2009-07-10 9:05 ` [PATCH 1/2] Add debug prints during CPU intialization Raghu Gandham
2009-07-10 9:06 ` [PATCH 2/2] Avoid queing multiple reschedule IPI's in SMTC Raghu Gandham
0 siblings, 2 replies; 3+ messages in thread
From: Raghu Gandham @ 2009-07-10 9:05 UTC (permalink / raw)
To: linux-mips; +Cc: raghu, chris
The following series of patches port MT and SMTC changes in linux-mti.git repository to the head of tree.
---
Chris Dearman (1):
Add debug prints during CPU intialization.
Jaidev Patwardhan (1):
Avoid queing multiple reschedule IPI's in SMTC
arch/mips/include/asm/gcmpregs.h | 18 ++--
arch/mips/include/asm/gic.h | 188 ++++---------------------------------
arch/mips/include/asm/smtc_ipi.h | 5 +
arch/mips/kernel/irq-gic.c | 116 +++++++++--------------
arch/mips/kernel/smp-mt.c | 10 ++
arch/mips/kernel/smtc.c | 33 ++++++
arch/mips/mti-malta/malta-amon.c | 7 +
arch/mips/mti-malta/malta-int.c | 117 ++++++++++++++---------
arch/mips/mti-malta/malta-pci.c | 14 ++-
arch/mips/mti-malta/malta-setup.c | 100 ++++++++++++++++++++
10 files changed, 301 insertions(+), 307 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] Add debug prints during CPU intialization.
2009-07-10 9:05 [PATCH 0/2] Port MT and SMTC changes from linux-mti Raghu Gandham
@ 2009-07-10 9:05 ` Raghu Gandham
2009-07-10 9:06 ` [PATCH 2/2] Avoid queing multiple reschedule IPI's in SMTC Raghu Gandham
1 sibling, 0 replies; 3+ messages in thread
From: Raghu Gandham @ 2009-07-10 9:05 UTC (permalink / raw)
To: linux-mips; +Cc: raghu, chris
From: Chris Dearman <chris@mips.com>
Signed-off-by: Chris Dearman <chris@mips.com>
---
arch/mips/kernel/smp-mt.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/arch/mips/kernel/smp-mt.c b/arch/mips/kernel/smp-mt.c
index 6f7ee5a..c6c7b54 100644
--- a/arch/mips/kernel/smp-mt.c
+++ b/arch/mips/kernel/smp-mt.c
@@ -152,7 +152,7 @@ static void vsmp_send_ipi_mask(cpumask_t mask, unsigned int action)
static void __cpuinit vsmp_init_secondary(void)
{
extern int gic_present;
-
+ pr_debug("SMPMT: CPU%d: vsmp_init_secondary\n", smp_processor_id());
/* This is Malta specific: IPI,performance and timer inetrrupts */
if (gic_present)
change_c0_status(ST0_IM, STATUSF_IP3 | STATUSF_IP4 |
@@ -164,6 +164,8 @@ static void __cpuinit vsmp_init_secondary(void)
static void __cpuinit vsmp_smp_finish(void)
{
+ pr_debug("SMPMT: CPU%d: vsmp_smp_finish\n", smp_processor_id());
+
/* CDFIXME: remove this? */
write_c0_compare(read_c0_count() + (8* mips_hpt_frequency/HZ));
@@ -178,6 +180,7 @@ static void __cpuinit vsmp_smp_finish(void)
static void vsmp_cpus_done(void)
{
+ pr_debug("SMPMT: CPU%d: vsmp_cpus_done\n", smp_processor_id());
}
/*
@@ -191,6 +194,8 @@ static void vsmp_cpus_done(void)
static void __cpuinit vsmp_boot_secondary(int cpu, struct task_struct *idle)
{
struct thread_info *gp = task_thread_info(idle);
+ pr_debug("SMPMT: CPU%d: vsmp_boot_secondary cpu %d\n",
+ smp_processor_id(), cpu);
dvpe();
set_c0_mvpcontrol(MVPCONTROL_VPC);
@@ -232,6 +237,7 @@ static void __init vsmp_smp_setup(void)
unsigned int mvpconf0, ntc, tc, ncpu = 0;
unsigned int nvpe;
+ pr_debug("SMPMT: CPU%d: vsmp_smp_setup\n", smp_processor_id());
#ifdef CONFIG_MIPS_MT_FPAFF
/* If we have an FPU, enroll ourselves in the FPU-full mask */
if (cpu_has_fpu)
@@ -272,6 +278,8 @@ static void __init vsmp_smp_setup(void)
static void __init vsmp_prepare_cpus(unsigned int max_cpus)
{
+ pr_debug("SMPMT: CPU%d: vsmp_prepare_cpus %d\n",
+ smp_processor_id(), max_cpus);
mips_mt_set_cpuoptions();
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] Avoid queing multiple reschedule IPI's in SMTC
2009-07-10 9:05 [PATCH 0/2] Port MT and SMTC changes from linux-mti Raghu Gandham
2009-07-10 9:05 ` [PATCH 1/2] Add debug prints during CPU intialization Raghu Gandham
@ 2009-07-10 9:06 ` Raghu Gandham
1 sibling, 0 replies; 3+ messages in thread
From: Raghu Gandham @ 2009-07-10 9:06 UTC (permalink / raw)
To: linux-mips; +Cc: raghu, chris
From: Jaidev Patwardhan <jaidev@mips.com>
Signed-off-by: Chris Dearman <chris@mips.com>
---
arch/mips/include/asm/smtc_ipi.h | 5 +++--
arch/mips/kernel/smtc.c | 33 +++++++++++++++++++++++++++++----
2 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/arch/mips/include/asm/smtc_ipi.h b/arch/mips/include/asm/smtc_ipi.h
index 8ce5175..832b8be 100644
--- a/arch/mips/include/asm/smtc_ipi.h
+++ b/arch/mips/include/asm/smtc_ipi.h
@@ -23,8 +23,8 @@ struct smtc_ipi {
void *arg;
int dest;
#ifdef SMTC_IPI_DEBUG
- int sender;
- long stamp;
+ unsigned sender;
+ unsigned long long stamp;
#endif /* SMTC_IPI_DEBUG */
};
@@ -45,6 +45,7 @@ struct smtc_ipi_q {
spinlock_t lock;
struct smtc_ipi *tail;
int depth;
+ int resched_flag; /* reschedule already queued */
};
static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p)
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index c16bb6d..ed4c04c 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -75,7 +75,6 @@ unsigned long irq_hwmask[NR_IRQS];
asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS];
-
/*
* Number of InterProcessor Interrupt (IPI) message buffers to allocate
*/
@@ -388,6 +387,7 @@ void smtc_prepare_cpus(int cpus)
IPIQ[i].head = IPIQ[i].tail = NULL;
spin_lock_init(&IPIQ[i].lock);
IPIQ[i].depth = 0;
+ IPIQ[i].resched_flag = 0; /* No reschedules queued initially */
}
/* cpu_data index starts at zero */
@@ -741,11 +741,24 @@ void smtc_forward_irq(unsigned int irq)
static void smtc_ipi_qdump(void)
{
int i;
+ struct smtc_ipi *temp;
for (i = 0; i < NR_CPUS ;i++) {
- printk("IPIQ[%d]: head = 0x%x, tail = 0x%x, depth = %d\n",
+ pr_info("IPIQ[%d]: head = 0x%x, tail = 0x%x, depth = %d\n",
i, (unsigned)IPIQ[i].head, (unsigned)IPIQ[i].tail,
IPIQ[i].depth);
+ temp = IPIQ[i].head;
+
+ while (temp != IPIQ[i].tail) {
+ pr_debug("%d %d %d: ", temp->type, temp->dest,
+ (int)temp->arg);
+#ifdef SMTC_IPI_DEBUG
+ pr_debug("%u %lu\n", temp->sender, temp->stamp);
+#else
+ pr_debug("\n");
+#endif
+ temp = temp->flink;
+ }
}
}
@@ -784,11 +797,15 @@ void smtc_send_ipi(int cpu, int type, unsigned int action)
int mtflags;
unsigned long tcrestart;
extern void r4k_wait_irqoff(void), __pastwait(void);
+ int set_resched_flag = (type == LINUX_SMP_IPI &&
+ action == SMP_RESCHEDULE_YOURSELF);
if (cpu == smp_processor_id()) {
printk("Cannot Send IPI to self!\n");
return;
}
+ if (set_resched_flag && IPIQ[cpu].resched_flag != 0)
+ return; /* There is a reschedule queued already */
/* Set up a descriptor, to be delivered either promptly or queued */
pipi = smtc_ipi_dq(&freeIPIq);
if (pipi == NULL) {
@@ -801,6 +818,7 @@ void smtc_send_ipi(int cpu, int type, unsigned int action)
pipi->dest = cpu;
if (cpu_data[cpu].vpe_id != cpu_data[smp_processor_id()].vpe_id) {
/* If not on same VPE, enqueue and send cross-VPE interrupt */
+ IPIQ[cpu].resched_flag |= set_resched_flag;
smtc_ipi_nq(&IPIQ[cpu], pipi);
LOCK_CORE_PRA();
settc(cpu_data[cpu].tc_id);
@@ -847,6 +865,7 @@ void smtc_send_ipi(int cpu, int type, unsigned int action)
*/
write_tc_c0_tchalt(0);
UNLOCK_CORE_PRA();
+ IPIQ[cpu].resched_flag |= set_resched_flag;
smtc_ipi_nq(&IPIQ[cpu], pipi);
} else {
postdirect:
@@ -996,12 +1015,15 @@ void deferred_smtc_ipi(void)
* already enabled.
*/
local_irq_save(flags);
-
spin_lock(&q->lock);
pipi = __smtc_ipi_dq(q);
spin_unlock(&q->lock);
- if (pipi != NULL)
+ if (pipi != NULL) {
+ if (pipi->type == LINUX_SMP_IPI &&
+ (int)pipi->arg == SMP_RESCHEDULE_YOURSELF)
+ IPIQ[cpu].resched_flag = 0;
ipi_decode(pipi);
+ }
/*
* The use of the __raw_local restore isn't
* as obviously necessary here as in smtc_ipi_replay(),
@@ -1082,6 +1104,9 @@ static irqreturn_t ipi_interrupt(int irq, void *dev_idm)
* with interrupts off
*/
local_irq_save(flags);
+ if (pipi->type == LINUX_SMP_IPI &&
+ (int)pipi->arg == SMP_RESCHEDULE_YOURSELF)
+ IPIQ[cpu].resched_flag = 0;
ipi_decode(pipi);
local_irq_restore(flags);
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-07-10 9:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-10 9:05 [PATCH 0/2] Port MT and SMTC changes from linux-mti Raghu Gandham
2009-07-10 9:05 ` [PATCH 1/2] Add debug prints during CPU intialization Raghu Gandham
2009-07-10 9:06 ` [PATCH 2/2] Avoid queing multiple reschedule IPI's in SMTC Raghu Gandham
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.