Skip to content

Commit 7dd5ad2

Browse files
committed
Revert "signal, x86: Delay calling signals in atomic on RT enabled kernels"
Revert commit bf9ad37. It needs to be better encapsulated and generalized. Signed-off-by: Thomas Gleixner <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Sebastian Andrzej Siewior <[email protected]>
1 parent 787af64 commit 7dd5ad2

File tree

5 files changed

+1
-69
lines changed

5 files changed

+1
-69
lines changed

arch/x86/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ config X86
122122
select ARCH_WANT_GENERAL_HUGETLB
123123
select ARCH_WANT_HUGE_PMD_SHARE
124124
select ARCH_WANT_LD_ORPHAN_WARN
125-
select ARCH_WANTS_RT_DELAYED_SIGNALS
126125
select ARCH_WANTS_THP_SWAP if X86_64
127126
select ARCH_HAS_PARANOID_L1D_FLUSH
128127
select BUILDTIME_TABLE_SORT

include/linux/sched.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,9 +1090,6 @@ struct task_struct {
10901090
/* Restored if set_restore_sigmask() was used: */
10911091
sigset_t saved_sigmask;
10921092
struct sigpending pending;
1093-
#ifdef CONFIG_RT_DELAYED_SIGNALS
1094-
struct kernel_siginfo forced_info;
1095-
#endif
10961093
unsigned long sas_ss_sp;
10971094
size_t sas_ss_size;
10981095
unsigned int sas_ss_flags;

kernel/Kconfig.preempt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,4 @@ config SCHED_CORE
133133
which is the likely usage by Linux distributions, there should
134134
be no measurable impact on performance.
135135

136-
config ARCH_WANTS_RT_DELAYED_SIGNALS
137-
bool
138-
help
139-
This option is selected by architectures where raising signals
140-
can happen in atomic contexts on PREEMPT_RT enabled kernels. This
141-
option delays raising the signal until the return to user space
142-
loop where it is also delivered. X86 requires this to deliver
143-
signals from trap handlers which run on IST stacks.
144-
145-
config RT_DELAYED_SIGNALS
146-
def_bool PREEMPT_RT && ARCH_WANTS_RT_DELAYED_SIGNALS
136+

kernel/entry/common.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,6 @@ void noinstr exit_to_user_mode(void)
142142
/* Workaround to allow gradual conversion of architecture code */
143143
void __weak arch_do_signal_or_restart(struct pt_regs *regs) { }
144144

145-
#ifdef CONFIG_RT_DELAYED_SIGNALS
146-
static inline void raise_delayed_signal(void)
147-
{
148-
if (unlikely(current->forced_info.si_signo)) {
149-
force_sig_info(&current->forced_info);
150-
current->forced_info.si_signo = 0;
151-
}
152-
}
153-
#else
154-
static inline void raise_delayed_signal(void) { }
155-
#endif
156-
157145
static unsigned long exit_to_user_mode_loop(struct pt_regs *regs,
158146
unsigned long ti_work)
159147
{
@@ -168,8 +156,6 @@ static unsigned long exit_to_user_mode_loop(struct pt_regs *regs,
168156
if (ti_work & _TIF_NEED_RESCHED)
169157
schedule();
170158

171-
raise_delayed_signal();
172-
173159
if (ti_work & _TIF_UPROBE)
174160
uprobe_notify_resume(regs);
175161

kernel/signal.c

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,43 +1307,6 @@ enum sig_handler {
13071307
HANDLER_EXIT, /* Only visible as the process exit code */
13081308
};
13091309

1310-
/*
1311-
* On some archictectures, PREEMPT_RT has to delay sending a signal from a
1312-
* trap since it cannot enable preemption, and the signal code's
1313-
* spin_locks turn into mutexes. Instead, it must set TIF_NOTIFY_RESUME
1314-
* which will send the signal on exit of the trap.
1315-
*/
1316-
#ifdef CONFIG_RT_DELAYED_SIGNALS
1317-
static inline bool force_sig_delayed(struct kernel_siginfo *info,
1318-
struct task_struct *t)
1319-
{
1320-
if (!in_atomic())
1321-
return false;
1322-
1323-
if (WARN_ON_ONCE(t->forced_info.si_signo))
1324-
return true;
1325-
1326-
if (is_si_special(info)) {
1327-
WARN_ON_ONCE(info != SEND_SIG_PRIV);
1328-
t->forced_info.si_signo = info->si_signo;
1329-
t->forced_info.si_errno = 0;
1330-
t->forced_info.si_code = SI_KERNEL;
1331-
t->forced_info.si_pid = 0;
1332-
t->forced_info.si_uid = 0;
1333-
} else {
1334-
t->forced_info = *info;
1335-
}
1336-
set_tsk_thread_flag(t, TIF_NOTIFY_RESUME);
1337-
return true;
1338-
}
1339-
#else
1340-
static inline bool force_sig_delayed(struct kernel_siginfo *info,
1341-
struct task_struct *t)
1342-
{
1343-
return false;
1344-
}
1345-
#endif
1346-
13471310
/*
13481311
* Force a signal that the process can't ignore: if necessary
13491312
* we unblock the signal and change any SIG_IGN to SIG_DFL.
@@ -1364,9 +1327,6 @@ force_sig_info_to_task(struct kernel_siginfo *info, struct task_struct *t,
13641327
struct k_sigaction *action;
13651328
int sig = info->si_signo;
13661329

1367-
if (force_sig_delayed(info, t))
1368-
return 0;
1369-
13701330
spin_lock_irqsave(&t->sighand->siglock, flags);
13711331
action = &t->sighand->action[sig-1];
13721332
ignored = action->sa.sa_handler == SIG_IGN;

0 commit comments

Comments
 (0)