All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: page_owner: fetch backtrace only for tracked pages
@ 2021-04-01 21:24 Sergei Trofimovich
  2021-04-07 15:49 ` Vlastimil Babka
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Trofimovich @ 2021-04-01 21:24 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Sergei Trofimovich, linux-mm

Very minor optimization.

CC: Andrew Morton <akpm@linux-foundation.org>
CC: linux-mm@kvack.org
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
 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);
-- 
2.31.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm: page_owner: fetch backtrace only for tracked pages
  2021-04-01 21:24 [PATCH] mm: page_owner: fetch backtrace only for tracked pages Sergei Trofimovich
@ 2021-04-07 15:49 ` Vlastimil Babka
  2021-04-07 22:47   ` Sergei Trofimovich
  0 siblings, 1 reply; 3+ messages in thread
From: Vlastimil Babka @ 2021-04-07 15:49 UTC (permalink / raw)
  To: Sergei Trofimovich, Andrew Morton; +Cc: linux-kernel, linux-mm

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);
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm: page_owner: fetch backtrace only for tracked pages
  2021-04-07 15:49 ` Vlastimil Babka
@ 2021-04-07 22:47   ` Sergei Trofimovich
  0 siblings, 0 replies; 3+ messages in thread
From: Sergei Trofimovich @ 2021-04-07 22:47 UTC (permalink / raw)
  To: Vlastimil Babka; +Cc: Andrew Morton, linux-kernel, linux-mm

On Wed, Apr 07, 2021 at 05:49:14PM +0200, Vlastimil Babka wrote:
> 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.

Never saw missing 'page_ext' in practice (I also did not check for
it explicitly). I agree "optimization" is misleading. "cleanup"
might be a better wording.

> > 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);
> > 
> 

-- 

  Sergei

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-07 22:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-01 21:24 [PATCH] mm: page_owner: fetch backtrace only for tracked pages Sergei Trofimovich
2021-04-07 15:49 ` Vlastimil Babka
2021-04-07 22:47   ` Sergei Trofimovich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.