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.

signal: Cleanup unused posix-timer leftovers

Remove the leftovers of sigqueue preallocation as it's not longer used.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/all/20241105064213.786506636@linutronix.de

+4 -37
-2
include/linux/sched/signal.h
··· 338 338 extern void force_exit_sig(int); 339 339 extern int send_sig(int, struct task_struct *, int); 340 340 extern int zap_other_threads(struct task_struct *p); 341 - extern struct sigqueue *sigqueue_alloc(void); 342 - extern void sigqueue_free(struct sigqueue *); 343 341 extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); 344 342 345 343 static inline void clear_notify_signal(void)
+4 -35
kernel/signal.c
··· 439 439 * - this may be called without locks if and only if t == current, otherwise an 440 440 * appropriate lock must be held to stop the target task from exiting 441 441 */ 442 - static struct sigqueue *__sigqueue_alloc(int sig, struct task_struct *t, gfp_t gfp_flags, 443 - int override_rlimit, const unsigned int sigqueue_flags) 442 + static struct sigqueue *sigqueue_alloc(int sig, struct task_struct *t, gfp_t gfp_flags, 443 + int override_rlimit) 444 444 { 445 445 struct ucounts *ucounts = sig_get_ucounts(t, sig, override_rlimit); 446 446 struct sigqueue *q; ··· 454 454 return NULL; 455 455 } 456 456 457 - __sigqueue_init(q, ucounts, sigqueue_flags); 457 + __sigqueue_init(q, ucounts, 0); 458 458 return q; 459 459 } 460 460 ··· 1070 1070 else 1071 1071 override_rlimit = 0; 1072 1072 1073 - q = __sigqueue_alloc(sig, t, GFP_ATOMIC, override_rlimit, 0); 1073 + q = sigqueue_alloc(sig, t, GFP_ATOMIC, override_rlimit); 1074 1074 1075 1075 if (q) { 1076 1076 list_add_tail(&q->list, &pending->list); ··· 1924 1924 clear_siginfo(&q->info); 1925 1925 __sigqueue_init(q, ucounts, SIGQUEUE_PREALLOC); 1926 1926 return true; 1927 - } 1928 - 1929 - struct sigqueue *sigqueue_alloc(void) 1930 - { 1931 - return __sigqueue_alloc(-1, current, GFP_KERNEL, 0, SIGQUEUE_PREALLOC); 1932 - } 1933 - 1934 - void sigqueue_free(struct sigqueue *q) 1935 - { 1936 - spinlock_t *lock = &current->sighand->siglock; 1937 - unsigned long flags; 1938 - 1939 - if (WARN_ON_ONCE(!(q->flags & SIGQUEUE_PREALLOC))) 1940 - return; 1941 - /* 1942 - * We must hold ->siglock while testing q->list 1943 - * to serialize with collect_signal() or with 1944 - * __exit_signal()->flush_sigqueue(). 1945 - */ 1946 - spin_lock_irqsave(lock, flags); 1947 - q->flags &= ~SIGQUEUE_PREALLOC; 1948 - /* 1949 - * If it is queued it will be freed when dequeued, 1950 - * like the "regular" sigqueue. 1951 - */ 1952 - if (!list_empty(&q->list)) 1953 - q = NULL; 1954 - spin_unlock_irqrestore(lock, flags); 1955 - 1956 - if (q) 1957 - __sigqueue_free(q); 1958 1927 } 1959 1928 1960 1929 static void posixtimer_queue_sigqueue(struct sigqueue *q, struct task_struct *t, enum pid_type type)