From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A15ADC00144 for ; Mon, 1 Aug 2022 12:52:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233222AbiHAMwR (ORCPT ); Mon, 1 Aug 2022 08:52:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235119AbiHAMvv (ORCPT ); Mon, 1 Aug 2022 08:51:51 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 039972E9ED for ; Mon, 1 Aug 2022 05:46:38 -0700 (PDT) Date: Mon, 1 Aug 2022 14:46:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1659357996; 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=Axnk2F+6LBHUQxdComROfBL2Iw/LZzYHPtdiCi0kCF0=; b=I9qt9ha4hA+DF/6ydb+2lOxE5kiYKegAvfg8DPv/Gd5ey3Q5zirho+xPxl11GgZAA2zN8v E1YDRNqWy6Vw0Bo5+q3KKPPWZwpohbBjsB4xBLDtHYga7AmmRNl7QQq5tJpuyr0KbgVIge /iNNDGSTqG0XMlYXDZqNw7yBRe/dumurlTABsC/VKOr24SHhclF5PRjOy3VGoIQRIJtYN6 w4r3Q336dSyzmS4LpBy2aZ0sCeFhY4n6NUYK092QAvcw81hvPADRKTYcNn2eIl35BewRE9 MxSjoT13QGktESoH7Heou4ndevVku/38zrltjFVVCIGgavW6HS2ZZ0we7ohMuw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1659357996; 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=Axnk2F+6LBHUQxdComROfBL2Iw/LZzYHPtdiCi0kCF0=; b=GMauYTtb2AD8hi3X6NpzXiDXMva7yk4lD/0+NO58WcHQAMCBkTXYWcLJEyy0Bczm+9gn6x iAf1W/KpGjoWDyBQ== From: Sebastian Andrzej Siewior To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, Andy Shevchenko , John Ogness , Mike Galbraith , Petr Mladek , Rasmus Villemoes , Sergey Senozhatsky , Steven Rostedt , Theodore Ts'o , Thomas Gleixner Subject: Re: [PATCH v4] lib/vsprintf: defer filling siphash key on RT Message-ID: References: <20220801123945.43081-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220801123945.43081-1-Jason@zx2c4.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-08-01 14:39:46 [+0200], Jason A. Donenfeld wrote: > On RT, we can't call get_random_bytes() from inside of the raw locks > that callers of vsprintf might take, because get_random_bytes() takes > normal spinlocks. So on those RT systems, defer the siphash key > generation to a worker. > > Also, avoid using a static_branch, as this isn't the fast path. > Using static_branch_likely() to signal that ptr_key has been filled is a > bit much given that it is not a fast path. > > Cc: Sebastian Andrzej Siewior > Reported-by: Mike Galbraith > Signed-off-by: Jason A. Donenfeld > --- > Sebastian - feel free to take this and tweak it as needed. Sending this > mostly as something illustrative of what the "simpler" thing would be > that I had in mind. -Jason Can have the same behaviour regardless of CONFIG_PREEMPT_RT? Here lockdep _may_ yell with !RT because it is broken for RT. If we agree that we drop the first %p print here, can we do this on both (regardless of CONFIG_PREEMPT_RT)? Sebastian