From nobody Fri Dec 19 07:18:03 2025 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 633DA1E833B for ; Sat, 8 Mar 2025 16:48:29 +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=1741452510; cv=none; b=g0w9hHATBLYYAUugDb3e2Y6uI5nebwbMnqELNBk/ok7jnle65RucgOGOxdRujQt4RNpOT8LLsCHIlKWKlxAQnNFkGTYfwHc1bE4w2LZVeHvsKVsQX6Zt+3qXqdZIW9jHIFfvraYD2XQZ8Lfq1JvDpGb6sYpLTfxQM3HX1kPGJmE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741452510; c=relaxed/simple; bh=1CNbS8V5GNdwE2MUYNRQZQZrnyIdBIXF1/Rqlwc4JP8=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=Wsd95EKgbNsUQPwnhE2fBf8Hqgdqb5BGcKXUkC93RGjHd+gKqh/9GweiT5XXDYi7IjiuZfSEW935VlbvP81bJ6hkI1qj6LZGPnBloL0NX8qDHEW9sS/OE3qi4qVHq2lRPzMkADmP5mKgjKbR3lg9DRP3ZGuC75SQyH0l6dtU4yA= 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=nT5dcYVa; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=D463rrhM; 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="nT5dcYVa"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="D463rrhM" Message-ID: <20250308155623.829215801@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1741452507; 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=27HQMLTjuNSBvpM2M4GFmvhtGJQR57PqTAcp8ARZKmw=; b=nT5dcYVaQDkbMwfCDdBqE2/RZroJ2vFBnBB7aM3hi8EeXYyzZEFaxtUtN8Rl8OAoRflWlZ WCeJwGD4hcUBCXgWuZBfSg5Gn4b78qb1zj+ta8kxB4eWBnhAYudi+4rMk5FiaKDj2MVbI+ pqutsPn2QHo5hOp+ItR4d5EwW/pXi7PrU03T3BdDYHJQCGU2AK2U5jk6P8CZkRHssh03Dw Shz7Qt1bqTiGk2mnVUBaUnDfVBAPYwcvspaDRQpkJ5TdHkolxT9I6vpYQCsV/baPOlQ4Rg gRaFL/Mjs4+QdwwmMPoYkIow/tAHWv0s5ylh5TDPLG214vocQJMW+/uaF5hUbQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1741452507; 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=27HQMLTjuNSBvpM2M4GFmvhtGJQR57PqTAcp8ARZKmw=; b=D463rrhMp/m32S+2lppElbQJ/KUgBknsUkczkjREpci+3hu+cZPAE4V1ga3pCGhuLvPDKm UKPoe19G0Fb/6yDw== From: Thomas Gleixner To: LKML Cc: Anna-Maria Behnsen , Frederic Weisbecker , Benjamin Segall , Eric Dumazet , Andrey Vagin , Pavel Tikhomirov , Peter Zijlstra , Cyrill Gorcunov Subject: [patch V3 06/18] posix-timers: Remove SLAB_PANIC from kmem cache References: <20250308155501.391430556@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Sat, 8 Mar 2025 17:48:26 +0100 (CET) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There is no need to panic when the posix-timer kmem_cache can't be created. timer_create() will fail with -ENOMEM and that's it. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker --- V2: New patch --- kernel/time/posix-timers.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -243,9 +243,8 @@ static int posix_get_hrtimer_res(clockid =20 static __init int init_posix_timers(void) { - posix_timers_cache =3D kmem_cache_create("posix_timers_cache", - sizeof(struct k_itimer), 0, - SLAB_PANIC | SLAB_ACCOUNT, NULL); + posix_timers_cache =3D kmem_cache_create("posix_timers_cache", sizeof(str= uct k_itimer), 0, + SLAB_ACCOUNT, NULL); return 0; } __initcall(init_posix_timers); @@ -371,8 +370,12 @@ static struct pid *good_sigevent(sigeven =20 static struct k_itimer *alloc_posix_timer(void) { - struct k_itimer *tmr =3D kmem_cache_zalloc(posix_timers_cache, GFP_KERNEL= ); + struct k_itimer *tmr; =20 + if (unlikely(!posix_timers_cache)) + return NULL; + + tmr =3D kmem_cache_zalloc(posix_timers_cache, GFP_KERNEL); if (!tmr) return tmr;