From: Steven Rostedt <rostedt@goodmis.org>
To: Joel Fernandes <joel@joelfernandes.org>
Cc: "Frank A. Cancio Bello" <frank@generalsoftwareinc.com>,
Ingo Molnar <mingo@redhat.com>, Jonathan Corbet <corbet@lwn.net>,
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
Date: Thu, 14 Nov 2019 16:36:39 -0500 [thread overview]
Message-ID: <20191114163639.4727e3ed@gandalf.local.home> (raw)
In-Reply-To: <20191114202059.GC186056@google.com>
On Thu, 14 Nov 2019 15:20:59 -0500
Joel Fernandes <joel@joelfernandes.org> 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" <frank@generalsoftwareinc.com> 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
next prev parent reply other threads:[~2019-11-14 21:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-13 16:31 [RFC 0/2] docs: ftrace: Clarify the RAM impact of buffer_size_kb Frank A. Cancio Bello
2019-11-13 16:32 ` [RFC 1/2] " Frank A. Cancio Bello
2019-11-13 16:37 ` Steven Rostedt
2019-11-14 20:20 ` Joel Fernandes
2019-11-14 21:36 ` Steven Rostedt [this message]
2019-11-15 4:24 ` Frank A. Cancio Bello
2019-11-15 13:30 ` Steven Rostedt
2019-11-15 15:59 ` Frank A. Cancio Bello
2019-11-15 16:03 ` Steven Rostedt
2019-11-13 16:33 ` [RFC 2/2] ** do not apply this patch ** Just for illustration purposes Frank A. Cancio Bello
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191114163639.4727e3ed@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=corbet@lwn.net \
--cc=frank@generalsoftwareinc.com \
--cc=joel@joelfernandes.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=saiprakash.ranjan@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).