Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2154411pxb; Sun, 30 Jan 2022 06:49:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQq7eTNKTDIIt82TMz8G4j3cLV6EnvEYo0/70nDKLDkO3UXIbU8sIhBUr7XZm17Tbkx929 X-Received: by 2002:a17:907:3e9b:: with SMTP id hs27mr14293810ejc.72.1643554145001; Sun, 30 Jan 2022 06:49:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643554144; cv=none; d=google.com; s=arc-20160816; b=BV62EnpVmNMeWll4Md8H5ImCYHc8CiNbqWC2EHSKiF3zCvxX/6cdpuTpOXaCtI4DfO T+3omwqP+D0v9Chfg8nKjMxWPpfx5Ae+oc70aznvHtVf3dlahlfZWwsgtLKUMq5Qv+jm VzZWP4zkgf+I30yJuyJfwQWZvi4xOvVj8JYvlojoX8zn94gTEggYVHS/LntzlaGPcb4n hcPXAiJdfR7hnLcOXaHHX+11KJHVFINX4pKXyIohfhregcF8sLfPxpptYcchdlpor5K1 gMvBulT4tGUU8gKK0EXMsdJxaO3qQcUQ8uqC9gIj2A0EuCTXUDzf4Q6DHOntmzh4OMY5 QtsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature :dkim-signature:date; bh=Mznfj1fiPKTxFf7vYfwMEGCtvJ9wyttqXLSgdsx8nRA=; b=IMlwtvAbCQc/GuYHOCk8A0rC3ioW3/DzWZKbRC5kBprYHrAYiDR0IF8uuWi7uqhgkM fc99WHAo1jDQ9A1jzRRmjIAItF918Hi2o3bSNDx4Qp9McX4sapwqzby0mpHNKEwtx+K7 0sDaT3i2qV7ktkMwNNieWmM2dF8gP1BH4zH1kPQEyNp9QfUxg4uck6TXtKDQqbsnFZAe z/GWRqW9Mlb9nQzPFDzsZF9DvPqumwLVYCmUsq8/ckkxDcBaj7K/mLkgKnUEjTN39pBe Ooou0rlJSDlGNz9kV2ta+Tl64w3lyW+DPbIlu/X3wnTyERqSW63931214+PZZRDNbkYl iGHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BCrujvZB; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 28si5861383ejm.165.2022.01.30.06.48.40; Sun, 30 Jan 2022 06:49:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BCrujvZB; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238992AbiA1IfA (ORCPT + 99 others); Fri, 28 Jan 2022 03:35:00 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:41760 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232312AbiA1Ie7 (ORCPT ); Fri, 28 Jan 2022 03:34:59 -0500 Date: Fri, 28 Jan 2022 09:34:56 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1643358898; 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=Mznfj1fiPKTxFf7vYfwMEGCtvJ9wyttqXLSgdsx8nRA=; b=BCrujvZBSCpf2xna9fz8CLrwsuLZ5hpooBVbum1LBX25zjvELu0ZsoZ253ceQPEXMN8Kvi sqzdZUnLxnGYNZAO/CgBXiCdqfc3i60YX3JSMjjGryGSX7EQZycBzQf9sSSf4zSXySule+ +S/lIBltqiPfMaeR2tpllMyMUYUcf5fTdeb6CL1dSJgrv3MZPjTrzmSZPRdimWhVa/1UzM AQC8pCFEu+7DGdY4ys9aV4jXCDdrZ0sNUiO+TKe9hCmyBOPsof2gtDlltesRmbCWa+e3mS q0CGhNcaX7EzhyI0m1eccf4luHkeN1Kn0eYPSD+3dNF0PSq9GeC05T38KpBkaA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1643358898; 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=Mznfj1fiPKTxFf7vYfwMEGCtvJ9wyttqXLSgdsx8nRA=; b=QSzHDGAI/DVypc2Th4gX1TX2xv1rmt64a7FnUgtSVLPgZOqLDhH4pawMVIJvqvQyn+h8O5 GrCmraSp5DSp8JBA== From: Sebastian Andrzej Siewior To: "Jason A. Donenfeld" Cc: Jonathan =?utf-8?Q?Neusch=C3=A4fer?= , Andy Lutomirski , LKML , Theodore Ts'o , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng Subject: Re: "BUG: Invalid wait context" in invalidate_batched_entropy Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-01-27 23:26:32 [+0100], Jason A. Donenfeld wrote: > Hi Jonathan, Hi Jason, > Thanks for the report. I'll try to reproduce this and see what's going on. > > I'm emailing back right away, though, so that I can CC in Andy > Lutomirski, who I know has been sitting on a stack of patches that fix > up (actually, remove) the locking, so this might be one path to fixing > this. This report is due to CONFIG_PROVE_LOCKING=y _and_ CONFIG_PROVE_RAW_LOCK_NESTING=y. It reports a nesting problem (raw_spinlock_t -> spinlock_t lock ordering) which becomes a real problem on PREEMPT_RT. I've been testing my old series on top of 5.17-rc1. With blake2 the numbers lowered a little. I'm gettin 3-6us on average and 16-26us worstcase and with NUMA it still goes up to 40-50us. If you still object the previous approach and neither tglx/peterz disagree we could try making the lock raw_spinlock_t and add a mutex_t around the userspace interface to lower the lock contention. But even then we need to find a way to move the crng init part (crng_fast_load()) out of the hard-IRQ. > Thanks, > Jason Sebastian