Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'core-urgent-2022-04-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull RT signal fix from Thomas Gleixner:
"Revert the RT related signal changes. They need to be reworked and
generalized"

* tag 'core-urgent-2022-04-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
Revert "signal, x86: Delay calling signals in atomic on RT enabled kernels"

-68
-1
arch/x86/Kconfig
··· 122 122 select ARCH_WANT_GENERAL_HUGETLB 123 123 select ARCH_WANT_HUGE_PMD_SHARE 124 124 select ARCH_WANT_LD_ORPHAN_WARN 125 - select ARCH_WANTS_RT_DELAYED_SIGNALS 126 125 select ARCH_WANTS_THP_SWAP if X86_64 127 126 select ARCH_HAS_PARANOID_L1D_FLUSH 128 127 select BUILDTIME_TABLE_SORT
-3
include/linux/sched.h
··· 1090 1090 /* Restored if set_restore_sigmask() was used: */ 1091 1091 sigset_t saved_sigmask; 1092 1092 struct sigpending pending; 1093 - #ifdef CONFIG_RT_DELAYED_SIGNALS 1094 - struct kernel_siginfo forced_info; 1095 - #endif 1096 1093 unsigned long sas_ss_sp; 1097 1094 size_t sas_ss_size; 1098 1095 unsigned int sas_ss_flags;
-10
kernel/Kconfig.preempt
··· 133 133 which is the likely usage by Linux distributions, there should 134 134 be no measurable impact on performance. 135 135 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 136 145 - config RT_DELAYED_SIGNALS 146 - def_bool PREEMPT_RT && ARCH_WANTS_RT_DELAYED_SIGNALS
-14
kernel/entry/common.c
··· 142 142 /* Workaround to allow gradual conversion of architecture code */ 143 143 void __weak arch_do_signal_or_restart(struct pt_regs *regs) { } 144 144 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 - 157 145 static unsigned long exit_to_user_mode_loop(struct pt_regs *regs, 158 146 unsigned long ti_work) 159 147 { ··· 155 167 156 168 if (ti_work & _TIF_NEED_RESCHED) 157 169 schedule(); 158 - 159 - raise_delayed_signal(); 160 170 161 171 if (ti_work & _TIF_UPROBE) 162 172 uprobe_notify_resume(regs);
-40
kernel/signal.c
··· 1308 1308 }; 1309 1309 1310 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 - 1347 - /* 1348 1311 * Force a signal that the process can't ignore: if necessary 1349 1312 * we unblock the signal and change any SIG_IGN to SIG_DFL. 1350 1313 * ··· 1326 1363 int ret, blocked, ignored; 1327 1364 struct k_sigaction *action; 1328 1365 int sig = info->si_signo; 1329 - 1330 - if (force_sig_delayed(info, t)) 1331 - return 0; 1332 1366 1333 1367 spin_lock_irqsave(&t->sighand->siglock, flags); 1334 1368 action = &t->sighand->action[sig-1];