Skip to content

Commit c2a4796

Browse files
committed
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
1 parent 6017a15 commit c2a4796

2 files changed

Lines changed: 4 additions & 37 deletions

File tree

include/linux/sched/signal.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,6 @@ extern void force_fatal_sig(int);
338338
extern void force_exit_sig(int);
339339
extern int send_sig(int, struct task_struct *, int);
340340
extern int zap_other_threads(struct task_struct *p);
341-
extern struct sigqueue *sigqueue_alloc(void);
342-
extern void sigqueue_free(struct sigqueue *);
343341
extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *);
344342

345343
static inline void clear_notify_signal(void)

kernel/signal.c

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ static void __sigqueue_init(struct sigqueue *q, struct ucounts *ucounts,
439439
* - this may be called without locks if and only if t == current, otherwise an
440440
* appropriate lock must be held to stop the target task from exiting
441441
*/
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)
444444
{
445445
struct ucounts *ucounts = sig_get_ucounts(t, sig, override_rlimit);
446446
struct sigqueue *q;
@@ -454,7 +454,7 @@ static struct sigqueue *__sigqueue_alloc(int sig, struct task_struct *t, gfp_t g
454454
return NULL;
455455
}
456456

457-
__sigqueue_init(q, ucounts, sigqueue_flags);
457+
__sigqueue_init(q, ucounts, 0);
458458
return q;
459459
}
460460

@@ -1070,7 +1070,7 @@ static int __send_signal_locked(int sig, struct kernel_siginfo *info,
10701070
else
10711071
override_rlimit = 0;
10721072

1073-
q = __sigqueue_alloc(sig, t, GFP_ATOMIC, override_rlimit, 0);
1073+
q = sigqueue_alloc(sig, t, GFP_ATOMIC, override_rlimit);
10741074

10751075
if (q) {
10761076
list_add_tail(&q->list, &pending->list);
@@ -1926,37 +1926,6 @@ bool posixtimer_init_sigqueue(struct sigqueue *q)
19261926
return true;
19271927
}
19281928

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-
}
1959-
19601929
static void posixtimer_queue_sigqueue(struct sigqueue *q, struct task_struct *t, enum pid_type type)
19611930
{
19621931
struct sigpending *pending;

0 commit comments

Comments
 (0)