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.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 07CADC433E0 for ; Fri, 26 Feb 2021 08:41:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9AFCA64EE7 for ; Fri, 26 Feb 2021 08:41:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230107AbhBZIkk (ORCPT ); Fri, 26 Feb 2021 03:40:40 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:41974 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230237AbhBZIhL (ORCPT ); Fri, 26 Feb 2021 03:37:11 -0500 From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1614328582; 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=Wa9POXqMKGw+8kb3VAc3hSm+Y4vGF0EAtAN5/tcZUMU=; b=muUzaIMBpPxOCUKU+xBeJdilnkL/NyDY+RF8P8QPv8ytIrC130tc5k4ztDxXh4QCErNqRQ rNHNxl+io7jGyWAvKpri456Eox6HCL8OpxWjbM0EENMAN0i76/m03nJftGI3lLju0k4uWC vCiX9kaxzbYg2r9z0VTLrqemp94Q3wgaiUuPIhMf3gTjxpfS+YGmzri8j8C0aVA7MogXmZ 6cpeecHvrNzE9Nh/XAInVBnBLCOM8Q+P6oWyqLJqY4Bp70Em3I7RUg3SN2bS+79dvGeNMu 3j35vZnioT8qLM5UgHSXymkNE3DghxsnOSi1O3GTBkhzbKQijluz4LnWvmszYg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1614328582; 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=Wa9POXqMKGw+8kb3VAc3hSm+Y4vGF0EAtAN5/tcZUMU=; b=ZG4J3SIGHekCeoIDg0IEG47Ka/+4+vh5qujpC7tj+T6w/LHxcGaZhMICaKO8r2Zf98n3c+ xDdPrAZ87zTdcXBg== To: Petr Mladek Cc: Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: synchronization model: was: Re: [PATCH printk-rework 09/14] printk: introduce a kmsg_dump iterator In-Reply-To: References: <20210218081817.28849-1-john.ogness@linutronix.de> <20210218081817.28849-10-john.ogness@linutronix.de> <87eeh51wht.fsf@jogness.linutronix.de> Date: Fri, 26 Feb 2021 09:36:21 +0100 Message-ID: <877dmvxm2i.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-02-25, Petr Mladek wrote: > IMHO, a better design would be: > > 1. dumper->dump() callback should have only one parameter @reason. > The callback should define its own iterator, buffer, and > do the dump. Unfortunately this won't work because drivers/mtd/mtdoops.c is using the dumper parameter for container_of(). So we will need 2 parameters: dumper and reason. Can we agree to proceed with 2 parameters in the callback? > 2. dumpe->dump() callback should synchronize the entire operation > using its own locks. Only the callback knows whether it is > safe to do more dumps in parallel. Only the callback knows > whether it is called only during panic() when no locks > are needed. Agreed. I implemented this part for the v3 series. John Ogness