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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INVALID_DATE_TZ_ABSURD, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0428C2B9F4 for ; Mon, 28 Jun 2021 15:25:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8F03E61492 for ; Mon, 28 Jun 2021 15:25:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237072AbhF1P1o (ORCPT ); Mon, 28 Jun 2021 11:27:44 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:48390 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233180AbhF1PDT (ORCPT ); Mon, 28 Jun 2021 11:03:19 -0400 From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1624892452; 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=tJNMj9jH56nxGMNEkc58ec6mbIbhOSkZ93/TnpzDysE=; b=km9sefFVa457kBxz9e+IXdXr8go+ygc3AxCRAxA3I7pWztO/WCsrnHFy+7NHMGG4tBtaiU fUgE8xa8wlT6fHENp4/U21bwwdv462oJlXlF8BolbKnXftwVq3Xl60nk6KJjHriidDc4eN K/oObeI0lJ62ypaq3mFLHQNtgTuTLdwFRuq5dque+b0wteb6D5QBW87pJYsb0HY7AeszDY wNbOts9VgJ6a/MotdzmyeY/Y4tndo7bl/O3AfGmDB6pv+dGDm2kpPLgQPRelmHYKkdbKml 3qj9wYRcsUenHrUtNO1nuaqxKW0I0hk5Nb9viBiX/DMoZuTSasgYvpEE4gGMCw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1624892452; 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=tJNMj9jH56nxGMNEkc58ec6mbIbhOSkZ93/TnpzDysE=; b=xFy7ufxYK5ZNsHtcL/NLPFhYB8DxrC04q72NweteV+mU1zJ4Vy5PzSWS1gTVfNG04605xm WSb2UfawU7uNeLDg== To: Steven Rostedt , Petr Mladek Cc: Sergey Senozhatsky , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH printk v3 6/6] printk: syslog: close window between wait and read In-Reply-To: <20210628105240.4fc1be2e@oasis.local.home> References: <20210624111148.5190-1-john.ogness@linutronix.de> <20210624111148.5190-7-john.ogness@linutronix.de> <20210625093354.12384711@oasis.local.home> <20210628105240.4fc1be2e@oasis.local.home> Date: Mon, 28 Jun 2021 17:06:51 +0206 Message-ID: <87o8bqava4.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-06-28, Steven Rostedt wrote: > Petr Mladek wrote: >> I was double checking the code and the locking is really hard to >> follow. I would if the following approach make it easier. The main >> trick is that the lock is taken at the beginnig and release at >> the end. It is only temporary released around a single line >> when needed. > > That's a much more common approach to locking, that may not be as > efficient, but is much easier to keep straight, and less error prone. OK. I will use this approach for v4. Thank you. John