Commit Graph
21 Commits
Author SHA1 Message Date
Yong Zhang f2b88d65aa MIPS: sync-r4k: remove redundant irq operation
Since we have delayed irq enabling to ->smp_finish()

Signed-off-by: Yong Zhang <[email protected]>
Cc: Sergei Shtylyov <[email protected]>
Cc: David Daney <[email protected]>
Acked-by: David Daney <[email protected]>
Signed-off-by: Ralf Baechle <[email protected]>
2012-07-19 11:23:44 +02:00
Yong Zhang b789ad63ac MIPS: smp: Warn on too early irq enable
Just to catch a potential issue.

Signed-off-by: Yong Zhang <[email protected]>
Cc: Sergei Shtylyov <[email protected]>
Cc: David Daney <[email protected]>
Acked-by: David Daney <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/3852/
Signed-off-by: Ralf Baechle <[email protected]>
2012-07-19 11:23:44 +02:00
Yong Zhang b9a09a0660 MIPS: call set_cpu_online() on cpu being brought up with irq disabled
To prevent a problem as commit 5fbd036b [sched: Cleanup cpu_active madness]
and commit 2baab4e9 [sched: Fix select_fallback_rq() vs cpu_active/cpu_online]
try to resolve, move set_cpu_online() to the brought up CPU and with irq
disabled.

Signed-off-by: Yong Zhang <[email protected]>
Cc: Sergei Shtylyov <[email protected]>
Cc: David Daney <[email protected]>
Acked-by: David Daney <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/3851/
Signed-off-by: Ralf Baechle <[email protected]>
2012-07-19 11:23:44 +02:00
Yong Zhang 5309bdac70 MIPS: call ->smp_finish() a little late
We have move irq enable to ->smp_finish. Place ->smp_finish() a little
late to prepare for move set_cpu_online() into start_secondary.
And it's not necessary to call cpu_set(cpu, cpu_callin_map) and
synchronise_count_slave() with irq enabled.

Signed-off-by: Yong Zhang <[email protected]>
Cc: Sergei Shtylyov <[email protected]>
Cc: David Daney <[email protected]>
Acked-by: David Daney <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/3850/
Signed-off-by: Ralf Baechle <[email protected]>
2012-07-19 11:23:44 +02:00
Yong Zhang 263afbdd1c MIPS: Yosemite: delay irq enable to ->smp_finish()
To prepare for smoothing set_cpu_[active|online]() mess up

Signed-off-by: Yong Zhang <[email protected]>
Cc: Sergei Shtylyov <[email protected]>
Cc: David Daney <[email protected]>
Acked-by: David Daney <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/3848/
Signed-off-by: Ralf Baechle <[email protected]>
2012-07-19 11:23:44 +02:00
Yong Zhang 70dc8fa782 MIPS: SMTC: delay irq enable to ->smp_finish()
To prepare for smoothing set_cpu_[active|online]() mess up

Signed-off-by: Yong Zhang <[email protected]>
Cc: Sergei Shtylyov <[email protected]>
Cc: David Daney <[email protected]>
Acked-by: David Daney <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/3847/
Signed-off-by: Ralf Baechle <[email protected]>
2012-07-19 11:23:44 +02:00
Yong Zhang 856ac3c6e0 MIPS: BMIPS: delay irq enable to ->smp_finish()
To prepare for smoothing set_cpu_[active|online]() mess up

Signed-off-by: Yong Zhang <[email protected]>
Cc: Sergei Shtylyov <[email protected]>
Cc: David Daney <[email protected]>
Acked-by: David Daney <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/3846/
Signed-off-by: Ralf Baechle <[email protected]>
2012-07-19 11:23:44 +02:00
Yong Zhang 1bcfecc028 MIPS: Octeon: delay enable irq to ->smp_finish()
To prepare for smoothing set_cpu_[active|online]() mess up

Signed-off-by: Yong Zhang <[email protected]>
Cc: Sergei Shtylyov <[email protected]>
Cc: David Daney <[email protected]>
Acked-by: David Daney <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/3845/
Signed-off-by: Ralf Baechle <[email protected]>
2012-07-19 11:23:44 +02:00
Yong Zhang e250d4bca6 powerpc/smp: remove call to ipi_call_lock()/ipi_call_unlock()
1) call_function.lock used in smp_call_function_many() is just to protect
   call_function.queue and &data->refs, cpu_online_mask is outside of the
   lock. And it's not necessary to protect cpu_online_mask,
   because data->cpumask is pre-calculate and even if a cpu is brougt up
   when calling arch_send_call_function_ipi_mask(), it's harmless because
   validation test in generic_smp_call_function_interrupt() will take care
   of it.

2) For cpu down issue, stop_machine() will guarantee that no concurrent
   smp_call_fuction() is processing.

Signed-off-by: Yong Zhang <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
2012-07-03 14:14:42 +10:00
Yong Zhang e9a5ea1852 sparc32,leon: add notify_cpu_starting()
Otherwise cpu_active_mask will not set, which lead to other issue.

