Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1984825imu; Thu, 24 Jan 2019 05:28:01 -0800 (PST) X-Google-Smtp-Source: ALg8bN4n1lZm1tO4b3PkDRQLbxbybKBKsIPEHrKZDaUCtZvnqsgy7+IPAx2wUtFWTIp/VmMhC+Na X-Received: by 2002:a62:2fc3:: with SMTP id v186mr6527914pfv.82.1548336481127; Thu, 24 Jan 2019 05:28:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548336481; cv=none; d=google.com; s=arc-20160816; b=BrGC+1z/Te2qh0liY51o6BkL5VOtjkKZPzXJaLpBrmeDe5GqfsunzUfYecTQq/gWLF fe3Qds2AXvTVSxeC/VqmbU0PJDi3SaAVxXvoWc87FEtr7hsfFzY/os2Udx+jZebc2NFB iW0xU3trF3rJ+CdMnje935RwT163N/+7qx1lztE1RKTlKSTfI16J/d8flVN7wAIwnVs0 O16d0RvHFtrbfvcdgPLjSF3d/cEPe5sG9cpRcCAYpR3ROOqACsl55O8HAa2bxDTsK+XJ tXDh30Ko8TiAO9+6swU4gAN4NC3P+0I7ecs0aW/aHkxw8tFd43i2PC1UDBJGBhQgkkG/ YCVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=YDhdjdLlj8jTlpaFFXU/qK4EuvXTXghHwhpHchKH6fA=; b=eFiFd5YSNxb8rMhy1KQMy0M4nnq0YJB2qZ8XwqfIhVWY684i5mjiX2dE8akKH66IS3 PyPDZ8fC6cBNqv1kX0rcLmwvSIgxUjDQxw+0gM9NJyPTu00M7iOje+GbfhFiIWz22zKJ vKnOnCJQXEpoETnUZBFQ6r+B0wkuanFiUQeNFftF2oRzsUYV7RkE1DYdc0fubAx8CBRu CXDHTABYK4hla1tMk+U9EkOwKa6G9m5eJYHfZ7zl1Zh4n9Se/OFu+tF+ImuKS6tz9Dem 4RNsCiR/0XP7sYbrMdnt3CWh68MFQDr5a3JlqqxmrKZzs3UF403kzu/JfmDnjlusYB25 opeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s123si22448509pfb.274.2019.01.24.05.27.43; Thu, 24 Jan 2019 05:28:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728016AbfAXN1d (ORCPT + 99 others); Thu, 24 Jan 2019 08:27:33 -0500 Received: from smtp2207-205.mail.aliyun.com ([121.197.207.205]:41738 "EHLO smtp2207-205.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726105AbfAXN1d (ORCPT ); Thu, 24 Jan 2019 08:27:33 -0500 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07492714|-1;CH=green;FP=0|0|0|0|0|-1|-1|-1;HT=e02c03305;MF=liaoweixiong@allwinnertech.com;NM=1;PH=DS;RN=14;RT=14;SR=0;TI=SMTPD_---.Dq7P6Ro_1548336445; Received: from 172.16.10.102(mailfrom:liaoweixiong@allwinnertech.com fp:SMTPD_---.Dq7P6Ro_1548336445) by smtp.aliyun-inc.com(10.147.42.22); Thu, 24 Jan 2019 21:27:26 +0800 Subject: Re: [RFC v5 1/4] pstore/blk: new support logger for block devices To: Aaro Koskinen , Kees Cook Cc: Anton Vorontsov , Colin Cross , Tony Luck , Jonathan Corbet , Mauro Carvalho Chehab , Greg Kroah-Hartman , "David S. Miller" , Andrew Morton , Nicolas Ferre , Arnd Bergmann , "open list:DOCUMENTATION" , LKML References: <1546862462-19640-1-git-send-email-liaoweixiong@allwinnertech.com> <1546862462-19640-2-git-send-email-liaoweixiong@allwinnertech.com> <1497804b-f921-b0cf-1327-3b17beaf9ce7@allwinnertech.com> <20190123181949.GC2792@darkstar.musicnaut.iki.fi> From: liaoweixiong Message-ID: <8f02a568-c1ab-fb10-7654-cb5db2d7a745@allwinnertech.com> Date: Thu, 24 Jan 2019 21:27:30 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190123181949.GC2792@darkstar.musicnaut.iki.fi> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-01-24 02:19, Aaro Koskinen wrote: > Hi, > > On Sat, Jan 19, 2019 at 04:53:48PM +0800, liaoweixiong wrote: >> On 2019-01-18 08:12, Kees Cook wrote: >>>> MTD (drivers/mtd/mtdoops.c). >>> >>> Would mtdoops get dropped in favor of pstore/blk, or do they not share >>> features? >> >> We can show them what pstore/blk do. I think they will be interested in it. >> They should do a little work, including make a function for panic read, >> then they gain enhanced features, including present logs as a file, >> record multiple logs. > > mtdoops has been in use over a decade and known working. What benefits > this new framework would offer? (BTW I don't see MTD as "block device".) > Pstore/blk is NOT to replace mtdoops, but to enhance it. Mtdoops provides operation interface for panic and pstore/blk manage the special partition space. The combination of pstore/blk and mtdoops brings follow benefits: 1. Not only panic/oops, but also all feature of pstore, such as console, ftrace, pmsg, etc. 2. Display log as a file. Pstore/blk can save multiple records and display all of them as files. Users have no need to parse the partition, just read files to get what they wants. 3. User can get more information, such as the trigger time, the trigger count, etc. 4. ... perhaps other benefits that I can't think of right now > Why should there be a panic read? That adds complexity. This codes runs > on panic path, so it should be as simple and fast as possible. > Read operation is only used to recover old data. Pstore/blk will do recovery only one time before write (when trigger a new crash) and read (when mount pstore filesystem). Most of the time, pstore/blk will do read by general operation rather than panic read. However, how if kernel panic when pstore/blk do not recover yet? That's why we need panic read. In addition, pstore/blk do not recover log when panic. It just recover the trigger counter and next position. Pstore/blk need old count to accumulate count, next position to avoid damage to old records. > Also compatibility has to be there. E.g. user upgrades an old system > (with mtdoops and related userspace) to a new kernel. Upgrade fails, > so the old software must be able to read the panic dumps properly to > tell the user why. > This is really a problem, because the header of each records is very different between pstore/blk and mtdoops. But i think it is not fatal. > A. > -- liaoweixiong