Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp442803rwl; Wed, 29 Mar 2023 04:16:59 -0700 (PDT) X-Google-Smtp-Source: AKy350bXAIfADhUHNuYNB1tY6CmnwvbYn0sk0s+hS5XdPVYG8fnLnerrdsAR2jPA9COA2JcDoDwM X-Received: by 2002:a17:907:75f2:b0:88a:1ea9:a5ea with SMTP id jz18-20020a17090775f200b0088a1ea9a5eamr18237077ejc.65.1680088619530; Wed, 29 Mar 2023 04:16:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680088619; cv=none; d=google.com; s=arc-20160816; b=E9iEwVaTSanb/94nlBSHSVELXI+2f3N2ObzGIvaNaS/tNXb/4SuIbXd38v+KW2gdP2 OMxp338jaCBT6BJqazlnsxgBsoqrZwMdBpQFHl693k4v88qlO80O4PkRW7BQvNgmScD2 TPjn7jjdlM826MObA1o/oK2/jxwjRQlL7zRao7PHF8wYgjp73tSvIlscoHdV4uVdJC4p UwgXOvOGLjLWC0WSSpfm0PCQ3+S0At/D49+JDriTIs+h0ksW9jkvfLg+Bm3FBxGJLaq2 yJoW0235+P2D7upAGPoFgPC3stXOQcEhr9IbAuDMoCx+yIL/KUVPuiCRDxPT7xDo7NkD Wp/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=KpOv0kFunQ0GqnfjiM1htV3hlSJUjYjJOL4SpLU88cY=; b=Kh8vdNn//NDPvubGy0IfpY/S7pospt7lDG6P0V+iOKSvI0gx0nXhpWZNoymHOLDRbn 2BJl5/D4lvfd1wFuU/00u2riUopqXhKh26No3CndLUeRJzNsyUWT3YPKew0864LLiq1M xfqPGFGd1Hml74n0C5fhhj3hDYTN//rtuI+W6DZpQoxOv3zrsVBHw8rHbRfer6AZlyh3 uVO8/jXFbLvQc5LJM+QFGfPrPKTMYqrLX7kN+7Al/bnFK4cxO4w/ML78qetuIbcHeRwy BQi1cBnPC/DGwWHUbDGeMowdswiNra2WZSVIZex8txpeJ0rIooLjFtFE8+mKO+qrt+JY TWfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc38-20020a1709078a2600b0092fbf61b95csi31959674ejc.50.2023.03.29.04.16.34; Wed, 29 Mar 2023 04:16:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229631AbjC2LEt (ORCPT + 99 others); Wed, 29 Mar 2023 07:04:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229705AbjC2LE2 (ORCPT ); Wed, 29 Mar 2023 07:04:28 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E328346B3; Wed, 29 Mar 2023 04:04:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A3D1AB822A2; Wed, 29 Mar 2023 11:03:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD0C7C4339B; Wed, 29 Mar 2023 11:03:55 +0000 (UTC) Date: Wed, 29 Mar 2023 07:03:53 -0400 From: Steven Rostedt To: Vincent Donnefort Cc: mhiramat@kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v2 1/2] ring-buffer: Introducing ring-buffer mapping functions Message-ID: <20230329070353.1e1b443b@gandalf.local.home> In-Reply-To: References: <20230322102244.3239740-1-vdonnefort@google.com> <20230322102244.3239740-2-vdonnefort@google.com> <20230328224411.0d69e272@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 29 Mar 2023 10:19:44 +0100 Vincent Donnefort wrote: > > I've been playing with this a bit, and I'm thinking, do we need the > > data_pages[] array on the meta page? > > > > I noticed that I'm not even using it. > > > > Currently, we need to do a ioctl every time we finish with the reader page, > > and that updates the reader_page in the meta data to point to the next page > > to read. When do we need to look at the data_start section? > > This is for non-consuming read, to get all the pages in order. Yeah, I was trying to see how a non consuming read would work, and was having issues figuring that out without the tail page being updated. > > If we remove this section we would lose this ability ... but we'd also simplify > the code by a good order of magnitude (don't need the update ioctl anymore, no > need to keep those pages in order and everything can fit a 0-order meta-page). > And the non-consuming read doesn't bring much to the user over the pipe version. > > This will although impact our hypervisor tracing which will only be able to > expose trace_pipe interfaces. But I don't think it is a problem, all userspace > tools only relying on consuming read anyway. > > So if you're happy dropping this support, let's get rid of it. I don't really want to get rid of it, but perhaps break it up where we don't have it in the first release, but add it in a second one. That will also make sure that we can expand the API if necessary (one reason I wanted the "data_start" in the first place). Let's drop it for now, but be able to add it later, an have the current structure be: struct ring_buffer_meta_page_header { #if __BITS_PER_LONG == 64 __u64 entries; __u64 overrun; #else __u32 entries; __u32 overrun; #endif __u32 pages_touched; __u32 meta_page_size; __u32 reader_page; /* page ID for the reader page */ __u32 nr_data_pages; /* doesn't take into account the reader_page */ }; BTW, shouldn't the nr_data_pages take into account the reader page? As it is part of the array we traverse isn't it? -- Steve