linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Sergei Trofimovich <slyfox@gentoo.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm: page_owner: fetch backtrace only for tracked pages
Date: Wed, 7 Apr 2021 17:49:14 +0200	[thread overview]
Message-ID: <0c18e497-07d1-887f-e49e-b6315f396ab8@suse.cz> (raw)
In-Reply-To: <20210401212445.3534721-1-slyfox@gentoo.org>

On 4/1/21 11:24 PM, Sergei Trofimovich wrote:
> Very minor optimization.

I'm not entirely sure about accuracy of "only for tracked pages". Missing
page_ext is something I'm not even sure how possible it is in practice, probably
just an error condition (failed to be allocated?). Or did you observe this in
practice? But anyway, the change is not wrong.

> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: linux-mm@kvack.org
> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  mm/page_owner.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/page_owner.c b/mm/page_owner.c
> index 63e4ecaba97b..7147fd34a948 100644
> --- a/mm/page_owner.c
> +++ b/mm/page_owner.c
> @@ -140,14 +140,14 @@ void __reset_page_owner(struct page *page, unsigned int order)
>  {
>  	int i;
>  	struct page_ext *page_ext;
> -	depot_stack_handle_t handle = 0;
> +	depot_stack_handle_t handle;
>  	struct page_owner *page_owner;
>  
> -	handle = save_stack(GFP_NOWAIT | __GFP_NOWARN);
> -
>  	page_ext = lookup_page_ext(page);
>  	if (unlikely(!page_ext))
>  		return;
> +
> +	handle = save_stack(GFP_NOWAIT | __GFP_NOWARN);
>  	for (i = 0; i < (1 << order); i++) {
>  		__clear_bit(PAGE_EXT_OWNER_ALLOCATED, &page_ext->flags);
>  		page_owner = get_page_owner(page_ext);
> 


  reply	other threads:[~2021-04-07 15:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01 21:24 [PATCH] mm: page_owner: fetch backtrace only for tracked pages Sergei Trofimovich
2021-04-07 15:49 ` Vlastimil Babka [this message]
2021-04-07 22:47   ` Sergei Trofimovich

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=0c18e497-07d1-887f-e49e-b6315f396ab8@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=slyfox@gentoo.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).