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 32F7BC433F5 for ; Mon, 20 Dec 2021 02:57:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237298AbhLTC5E (ORCPT ); Sun, 19 Dec 2021 21:57:04 -0500 Received: from helcar.hmeau.com ([216.24.177.18]:58288 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231167AbhLTC5D (ORCPT ); Sun, 19 Dec 2021 21:57:03 -0500 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1mz8rA-0001rt-Ak; Mon, 20 Dec 2021 13:56:57 +1100 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Mon, 20 Dec 2021 13:56:56 +1100 Date: Mon, 20 Dec 2021 13:56:56 +1100 From: Herbert Xu To: Sebastian Andrzej Siewior Cc: Jason@zx2c4.com, linux-kernel@vger.kernel.org, tytso@mit.edu, tglx@linutronix.de, peterz@infradead.org Subject: Re: [PATCH 5/5] random: Defer processing of randomness on PREEMPT_RT. Message-ID: <20211220025656.GB20311@gondor.apana.org.au> References: <20211207201037.h46573oa5nfj33xq@linutronix.de> <20211217022338.GA19411@gondor.apana.org.au> <20211218032409.GA11425@gondor.apana.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 19, 2021 at 10:48:12AM +0100, Sebastian Andrzej Siewior wrote: > > That one. I find the semantic difficult to understand. Some BH-user > check sock_owned_by_user(), some don't. > However, a semaphore should work. The atomic user would do > down_trylock() while preemptible caller would invoke down() and sleep > until the lock is available. Let me check if that works hereā€¦ Right, if your atomic user can simply discard the work then this is enough. In the network case, we can't just discard the packet so that's why there is a backlog queue which the atomic user appends to if the lock isn't available. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt