Skip to content

Commit 5aa92ff

Browse files
Petr Tesarikaegl
authored andcommitted
[IA64] Rename TIF_PERFMON_WORK back to TIF_NOTIFY_RESUME
Since the RSE synchronization will need a TIF_ flag, but all work-to-be-done bits are already used, so we have to multiplex TIF_NOTIFY_RESUME again. Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Petr Tesarik <ptesarik@suse.cz> Signed-off-by: Tony Luck <tony.luck@intel.com>
1 parent ad9e39c commit 5aa92ff

3 files changed

Lines changed: 18 additions & 21 deletions

File tree

‎arch/ia64/kernel/perfmon.c‎

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -585,21 +585,6 @@ pfm_put_task(struct task_struct *task)
585585
if (task != current) put_task_struct(task);
586586
}
587587

588-
static inline void
589-
pfm_set_task_notify(struct task_struct *task)
590-
{
591-
struct thread_info *info;
592-
593-
info = (struct thread_info *) ((char *) task + IA64_TASK_SIZE);
594-
set_bit(TIF_PERFMON_WORK, &info->flags);
595-
}
596-
597-
static inline void
598-
pfm_clear_task_notify(void)
599-
{
600-
clear_thread_flag(TIF_PERFMON_WORK);
601-
}
602-
603588
static inline void
604589
pfm_reserve_page(unsigned long a)
605590
{
@@ -3724,7 +3709,7 @@ pfm_restart(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
37243709

37253710
PFM_SET_WORK_PENDING(task, 1);
37263711

3727-
pfm_set_task_notify(task);
3712+
tsk_set_notify_resume(task);
37283713

37293714
/*
37303715
* XXX: send reschedule if task runs on another CPU
@@ -5082,7 +5067,7 @@ pfm_handle_work(void)
50825067

50835068
PFM_SET_WORK_PENDING(current, 0);
50845069

5085-
pfm_clear_task_notify();
5070+
tsk_clear_notify_resume(current);
50865071

50875072
regs = task_pt_regs(current);
50885073

@@ -5450,7 +5435,7 @@ pfm_overflow_handler(struct task_struct *task, pfm_context_t *ctx, u64 pmc0, str
54505435
* when coming from ctxsw, current still points to the
54515436
* previous task, therefore we must work with task and not current.
54525437
*/
5453-
pfm_set_task_notify(task);
5438+
tsk_set_notify_resume(task);
54545439
}
54555440
/*
54565441
* defer until state is changed (shorten spin window). the context is locked

‎arch/ia64/kernel/process.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ show_regs (struct pt_regs *regs)
157157
show_stack(NULL, NULL);
158158
}
159159

160+
void tsk_clear_notify_resume(struct task_struct *tsk)
161+
{
162+
#ifdef CONFIG_PERFMON
163+
if (tsk->thread.pfm_needs_checking)
164+
return;
165+
#endif
166+
clear_ti_thread_flag(task_thread_info(tsk), TIF_NOTIFY_RESUME);
167+
}
168+
160169
void
161170
do_notify_resume_user (sigset_t *unused, struct sigscratch *scr, long in_syscall)
162171
{

‎include/asm-ia64/thread_info.h‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ struct thread_info {
7171
#define alloc_task_struct() ((struct task_struct *)__get_free_pages(GFP_KERNEL | __GFP_COMP, KERNEL_STACK_SIZE_ORDER))
7272
#define free_task_struct(tsk) free_pages((unsigned long) (tsk), KERNEL_STACK_SIZE_ORDER)
7373

74+
#define tsk_set_notify_resume(tsk) \
75+
set_ti_thread_flag(task_thread_info(tsk), TIF_NOTIFY_RESUME)
76+
extern void tsk_clear_notify_resume(struct task_struct *tsk);
7477
#endif /* !__ASSEMBLY */
7578

7679
/*
@@ -85,7 +88,7 @@ struct thread_info {
8588
#define TIF_SYSCALL_AUDIT 3 /* syscall auditing active */
8689
#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */
8790
#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
88-
#define TIF_PERFMON_WORK 6 /* work for pfm_handle_work() */
91+
#define TIF_NOTIFY_RESUME 6 /* resumption notification requested */
8992
#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
9093
#define TIF_MEMDIE 17
9194
#define TIF_MCA_INIT 18 /* this task is processing MCA or INIT */
@@ -97,7 +100,7 @@ struct thread_info {
97100
#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)
98101
#define _TIF_SYSCALL_TRACEAUDIT (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)
99102
#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
100-
#define _TIF_PERFMON_WORK (1 << TIF_PERFMON_WORK)
103+
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
101104
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
102105
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
103106
#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
@@ -106,7 +109,7 @@ struct thread_info {
106109
#define _TIF_FREEZE (1 << TIF_FREEZE)
107110

108111
/* "work to do on user-return" bits */
109-
#define TIF_ALLWORK_MASK (_TIF_SIGPENDING|_TIF_PERFMON_WORK|_TIF_SYSCALL_AUDIT|\
112+
#define TIF_ALLWORK_MASK (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SYSCALL_AUDIT|\
110113
_TIF_NEED_RESCHED| _TIF_SYSCALL_TRACE|\
111114
_TIF_RESTORE_SIGMASK)
112115
/* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */

0 commit comments

Comments
 (0)