mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Georgi Djakov <georgi.djakov@linaro.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	sudaraja@codeaurora.org, pratikp@codeaurora.org,
	lmark@codeaurora.org
Subject: Re: [PATCH] mm/page_owner: Record timestamp and pid
Date: Fri, 27 Nov 2020 20:06:38 +0100	[thread overview]
Message-ID: <bdf8727f-1191-34bd-d8ec-69b2a3d50c1b@suse.cz> (raw)
In-Reply-To: <3ef3d770-d74b-5588-6672-f092c1526461@linaro.org>

On 11/27/20 7:57 PM, Georgi Djakov wrote:
> Hi Vlastimil,
> 
> Thanks for the comment!
> 
> On 11/27/20 19:52, Vlastimil Babka wrote:
>> On 11/12/20 8:14 PM, Andrew Morton wrote:
>>> On Thu, 12 Nov 2020 20:41:06 +0200 Georgi Djakov <georgi.djakov@linaro.org> 
>>> wrote:
>>>
>>>> From: Liam Mark <lmark@codeaurora.org>
>>>>
>>>> Collect the time for each allocation recorded in page owner so that
>>>> allocation "surges" can be measured.
>>>>
>>>> Record the pid for each allocation recorded in page owner so that
>>>> the source of allocation "surges" can be better identified.
>>>
>>> Please provide a description of why this is considered useful.  What
>>> has it been used for, what problems has it been used to solve?
>> 
>> Worth noting that on x86_64 it doubles the size of struct page_owner
>> from 16 bytes to 32, so it better be justified:
> 
> Well, that's true. But for debug options there is almost always some penalty.
> The timestamp and pid information is very useful for me (and others, i believe)
> when doing memory analysis. On a crash for example, we can get this information
> from kdump (or RAM-dump) and look into it to catch memory allocation problems
> more easily.

Right. Btw, you should add printing the info to __dump_page_owner().

> If you find the above argument not strong enough, how about a separate config
> option for this? Maybe something like CONFIG_PAGE_OWNER_EXTENDED, which could
> be enabled in addition to CONFIG_PAGE_OWNER?

It might be strong enough if it's mentioned in changelog, and also what exactly 
the space tradeoff is :)

You can also mention that SLUB object tracking has also pid+timestamp.

> Thanks,
> Georgi
> 
>> 
>> struct page_owner {
>>          short unsigned int         order;                /*     0     2 */
>>          short int                  last_migrate_reason;  /*     2     2 */
>>          gfp_t                      gfp_mask;             /*     4     4 */
>>          depot_stack_handle_t       handle;               /*     8     4 */
>>          depot_stack_handle_t       free_handle;          /*    12     4 */
>>          u64                        ts_nsec;              /*    16     8 */
>>          int                        pid;                  /*    24     4 */
>> 
>>          /* size: 32, cachelines: 1, members: 7 */
>>          /* padding: 4 */
>>          /* last cacheline: 32 bytes */
>> };
>> 
> 


  reply	other threads:[~2020-11-27 19:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-12 18:41 Georgi Djakov
2020-11-12 19:14 ` Andrew Morton
2020-11-13 20:40   ` Georgi Djakov
2020-11-27 17:52   ` Vlastimil Babka
2020-11-27 18:57     ` Georgi Djakov
2020-11-27 19:06       ` Vlastimil Babka [this message]
2020-11-27 19:23         ` Souptick Joarder
2020-11-30 12:04           ` Vlastimil Babka

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=bdf8727f-1191-34bd-d8ec-69b2a3d50c1b@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=georgi.djakov@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lmark@codeaurora.org \
    --cc=pratikp@codeaurora.org \
    --cc=sudaraja@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

all inboxes | Powered by JetHome®