Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp487466lqp; Mon, 10 Jun 2024 09:51:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVaLflMjUZzaYdYWHD1VJxp1NaBmxBWkumWA1jfNXCFLrNFqivztDXYiq5XY7t3Lx7PTLREjwyzYcESLbCkhTLD3VTOlzBc5NarAFyCEw== X-Google-Smtp-Source: AGHT+IHUflLI+GOY4h/YeOhIuEbQNpluz+9dJ8ZKDIXpyfaICBs2IaNDtl3bHxr8qOBTJzhAu4TK X-Received: by 2002:a67:c983:0:b0:48b:bd0e:bd65 with SMTP id ada2fe7eead31-48c275684c4mr8283421137.5.1718038317244; Mon, 10 Jun 2024 09:51:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718038317; cv=pass; d=google.com; s=arc-20160816; b=c1nBHlAdrxmj6oU3J8swagXzOsWiHNgZuiG8cxc3zY1XaNkV7TfBeJdwriLZc014Zc f3hk/SySQ3kBRfHlQgPJ/zZ6lyoVZBJu3FrRRxvj48vQxcuFOOIHWcy+E4LGJOT9qzsQ +kcflobBjwIofk/JAvPYo9VHQnCb08N6jlGr+YkXzLI/CHi+UbS77pLPrGOuu21ZiSeZ AmgHXDihkTUqft97Z6IsGBFxBCc7jjm2LPfQu6BncymvDYm0IlA7erelcfKfbmTsOc2V gQ3xZEAcAFEkhK3lu5RT2qpBFoYfnCUr6/mBvjccc2fmkUVLovSJ/dY4TtANYEa/2Wyu aXgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:subject:cc:to:from:dkim-signature :dkim-signature:message-id; bh=DxPffv+7izSrJC7n0/k0QCEO3R4CfssBq8UJE3DdsrY=; fh=joBs/8L+orz77ylyCy6wqNwwi35f7sYhLR+/TQjQjhI=; b=FG5I+iqzNn+6kfReOrTw62Sn+6WoJujlNaGZoSu3BKuWU24O0Su8eFltaBJ/8e35q3 7jfKKjxD+vBMIR1yuUlS6DF92yS1CTbfBFDz4xjEVXgOjWEWXhhywhRSimxXFco2PfSM 1PEspuTAD6wuy+uQAvWwhNxi3DLFR9Q7hR0oRVDDuLts1R4wkvXYaf+O5le4fgy38FY0 EIeeDElFmLM8QeJEOE8bNAwFQOz3iVdmfc3JuYJtFPVA+YvRYfm22tNO0SX9dMlbvYnZ bJDlJsvENC5THn7a78rn0sx0+h2aBLvt0TO0xxU/vdKPQRcZ1EETxhTOOVjU5Z6ZWHdC QUPg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=voPagU8F; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-208607-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208607-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ada2fe7eead31-48c521b9c2fsi845918137.194.2024.06.10.09.51.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 09:51:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208607-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=voPagU8F; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-208607-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208607-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EF21A1C22B53 for ; Mon, 10 Jun 2024 16:51:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F341C158A3E; Mon, 10 Jun 2024 16:43:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="voPagU8F"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="5E1Hqcc8" 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 726D7158A12 for ; Mon, 10 Jun 2024 16:43:01 +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=1718037783; cv=none; b=MGm2cWX0TJzUDElUa7KuSCCovvHNXSjSNYbyPHEV8odUHJUVT5QHKxSI/Lsvh5+tVKp8xIL79iSP0dlIeZ3fPzPlQ8pesLsFxryAUJJKBg9KWzsNYHct0Qs1MyYSH0UJX2v5bL3esmNbMcSsdg9yNtxocyr5jkp0R3jCWdHq3nA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718037783; c=relaxed/simple; bh=NFKqTJ9ShtyiYAgy+AdG3Zbk7Do+0qFmxaGilWT4BiI=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=uWlQkormI1HKxbeddJnVQj/GPjS9RtlzwYO4qyyz+WhILfqwA6oCcumr1XrH/Wo+4DESYcyxFyq/6xl51qHetkcKsMBsXoVnPJjmxKrGtl2Q2JKzss6Jjkm4Fp2p4LcsqYsfxKGW5oBz70PVGtIkzdOOrq8qCl6sYl+yhDpN3Uo= 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=voPagU8F; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=5E1Hqcc8; 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 Message-ID: <20240610164028.169579977@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718037778; 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=DxPffv+7izSrJC7n0/k0QCEO3R4CfssBq8UJE3DdsrY=; b=voPagU8F8COwMmHGGbN47wMmLuNp3TGobV8Q/TvLQfTegQJOIYXQZHPf70wDvCQssoXQb3 53BHytOlkAOrTR4aC0KJ50vq7s0oj/nusykd4Ez5NCavFdkCxTrqck9rkSgyCKVli64p1b OiUf/cl+3lUoB24K3i4RUnpT9XF6bCeV5lDiMEet/a+n1vDpu4CJKo3OCRwccQXMJE+0Qw egltKzwncibCRj16XbiPvQtheSKdDndMXO7M1UspaKPX/J1Pkp4judFXaRSO5ZJp638UF4 oLWZCAithOJfEajm4ka1Gl5PJqFzZqpEN9FRAFmqXjlz41hI7mz6aXpOvLNq7A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718037778; 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=DxPffv+7izSrJC7n0/k0QCEO3R4CfssBq8UJE3DdsrY=; b=5E1Hqcc848gkJMcSKbyp1r1LM0UryDIT3Gksyc19ZVf9t8BDL4DRKTzky1UH3p8jzAHR+S 6xzVJWeabZ/p/4Dg== 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 V3 43/51] signal: Cleanup unused posix-timer leftovers References: <20240610163452.591699700@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Mon, 10 Jun 2024 18:42:58 +0200 (CEST) Remove the leftovers of sigqueue preallocation as it's not longer used. Signed-off-by: Thomas Gleixner --- include/linux/sched/signal.h | 2 -- kernel/signal.c | 43 +++++++------------------------------------ 2 files changed, 7 insertions(+), 38 deletions(-) --- a/include/linux/sched/signal.h +++ b/include/linux/sched/signal.h @@ -337,8 +337,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 *); 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 == current, otherwise an * appropriate lock must be held to stop the target task from exiting */ -static struct sigqueue *__sigqueue_alloc(int sig, struct task_struct *t, gfp_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 = sig_get_ucounts(t, sig, override_rlimit); struct sigqueue *q; @@ -454,14 +454,16 @@ static struct sigqueue *__sigqueue_alloc return NULL; } - __sigqueue_init(q, ucounts, sigqueue_flags); + __sigqueue_init(q, ucounts, 0); return q; } static void __sigqueue_free(struct sigqueue *q) { - if (q->flags & SIGQUEUE_PREALLOC) + if (q->flags & SIGQUEUE_PREALLOC) { + posixtimer_sigqueue_putref(q); return; + } if (q->ucounts) { dec_rlimit_put_ucounts(q->ucounts, UCOUNT_RLIMIT_SIGPENDING); q->ucounts = NULL; @@ -1065,7 +1067,7 @@ static int __send_signal_locked(int sig, else override_rlimit = 0; - q = __sigqueue_alloc(sig, t, GFP_ATOMIC, override_rlimit, 0); + q = sigqueue_alloc(sig, t, GFP_ATOMIC, override_rlimit); if (q) { list_add_tail(&q->list, &pending->list); @@ -1925,37 +1927,6 @@ bool posixtimer_init_sigqueue(struct sig return true; } -struct sigqueue *sigqueue_alloc(void) -{ - return __sigqueue_alloc(-1, current, GFP_KERNEL, 0, SIGQUEUE_PREALLOC); -} - -void sigqueue_free(struct sigqueue *q) -{ - spinlock_t *lock = ¤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 &= ~SIGQUEUE_PREALLOC; - /* - * If it is queued it will be freed when dequeued, - * like the "regular" sigqueue. - */ - if (!list_empty(&q->list)) - q = NULL; - spin_unlock_irqrestore(lock, flags); - - if (q) - __sigqueue_free(q); -} - static void posixtimer_queue_sigqueue(struct sigqueue *q, struct task_struct *t, enum pid_type type) { struct sigpending *pending;