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.8 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 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 7E2F0C433E0 for ; Fri, 15 Jan 2021 15:45:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0920D23884 for ; Fri, 15 Jan 2021 15:45:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0920D23884 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 595478D0191; Fri, 15 Jan 2021 10:45:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 544B48D0187; Fri, 15 Jan 2021 10:45:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 432AA8D0191; Fri, 15 Jan 2021 10:45:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0118.hostedemail.com [216.40.44.118]) by kanga.kvack.org (Postfix) with ESMTP id 2D4728D0187 for ; Fri, 15 Jan 2021 10:45:13 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E04F11DFA for ; Fri, 15 Jan 2021 15:45:12 +0000 (UTC) X-FDA: 77708433264.08.queen46_1a0ee3127530 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id BD35A1819E769 for ; Fri, 15 Jan 2021 15:45:12 +0000 (UTC) X-HE-Tag: queen46_1a0ee3127530 X-Filterd-Recvd-Size: 3808 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Fri, 15 Jan 2021 15:45:12 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id F3BC52339D; Fri, 15 Jan 2021 15:45:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610725511; bh=/q9KAlBin1gqZTSdMUIA7qxFm2PjMq25wybGsrTkMB0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=APPaZ7LIHi5QUZ9YwtphXof7uDD2cqvejSfGRxRKBL5k78VTV/5UZiPHW1YoFTAjw XgQxkewJkE25oG5m7EcShLeLSk5hvMq68w3/lKOuM4gMa6M8tvvinTXG6NBCANVdTj g6VRSNDE8Yt0CI22qb4XN1TJnJPUO+BLTvnfkEOk= Date: Fri, 15 Jan 2021 16:45:09 +0100 From: Greg KH To: Alexander Potapenko Cc: LKML , Andrew Morton , Andrey Konovalov , Dmitriy Vyukov , Ingo Molnar , Marco Elver , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Linux Memory Management List Subject: Re: [PATCH v2 3/5] docs: ABI: add /sys/kernel/error_report/ documentation Message-ID: References: <20210115130336.2520663-1-glider@google.com> <20210115130336.2520663-4-glider@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jan 15, 2021 at 04:26:21PM +0100, Alexander Potapenko wrote: > > sysfs is "one value per file" > What about existing interfaces that even export binary blobs through > sysfs (e.g. /sys/firmware, /sys/boot_params)? > What qualifies as a "value" in that case? binary files are fine as the kernel is just a "pipe" through to the hardware / firmware. No translation or parsing happens in the kernel. And that's NOT trace events :) > > please put something like this in > > tracefs, as there is no such rules there. Or debugfs, but please, not > > sysfs. > Does tracefs have anything similar to sysfs_notify() or any other way > to implement a poll() handler? Don't know, look and see! > Our main goal is to let users wait on poll(), so that they don't have > to check the file for new contents every now and then. Is it possible > with tracefs or debugfs? debugfs, yes, you can do whatever you want. tracefs probably has this, otherwise how would trace tools work? :) > Also, for our goal debugfs isn't a particularly good fit, as Android > kernels do not enable debugfs. Do you care about Android kernels? If so, yes, debugfs is not good. And have you asked the Android kernel team about this? > Not sure about tracefs, they seem to have it, need to check. It should be there. > Do you think it is viable to keep > /sys/kernel/error_report/report_count in sysfs and use it for > notifications, but move last_report somewhere else? No, not at all, please keep it out of sysfs. > (I'd probably prefer procfs, but it could be tracefs as well, if you > find that better). If it does not have to do with processes, it does not belong in procfs. Again, this seems to fit in with tracing, so please use tracefs. > This way it will still be possible to easily notify userspace about > new reports, but the report itself won't have any atomicity > guarantees. Users will have to check the report count to ensure it > didn't change under their feet. Again, use a file in tracefs. thanks, greg k-h