[PATCH] i386/x86-64/ia64: Move polling flag into thread_info_status

During some profiling I noticed that default_idle causes a lot of
memory traffic. I think that is caused by the atomic operations
to clear/set the polling flag in thread_info. There is actually
no reason to make this atomic - only the idle thread does it
to itself, other CPUs only read it. So I moved it into ti->status.

Converted i386/x86-64/ia64 for now because that was the easiest
way to fix ACPI which also manipulates these flags in its idle
function.

Cc: Nick Piggin <npiggin@novell.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
这个提交包含在:
Andi Kleen
2006-06-26 13:59:11 +02:00
提交者 Linus Torvalds
父节点 d9005b52de
当前提交 495ab9c045
修改 9 个文件,包含 37 行新增25 行删除

查看文件

@@ -818,6 +818,11 @@ static void deactivate_task(struct task_struct *p, runqueue_t *rq)
* the target CPU.
*/
#ifdef CONFIG_SMP
#ifndef tsk_is_polling
#define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG)
#endif
static void resched_task(task_t *p)
{
int cpu;
@@ -833,9 +838,9 @@ static void resched_task(task_t *p)
if (cpu == smp_processor_id())
return;
/* NEED_RESCHED must be visible before we test POLLING_NRFLAG */
/* NEED_RESCHED must be visible before we test polling */
smp_mb();
if (!test_tsk_thread_flag(p, TIF_POLLING_NRFLAG))
if (!tsk_is_polling(p))
smp_send_reschedule(cpu);
}
#else