Skip to contentSkip to conversation

Rearrange thread flags to work with the "andi" instruction.

PATCH In review Tony Breeds 2 participants 6 messages Sep 4, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 Rearrange thread flags to work with the "andi" instruction.

---

 include/asm-powerpc/thread_info.h |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
include/asm-powerpc/thread_info.h +5 -5
Index: working/include/asm-powerpc/thread_info.h
===================================================================
@@ -121,11 +121,11 @@ static inline struct thread_info *curren
 #define TIF_RESTOREALL		11	/* Restore all regs (implies NOERROR) */
 #define TIF_NOERROR		12	/* Force successful syscall return */
 #define TIF_RESTORE_SIGMASK	13	/* Restore signal mask in do_signal */
-#define TIF_FREEZE		14	/* Freezing for suspend */
-#define TIF_RUNLATCH		15	/* Is the runlatch enabled? */
-#define TIF_ABI_PENDING		16	/* 32/64 bit switch needed */
 #define TIF_NEED_RESCHED_DELAYED \
-				17	/* reschedule on return to userspace */
+				14	/* reschedule on return to userspace */
+#define TIF_FREEZE		15	/* Freezing for suspend */
+#define TIF_RUNLATCH		16	/* Is the runlatch enabled? */
+#define TIF_ABI_PENDING		17	/* 32/64 bit switch needed */
 
 
 /* as above, but as bit values */
@@ -142,10 +142,10 @@ static inline struct thread_info *curren
 #define _TIF_RESTOREALL		(1<<TIF_RESTOREALL)
 #define _TIF_NOERROR		(1<<TIF_NOERROR)
 #define _TIF_RESTORE_SIGMASK	(1<<TIF_RESTORE_SIGMASK)
+#define _TIF_NEED_RESCHED_DELAYED (1<<TIF_NEED_RESCHED_DELAYED)
 #define _TIF_FREEZE		(1<<TIF_FREEZE)
 #define _TIF_RUNLATCH		(1<<TIF_RUNLATCH)
 #define _TIF_ABI_PENDING	(1<<TIF_ABI_PENDING)
-#define _TIF_NEED_RESCHED_DELAYED (1<<TIF_NEED_RESCHED_DELAYED)
 
 #define _TIF_SYSCALL_T_OR_A	(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP)
 
#1 lore raw

PATCH 2/5 count_active_rt_tasks() is undefined when CONFIG_PREEMPT_RT is not set.

Also, it looks to me that active_rt_tasks[] was never modified.

---

 kernel/timer.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
kernel/timer.c +8 -4
Index: working/kernel/timer.c
===================================================================
@@ -953,21 +953,25 @@ unsigned long avenrun_rt[3];
 static inline void calc_load(unsigned long ticks)
 {
 	unsigned long active_tasks; /* fixed-point */
-	unsigned long active_rt_tasks; /* fixed-point */
 	static int count = LOAD_FREQ;
+#ifdef CONFIG_PREEMPT_RT
+	unsigned long active_rt_tasks; /* fixed-point */
+#endif
 
 	count -= ticks;
 	if (unlikely(count < 0)) {
 		active_tasks = count_active_tasks();
+#ifdef CONFIG_PREEMPT_RT
 		active_rt_tasks = count_active_rt_tasks();
+#endif
 		do {
 			CALC_LOAD(avenrun[0], EXP_1, active_tasks);
 			CALC_LOAD(avenrun[1], EXP_5, active_tasks);
 			CALC_LOAD(avenrun[2], EXP_15, active_tasks);
 #ifdef CONFIG_PREEMPT_RT
-			CALC_LOAD(avenrun_rt[0], EXP_1, active_tasks);
-			CALC_LOAD(avenrun_rt[1], EXP_5, active_tasks);
-			CALC_LOAD(avenrun_rt[2], EXP_15, active_tasks);
+			CALC_LOAD(avenrun_rt[0], EXP_1, active_rt_tasks);
+			CALC_LOAD(avenrun_rt[1], EXP_5, active_rt_tasks);
+			CALC_LOAD(avenrun_rt[2], EXP_15, active_rt_tasks);
 #endif
 			count += LOAD_FREQ;
 
#2 lore raw

PATCH 3/5 Match __rw_yeild function declaration to prototype.

In reply to Tony Breeds

---

 arch/powerpc/lib/locks.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/lib/locks.c +1 -1
Index: working/arch/powerpc/lib/locks.c
===================================================================
@@ -55,7 +55,7 @@ void __spin_yield(__raw_spinlock_t *lock
  * This turns out to be the same for read and write locks, since
  * we only know the holder if it is write-locked.
  */
-void __rw_yield(raw_rwlock_t *rw)
+void __rw_yield(__raw_rwlock_t *rw)
 {
 	int lock_value;
 	unsigned int holder_cpu, yield_count;
#3 lore raw

PATCH 4/5 flags as passed to spin_*_irqsave() should be unsigned long.

In reply to Tony Breeds

---

 drivers/net/pasemi_mac.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/pasemi_mac.c +2 -2
Index: working/drivers/net/pasemi_mac.c
===================================================================
@@ -524,7 +524,7 @@ static int pasemi_mac_clean_tx(struct pa
 	struct pasemi_mac_buffer *info;
 	struct pas_dma_xct_descr *dp;
 	int start, count;
-	int flags;
+	unsigned long flags;
 
 	spin_lock_irqsave(&mac->tx->lock, flags);
 
@@ -950,7 +950,7 @@ static int pasemi_mac_start_tx(struct sk
 	struct pas_dma_xct_descr *dp;
 	u64 dflags;
 	dma_addr_t map;
-	int flags;
+	unsigned long flags;
 
 	dflags = XCT_MACTX_O | XCT_MACTX_ST | XCT_MACTX_SS | XCT_MACTX_CRC_PAD;
 
#4 lore raw

Re: [PATCH 4/5] [POWERPC] flags as passed to spin_*_irqsave() should be unsigned long.

Quoted 12 lines · Tony Breeds

---

 drivers/net/pasemi_mac.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: working/drivers/net/pasemi_mac.c
===================================================================

drivers/net/pasemi_mac.c static int pasemi_mac_clean_tx(struct pa · line 527

Quoted 5 lines
drivers/net/pasemi_mac.c +1 -1
@@ -524,7 +524,7 @@ static int pasemi_mac_clean_tx(struct pa
 	struct pasemi_mac_buffer *info;
 	struct pas_dma_xct_descr *dp;
 	int start, count;
-	int flags;
+	unsigned long flags;

Upstream too (should always be unsigned long) ? Also you forgot to CC LKML ..

Daniel

#5 lore raw

PATCH 5/5 flush_tlb_pending() is no more, use __flush_tlb_pending() instead.

In reply to Tony Breeds

---

 arch/powerpc/mm/tlb_64.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/mm/tlb_64.c +1 -1
Index: working/arch/powerpc/mm/tlb_64.c
===================================================================
@@ -211,7 +211,7 @@ void hpte_need_flush(struct mm_struct *m
 	 * always flush it on RT to reduce scheduling latency.
 	 */
 	if (machine_is(celleb)) {
-		flush_tlb_pending();
+		__flush_tlb_pending(batch);
 		return;
 	}
 #endif /* CONFIG_PREEMPT_RT */