Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp423515lqt; Thu, 18 Apr 2024 22:43:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUA8UmVXrW3MOYIga0xb37jIoRre0ENmll02gi5AlS+B1Ct3wxHq1E7qGx2oh4MfnhmS4d2H1/4EdFeK9qV1SGcYWExbmD5RXSYX+fpyA== X-Google-Smtp-Source: AGHT+IHSE34cSiy1hgg0lLN52NQ5S1BNFvkCgSErrt7ccsjR22pPG1pK9MbL2sJPSPoSvzc56mxQ X-Received: by 2002:a0c:fca3:0:b0:69c:9d6c:7762 with SMTP id h3-20020a0cfca3000000b0069c9d6c7762mr986997qvq.50.1713505398910; Thu, 18 Apr 2024 22:43:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713505398; cv=pass; d=google.com; s=arc-20160816; b=kPOUJtw9tpIdgCG5G7CJKcrMm1jOt5AFaVcsVQ3J2I3pN15lz60Tic07FX5PoDIhOk exWl1I8WzRJjbiFT0GVeyzcOlXPDdVQSGWcKuSE26/Wl9/FECdHGpZZM7IuASEv/SwPX KyBfFN5uu0blLRzAdkmVZeAGugCM7tDjgf/tge/wpSqUFKA8cmArhpduKtvOnwwOwq2A dbnVG6kwbjUYyZq4xmYpgxOSu9bJXuMsc+n63y8P6szfHnIDAaEUOwsqYTeyNyNjVEo4 l1mdHg9lul1eVv+nDViCkE/dmMCm4BuaTb5U9Dx1FZ4GQEj10roCBDYPP1fJ3bP2NxmJ lRkw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=pwFc3HvBM5e/MYXVzEFc0WpXcC13ZpOh67R7PvfUxA8=; fh=epvCRGv6dMwMNDK+CSwGxrFsIJI8TCx+sIjv5W0YEAQ=; b=Fu0WdJx+8NJtjm2+e0STuUBViwasRYuJkFNklwuC0QyrIsi+Bx9IdY2qyJJxxU0Lpu jQQVc+/ZHvuvRC3C10YoipsdAT8VbfCwZqBgfjbbzia0+OpzxmIRVbdvtiKfKXcdchw3 AyyTnfwXyUZG0fwASKTnV4N/tjsMmTryIo96fsv2L7+kV1V2xGy4/9SkcqT1/E4oS9A7 kgWl0Y9YPQ4CBj+TMKScMhv/8JMa7vGoOKpiE07BxdP6l7YjrMBGbfzRbakMgW0Xnz9I LfIH88kzvZGOpGER3WmsdWYkEpjOS688xc7h+DMwWwD8Ay74qofshAN1ludd7jdmjX6D KPNg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="abS/lIn3"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=qlC2QhgH; 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-151020-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151020-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. [147.75.199.223]) by mx.google.com with ESMTPS id 15-20020ad45b8f000000b006a0412ec035si3090178qvp.518.2024.04.18.22.43.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 22:43:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151020-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="abS/lIn3"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=qlC2QhgH; 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-151020-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151020-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 9E0991C2118D for ; Fri, 19 Apr 2024 05:43:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5370BE49; Fri, 19 Apr 2024 05:43:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="abS/lIn3"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qlC2QhgH" 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 D0CCE8F62 for ; Fri, 19 Apr 2024 05:43:10 +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=1713505392; cv=none; b=tWcpHS1V8Fedm/2vO+SRmHmRBzVMwR/C8kYL2fgX0VQoZA3ljC3qjECGqswImcvafWg/Ei3NzDAbkznhwk13g22JsoOSiVChacyaEMpHbvlbyUDyxJV8Vua+ifZAHDGOTdW8nHPpnYomi0gKWN7UnMPYm01A44wcmpXP/J3Ssz4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713505392; c=relaxed/simple; bh=3Tmksko475RAPQHDprAZ87gMkRH6qpfx8ZmKwXxLaB8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=NF0dTXyZ6RH3V7f6+wvCjMSqI3lbOF9uB9o3jTKeMkaqEErt6h1CAXVNJ1dNPTO6NIZadxXnp4f3sec/AfvM7ZrCqmevVHa7IueUiFYpMKBMxPwSMowWWZCO8f2S/0C4TcgNoXSs+NRuqp3pdZsTN3fjXpZ5acEaBECV9ZfKGIA= 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=abS/lIn3; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qlC2QhgH; 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 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1713505389; 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: in-reply-to:in-reply-to:references:references; bh=pwFc3HvBM5e/MYXVzEFc0WpXcC13ZpOh67R7PvfUxA8=; b=abS/lIn3NuwPMUIYrOOoR8xQk4yeRNj20Re+hclc+swlaZgCtoYODOPoPunLqfwaVz3Gz2 tnVmOtDiBFL9tyeOWeYlEnJ+08pqVkz4xBGj/oy614ncxNkDaRcf+2cEKefklRHFgOOKRC s6oal7JmmtdyHEIxgm+oFG/nT1Pf5f50wERam/8a6bGtiqXZxkCFoxL9hLgb1qWXVpgCqZ GGwInb1IQIzpASRFK9Tdvhbp6hGKEYNb6w7MyDoHUU9+tNyN/7jcCD7vTTHmN/T4jB1Gek +o8sh3JKuly7/EM0l3VI27WZodhwxjWaAc6jNW6/TiEMTZBc0VlmU7BDjvXTLQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1713505389; 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: in-reply-to:in-reply-to:references:references; bh=pwFc3HvBM5e/MYXVzEFc0WpXcC13ZpOh67R7PvfUxA8=; b=qlC2QhgHw1VLNn3OF8UtVzH2xMDav2VyYtTG/2Wiv7VTn/nOjcdSwVUTf/yb9xjR4Yhhpa tbyqg5Vesx9KMBDA== To: Oleg Nesterov Cc: LKML , Anna-Maria Behnsen , Frederic Weisbecker , John Stultz , Peter Zijlstra , Ingo Molnar , Stephen Boyd , Eric Biederman Subject: Re: [patch V2 25/50] signal: Confine POSIX_TIMERS properly In-Reply-To: <20240418152308.GA20625@redhat.com> References: <20240410164558.316665885@linutronix.de> <20240410165552.509700441@linutronix.de> <20240418152308.GA20625@redhat.com> Date: Fri, 19 Apr 2024 07:42:52 +0200 Message-ID: <87v84dx603.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Thu, Apr 18 2024 at 17:23, Oleg Nesterov wrote: > On 04/11, Thomas Gleixner wrote: >> +static inline void posixtimer_rearm_itimer(struct task_struct *p) { } >> +static inline void posixtimer_rearm(struct kernel_siginfo *info) { } > > Do we really need these 2 nops ? please see below. >> + if (unlikely(signr == SIGALRM)) >> + posixtimer_rearm_itimer(tsk); > > ... > >> + if (IS_ENABLED(CONFIG_POSIX_TIMERS)) { >> + if (unlikely(resched_timer)) >> + posixtimer_rearm(info); >> } > > This looks a bit inconsistent to me. > > Can't we change the callsite of posixtimer_rearm_itimer() to check > IS_ENABLED(CONFIG_POSIX_TIMERS) too, > > if (IS_ENABLED(CONFIG_POSIX_TIMERS)) { > if (unlikely(signr == SIGALRM)) > posixtimer_rearm_itimer(tsk); > } > ? > > This will make the code more symmetrical, and we can avoid the dumb > definitions of posixtimer_rearm_itimer/posixtimer_rearm. Yes, we just need to expose the actual function prototypes unconditionally. Let me fix that. Thanks, tglx