From nobody Thu Nov 28 16:54:40 2024 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C558819D07E for ; Tue, 1 Oct 2024 08:42:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727772148; cv=none; b=KMZsS/yGuCM07X/eRNvHfE4aVtBaztfi1DUKk08lnGyfFx13qngT8g6yDfVTc6/abFcbgyKNcp8oSBaP5v5HM6+8waOqNGlp9AANF50n6DUFRxtnutt1zKRyP9s6nR9TMNUFE9W6/qPihweifd1OcN2c6kVBnx6dbUNUJ3sPF7E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727772148; c=relaxed/simple; bh=Q+5fQp4CRLf1u9EedtTHivVyOa9GnzN5PjVJvF5qTRI=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=X5gxw03k26JdKfgzaqVF7ossDbHgzZ1f1cTxUCmsC/BBuVUNw2hIybyHotbQWP9X9ht6WymmvyTQwfOVSaxz4SHaFIoFctXBxEVqv/3vC0Q0t8/THVwGWiOJ4lQuEcIyYqvFQoyVHXtla/Y8uHLDT2XrDkUSqGC4P4D+OdP0HzY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=pSTPWEcL; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=CmqgI1dH; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="pSTPWEcL"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="CmqgI1dH" Message-ID: <20241001083836.337735372@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1727772145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=PbQIyx0qvrA9J8zJavAPM3ec78SoPgbfNXoubPfDKSw=; b=pSTPWEcL+ADwdAgMjB6f/1eTL95tkilgbmMaEunoaIvQvLZKEVemdviAo19eYrWDJOyvSC lOAeT4OnRiATFEdHvMpvXvefkDdkcdQYDDO7/cGCsoVlLMclOUUoSPASRIyIlu8X6z4nqX yaaT47oOe88IlulqmlSHaEGBCiSQGMF/s+uoHn/HE4uKpbwNbXfsq9L39GlBTVVdeWG2EI 3cNbDlsFnIv/Q8ble8yqBvT2Pk+oI0f9nvciDiczDJp/USt1M/A4++FHyUanIn0/wRimrX dV7z0Ut8Jmm3yT+GW5sDhv+DMkdDU90RnLP93xOVpfHLwtE1ZQY4oaOpATiqOA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1727772145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=PbQIyx0qvrA9J8zJavAPM3ec78SoPgbfNXoubPfDKSw=; b=CmqgI1dHS6I/a9u9YKr3li8HQSOh6xkZ1ck6654sGpl5P0O0YPszavZAXLqGnmx+BhiIZi 5kpsB1PSIe3mYqBQ== From: Thomas Gleixner To: LKML Cc: Anna-Maria Behnsen , Frederic Weisbecker , John Stultz , Peter Zijlstra , Ingo Molnar , Stephen Boyd , Eric Biederman , Oleg Nesterov Subject: [patch V5 18/26] signal: Cleanup unused posix-timer leftovers References: <20241001083138.922192481@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Tue, 1 Oct 2024 10:42:24 +0200 (CEST) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Thomas Gleixner Remove the leftovers of sigqueue preallocation as it's not longer used. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Reviewed-by: Frederic Weisbecker --- include/linux/sched/signal.h | 2 -- kernel/signal.c | 39 ++++----------------------------------- 2 files changed, 4 insertions(+), 37 deletions(-) --- --- a/include/linux/sched/signal.h +++ b/include/linux/sched/signal.h @@ -338,8 +338,6 @@ extern void force_fatal_sig(int); extern void force_exit_sig(int); extern int send_sig(int, struct task_struct *, int); extern int zap_other_threads(struct task_struct *p); -extern struct sigqueue *sigqueue_alloc(void); -extern void sigqueue_free(struct sigqueue *); extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); =20 static inline void clear_notify_signal(void) --- a/kernel/signal.c +++ b/kernel/signal.c @@ -439,8 +439,8 @@ static void __sigqueue_init(struct sigqu * - this may be called without locks if and only if t =3D=3D current, oth= erwise an * appropriate lock must be held to stop the target task from exiting */ -static struct sigqueue *__sigqueue_alloc(int sig, struct task_struct *t, g= fp_t gfp_flags, - int override_rlimit, const unsigned int sigqueue_flags) +static struct sigqueue *sigqueue_alloc(int sig, struct task_struct *t, gfp= _t gfp_flags, + int override_rlimit) { struct ucounts *ucounts =3D sig_get_ucounts(t, sig, override_rlimit); struct sigqueue *q; @@ -454,7 +454,7 @@ static struct sigqueue *__sigqueue_alloc return NULL; } =20 - __sigqueue_init(q, ucounts, sigqueue_flags); + __sigqueue_init(q, ucounts, 0); return q; } =20 @@ -1062,7 +1062,7 @@ static int __send_signal_locked(int sig, else override_rlimit =3D 0; =20 - q =3D __sigqueue_alloc(sig, t, GFP_ATOMIC, override_rlimit, 0); + q =3D sigqueue_alloc(sig, t, GFP_ATOMIC, override_rlimit); =20 if (q) { list_add_tail(&q->list, &pending->list); @@ -1918,37 +1918,6 @@ bool posixtimer_init_sigqueue(struct sig return true; } =20 -struct sigqueue *sigqueue_alloc(void) -{ - return __sigqueue_alloc(-1, current, GFP_KERNEL, 0, SIGQUEUE_PREALLOC); -} - -void sigqueue_free(struct sigqueue *q) -{ - spinlock_t *lock =3D ¤t->sighand->siglock; - unsigned long flags; - - if (WARN_ON_ONCE(!(q->flags & SIGQUEUE_PREALLOC))) - return; - /* - * We must hold ->siglock while testing q->list - * to serialize with collect_signal() or with - * __exit_signal()->flush_sigqueue(). - */ - spin_lock_irqsave(lock, flags); - q->flags &=3D ~SIGQUEUE_PREALLOC; - /* - * If it is queued it will be freed when dequeued, - * like the "regular" sigqueue. - */ - if (!list_empty(&q->list)) - q =3D NULL; - spin_unlock_irqrestore(lock, flags); - - if (q) - __sigqueue_free(q); -} - static void posixtimer_queue_sigqueue(struct sigqueue *q, struct task_stru= ct *t, enum pid_type type) { struct sigpending *pending;