Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965686AbXEWKSy (ORCPT ); Wed, 23 May 2007 06:18:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1765800AbXEWKSn (ORCPT ); Wed, 23 May 2007 06:18:43 -0400 Received: from tayrelbas03.tay.hp.com ([161.114.80.246]:33864 "EHLO tayrelbas03.tay.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1765789AbXEWKSk (ORCPT ); Wed, 23 May 2007 06:18:40 -0400 X-Greylist: delayed 1252 seconds by postgrey-1.27 at vger.kernel.org; Wed, 23 May 2007 06:18:39 EDT Date: Wed, 23 May 2007 02:57:43 -0700 From: Stephane Eranian To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, ak@suse.de, tony.luck@intel.com, Stephane Eranian Subject: [PATCH] remove unused TIF_NOTIFY_RESUME flag Message-ID: <20070523095743.GC28832@frankl.hpl.hp.com> Reply-To: eranian@hpl.hp.com References: <20070522124713.GB27428@frankl.hpl.hp.com> <20070522090210.1388ff3e.akpm@linux-foundation.org> <20070522160737.GI27631@frankl.hpl.hp.com> <20070522091517.251cc2d0.akpm@linux-foundation.org> <20070522225135.GF28287@frankl.hpl.hp.com> <20070522160207.e147a8a6.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070522160207.e147a8a6.akpm@linux-foundation.org> User-Agent: Mutt/1.4.1i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: eranian@hpl.hp.com Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 34236 Lines: 678 Hello, As per the recent discussion, the folowing patch removes the TIF_NOTIFY_RESUME flag from all processor architectures. The flag was not used except on IA-64 for the perfmon subsystem. For IA-64, the patch replaces the flag with a new dedicated TIF flag. This provides an extra low-order bit for the TIF flags. I tested the kernel compiles on i386,x86_64,mips,ia64,powerpc. The patch is relative to 2.6.22-rc2 but applies smoothly to 2.6.22-rc2-git3. Changelog: - remove unused TIF_NOTIFY_RESUME flag for all processor architectures. The flag was not used excecpt on IA-64 where the patch replaces it with TIF_PERFMON_WORK. signed-off-by: stephane eranian diff -urNp linux-2.6.22.orig/arch/arm/kernel/entry-common.S linux-2.6.22.base/arch/arm/kernel/entry-common.S --- linux-2.6.22.orig/arch/arm/kernel/entry-common.S 2007-04-25 20:08:32.000000000 -0700 +++ linux-2.6.22.base/arch/arm/kernel/entry-common.S 2007-05-22 13:38:39.000000000 -0700 @@ -46,7 +46,7 @@ fast_work_pending: work_pending: tst r1, #_TIF_NEED_RESCHED bne work_resched - tst r1, #_TIF_NOTIFY_RESUME | _TIF_SIGPENDING + tst r1, #_TIF_SIGPENDING beq no_work_pending mov r0, sp @ 'regs' mov r2, why @ 'syscall' diff -urNp linux-2.6.22.orig/arch/arm26/kernel/entry.S linux-2.6.22.base/arch/arm26/kernel/entry.S --- linux-2.6.22.orig/arch/arm26/kernel/entry.S 2007-04-25 20:08:32.000000000 -0700 +++ linux-2.6.22.base/arch/arm26/kernel/entry.S 2007-05-22 13:39:00.000000000 -0700 @@ -194,7 +194,7 @@ fast_work_pending: work_pending: tst r1, #_TIF_NEED_RESCHED bne work_resched - tst r1, #_TIF_NOTIFY_RESUME | _TIF_SIGPENDING + tst r1, #_TIF_SIGPENDING beq no_work_pending mov r0, sp @ 'regs' mov r2, why @ 'syscall' diff -urNp linux-2.6.22.orig/arch/ia64/kernel/perfmon.c linux-2.6.22.base/arch/ia64/kernel/perfmon.c --- linux-2.6.22.orig/arch/ia64/kernel/perfmon.c 2007-05-21 01:39:04.000000000 -0700 +++ linux-2.6.22.base/arch/ia64/kernel/perfmon.c 2007-05-22 13:41:23.000000000 -0700 @@ -591,13 +591,13 @@ pfm_set_task_notify(struct task_struct * struct thread_info *info; info = (struct thread_info *) ((char *) task + IA64_TASK_SIZE); - set_bit(TIF_NOTIFY_RESUME, &info->flags); + set_bit(TIF_PERFMON_WORK, &info->flags); } static inline void pfm_clear_task_notify(void) { - clear_thread_flag(TIF_NOTIFY_RESUME); + clear_thread_flag(TIF_PERFMON_WORK); } static inline void diff -urNp linux-2.6.22.orig/arch/powerpc/kernel/entry_64.S linux-2.6.22.base/arch/powerpc/kernel/entry_64.S --- linux-2.6.22.orig/arch/powerpc/kernel/entry_64.S 2007-04-25 20:08:32.000000000 -0700 +++ linux-2.6.22.base/arch/powerpc/kernel/entry_64.S 2007-05-22 13:39:55.000000000 -0700 @@ -546,7 +546,6 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISER rfid b . /* prevent speculative execution */ -/* Note: this must change if we start using the TIF_NOTIFY_RESUME bit */ do_work: #ifdef CONFIG_PREEMPT andi. r0,r3,MSR_PR /* Returning to user mode? */ diff -urNp linux-2.6.22.orig/arch/x86_64/kernel/entry.S linux-2.6.22.base/arch/x86_64/kernel/entry.S --- linux-2.6.22.orig/arch/x86_64/kernel/entry.S 2007-05-21 01:39:05.000000000 -0700 +++ linux-2.6.22.base/arch/x86_64/kernel/entry.S 2007-05-22 13:40:14.000000000 -0700 @@ -282,7 +282,7 @@ sysret_careful: sysret_signal: TRACE_IRQS_ON sti - testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx + testl $(_TIF_SIGPENDING|_TIF_SINGLESTEP),%edx jz 1f /* Really a signal */ @@ -375,7 +375,7 @@ int_very_careful: jmp int_restore_rest int_signal: - testl $(_TIF_NOTIFY_RESUME|_TIF_SIGPENDING|_TIF_SINGLESTEP),%edx + testl $(_TIF_SIGPENDING|_TIF_SINGLESTEP),%edx jz 1f movq %rsp,%rdi # &ptregs -> arg1 xorl %esi,%esi # oldset -> arg2 @@ -599,7 +599,7 @@ retint_careful: jmp retint_check retint_signal: - testl $(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SINGLESTEP),%edx + testl $(_TIF_SIGPENDING|_TIF_SINGLESTEP),%edx jz retint_swapgs TRACE_IRQS_ON sti diff -urNp linux-2.6.22.orig/include/asm-alpha/thread_info.h linux-2.6.22.base/include/asm-alpha/thread_info.h --- linux-2.6.22.orig/include/asm-alpha/thread_info.h 2007-05-21 01:39:09.000000000 -0700 +++ linux-2.6.22.base/include/asm-alpha/thread_info.h 2007-05-22 13:26:24.000000000 -0700 @@ -67,25 +67,22 @@ register struct thread_info *__current_t * TIF_SYSCALL_TRACE is known to be 0 via blbs. */ #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ -#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ -#define TIF_SIGPENDING 2 /* signal pending */ -#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ -#define TIF_POLLING_NRFLAG 4 /* poll_idle is polling NEED_RESCHED */ -#define TIF_DIE_IF_KERNEL 5 /* dik recursion lock */ -#define TIF_UAC_NOPRINT 6 /* see sysinfo.h */ -#define TIF_UAC_NOFIX 7 -#define TIF_UAC_SIGBUS 8 -#define TIF_MEMDIE 9 +#define TIF_SIGPENDING 1 /* signal pending */ +#define TIF_NEED_RESCHED 2 /* rescheduling necessary */ +#define TIF_POLLING_NRFLAG 3 /* poll_idle is polling NEED_RESCHED */ +#define TIF_DIE_IF_KERNEL 4 /* dik recursion lock */ +#define TIF_UAC_NOPRINT 5 /* see sysinfo.h */ +#define TIF_UAC_NOFIX 6 +#define TIF_UAC_SIGBUS 7 +#define TIF_MEMDIE 8 #define _TIF_SYSCALL_TRACE (1<