Signed-off-by: Yong Zhang <[email protected]>
Signed-off-by: Konrad Eisele <[email protected]>
Reviewed-by: Srivatsa S. Bhat <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2012-04-21 16:35:06 -04:00
Yong Zhang 1eec6cd08b MIPS: Compat: Use 32-bit wrapper for compat_sys_futex.
We can't trust userspace to pass signed-extend arguments.  Not correctly
sign-extended arguments to futex-wait result in architecturally undefined
operation of 32-bit arithmetic instructions.

For example, if 'val' is too big and bit-31 is 1, the caller may enter
endless loop at:

futex_wait_setup()
{
	...

	if (uval != val) {
		queue_unlock(q, *hb);
		ret = -EWOULDBLOCK;

	...
}

Signed-off-by: Yong Zhang <[email protected]>
To: [email protected]
To: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/2714/
Signed-off-by: Ralf Baechle <[email protected]>
2011-09-21 17:53:44 +02:00
Yong Zhang 5e4f083f78 hrtimer: Remove stale comment on curr_timer
curr_timer doesn't resident in struct hrtimer_cpu_base anymore.

Signed-off-by: Yong Zhang <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
2010-11-10 12:39:52 +01:00
Yong Zhang 466bd30309 timer: Warn when del_timer_sync() is called in hardirq context
Add explict warning when del_timer_sync() is called in hardirq
context.

Signed-off-by: Yong Zhang <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Acked-by: Oleg Nesterov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
2010-10-22 14:46:25 +02:00
Yong Zhang 1118e2cd33 timer: Del_timer_sync() can be used in softirq context
Actually we have used del_timer_sync() in softirq context for a long time,
e.g. in __dst_free()::cancel_delayed_work().

So change the comments of it to warn on hardirq context only, and make
lockdep know about this change.

Signed-off-by: Yong Zhang <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
2010-10-22 14:46:25 +02:00
Yong Zhang 6f1bc451e6 timer: Make try_to_del_timer_sync() the same on SMP and UP
On UP try_to_del_timer_sync() is mapped to del_timer() which does not
take the running timer callback into account, so it has different
semantics.

Remove the SMP dependency of try_to_del_timer_sync() by using
base->running_timer in the UP case as well.

[ tglx: Removed set_running_timer() inline and tweaked the changelog ]

Signed-off-by: Yong Zhang <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Acked-by: Oleg Nesterov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
2010-10-22 14:46:25 +02:00
Yong Zhang 4b04a7cfc5 .gitignore: ignore apparmor/rlim_names.h
Signed-off-by: Yong Zhang <[email protected]>
Signed-off-by: John Johansen <[email protected]>
Signed-off-by: James Morris <[email protected]>
2010-10-21 10:12:35 +11:00
Yong Zhang 4726f2a617 lockdep: Reduce stack_trace usage
When calling check_prevs_add(), if all validations passed
add_lock_to_list() will add new lock to dependency tree and
alloc stack_trace for each list_entry.

But at this time, we are always on the same stack, so stack_trace
for each list_entry has the same value. This is redundant and eats
up lots of memory which could lead to warning on low
MAX_STACK_TRACE_ENTRIES.

Use one copy of stack_trace instead.

V2: As suggested by Peter Zijlstra, move save_trace() from
    check_prevs_add() to check_prev_add().
    Add tracking for trylock dependence which is also redundant.

Signed-off-by: Yong Zhang <[email protected]>
Cc: David S. Miller <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
2010-05-07 11:27:26 +02:00
Yong Zhang 57119c34e5 ratelimit: fix the return value when __ratelimit() fails to acquire the lock
The log of commit edaac8e316 ("ratelimit:
Fix/allow use in atomic contexts"), indicates that we want to suppress the
callback when the trylock fails.

Signed-off-by: Yong Zhang <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2010-04-07 08:38:04 -07:00
Yong Zhang bb1dc0bacb kernel.h: fix wrong usage of __ratelimit()
When __ratelimit() returns 1 this means that we can go ahead.

Signed-off-by: Yong Zhang <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2010-04-07 08:38:04 -07:00
Yong Zhang 2a7268abc4 ratelimit: annotate ___ratelimit()
To prevent from wrongly using the return value.

[[email protected]: fix spello]
Signed-off-by: Yong Zhang <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Dave Young <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2010-04-07 08:38:04 -07:00
Yong Zhang cad9bc6904 MIPS: 64-bit: Fix o32 core dump
If an o32 process generates a core dump on a 64 bit kernel, the core file
will not be correctly recognized. This is because ELF_CORE_COPY_REGS and
ELF_CORE_COPY_TASK_REGS are not correctly defined for o32 and will use
the default register set which would be CONFIG_64BIT in asm/elf.h.

So we'll switch to use the right register defines in this situation by
checking for WANT_COMPAT_REG_H and use the right defines of
ELF_CORE_COPY_REGS and ELF_CORE_COPY_TASK_REGS.

[Ralf: made ELF_CORE_COPY_TASK_REGS() bullet-proof against funny arguments.]

Signed-off-by: Yong Zhang <[email protected]>
Signed-off-by: Ralf Baechle <[email protected]>
2009-07-03 15:45:27 +01:00