Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3718372ybc; Thu, 14 Nov 2019 13:38:41 -0800 (PST) X-Google-Smtp-Source: APXvYqyeFbVaKtaT5VZt4vyRIt8EMSV/ec6myAyBjFnQpRIjgb4aZC2IMmy7FFP8Gan8lbueLI/a X-Received: by 2002:a1c:f303:: with SMTP id q3mr9964198wmq.98.1573767521307; Thu, 14 Nov 2019 13:38:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573767521; cv=none; d=google.com; s=arc-20160816; b=o7Bol5IrEYNMyrr6EPk+aPyYK7fwd++WYQxvJlYh6agLpduhDZfz4CTlGoZuvbqCnz qO+n3qvWK6OMHGiordOJ7xoPh0bhHFHmanfmZnvvc5islgp0TYzc+6BebscrJyw66rI0 ahHF1/8OWF5FXvjiaOdVddqLCecsSKLfD6QIyjVFw+vO2EM4xN1wQSeiA6mc71Zi2U2R TS4xL3GfqMFVY1izBIiH78dfvXNS3D1ffsZjZFraQVtLJPJ28cYhtTQpCo1LnqUDdisK vFHGTGlCZDdeFFjsAr1GObcd2dT8LCuKW8f1sZx4AQpeXu0nAxmSorEdX/LGlqWgL+6Y MnqA== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=Z+ytqCwrTr56a+p451/iX9xn42nu3N6u6jZkSfWW3hg=; b=y/TCwbLmOSvvq0z24hK9SC9b7M7mO+H0E8bNWkV/zsjaQJuGAlzQm+fX79+KG2D3z6 Kv0bqScdQ975nG4OVonnzYZB5hYc/fPPvR/MjEelaOaVblvJRiNb87T00NlSjJm/LQ3H 5s/zRjLy86HB41W2IxKmzxR4/ph+LxucpLqRmpydD0fx+mjdaxnI0Do9DzRKWdVGTZEN f9t/gup1WdskgKI3wPy4VCa3ZW8VDrkHROqImHDqx+4QJ53pjyhH5XrdjJPBRxs+dMmk yXmBiVh7/5Io4fgbTyvvfNwSx6j2a/RN64RC/W/XbLFJCCxb56DNnjU5tFVzs0iHt6Tq Oefw== 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 b26si2422791edc.25.2019.11.14.13.38.15; Thu, 14 Nov 2019 13:38:41 -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 S1726852AbfKNVgo (ORCPT + 99 others); Thu, 14 Nov 2019 16:36:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:42692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbfKNVgo (ORCPT ); Thu, 14 Nov 2019 16:36:44 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B9B0920709; Thu, 14 Nov 2019 21:36:42 +0000 (UTC) Date: Thu, 14 Nov 2019 16:36:39 -0500 From: Steven Rostedt To: Joel Fernandes Cc: "Frank A. Cancio Bello" , Ingo Molnar , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, saiprakash.ranjan@codeaurora.org Subject: Re: [RFC 1/2] docs: ftrace: Clarify the RAM impact of buffer_size_kb Message-ID: <20191114163639.4727e3ed@gandalf.local.home> In-Reply-To: <20191114202059.GC186056@google.com> References: <0e4a803c3e24140172855748b4a275c31920e208.1573661658.git.frank@generalsoftwareinc.com> <20191113113730.213ddd72@gandalf.local.home> <20191114202059.GC186056@google.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 14 Nov 2019 15:20:59 -0500 Joel Fernandes wrote: > On Wed, Nov 13, 2019 at 11:37:30AM -0500, Steven Rostedt wrote: > > On Wed, 13 Nov 2019 11:32:36 -0500 > > "Frank A. Cancio Bello" wrote: > [snip] > > > + > > > + The number of pages allocated for each CPU buffer may not > > > + be the same than the round up of the division: > > > + buffer_size_kb / PAGE_SIZE. This is because part of each page is > > > + used to store a page header with metadata. E.g. with > > > + buffer_size_kb=4096 (kilobytes), a PAGE_SIZE=4096 bytes and a > > > + BUF_PAGE_HDR_SIZE=16 bytes (BUF_PAGE_HDR_SIZE is the size of the > > > + page header with metadata) the number of pages allocated for each > > > + CPU buffer is 1029, not 1024. The formula for calculating the > > > + number of pages allocated for each CPU buffer is the round up of: > > > + buffer_size_kb / (PAGE_SIZE - BUF_PAGE_HDR_SIZE). > > > > I have no problem with this patch, but the concern of documenting the > > implementation here, which will most likely not be updated if the > > implementation is ever changed, which is why I was vague to begin with. > > > > But it may never be changed as that code has been like that for a > > decade now. > > Agreed. To give some context, Frank is an outreachy intern I am working with and > one of his starter tasks was to understand the ring buffer's basics. I asked > him to send a patch since I thought he mentioned there was an error in the > documnentation. It looks like all that was missing is some explanation which > the deleted text in brackets above should already cover. > > Steve, your call if you want this patch. Looks like Frank understands the > page header taking up some space, so one of the goals of the exercise is > accomplished ;-) Yes agreed, what was written was not wrong (thus understood). But the more I think about this, the less I like the implementation details in the documentation directory. Now I am looking forward for some other patches from Frank, and perhaps he could add some comments in ring_buffer.c about this. ;-) -- Steve