[PATCH] mm/codetag: fix arg in pgalloc_tag_copy alloc_tag_sub

Sourav Panda posted 1 patch 1 month ago
There is a newer version of this series
include/linux/mm.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] mm/codetag: fix arg in pgalloc_tag_copy alloc_tag_sub
Posted by Sourav Panda 1 month ago
alloc_tag_sub() takes bytes as opposed to number of pages as argument.

Currently pgalloc_tag_copy() passes the number of pages. This fix passes
the current unit, which is the number of bytes allocated.

Fixes: e0a955bf7f61 ("mm/codetag: add pgalloc_tag_copy()")
Signed-off-by: Sourav Panda <souravpanda@google.com>
---
 include/linux/mm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index ecf63d2b0582..2890001c8b97 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -4203,7 +4203,7 @@ static inline void pgalloc_tag_copy(struct folio *new, struct folio *old)
 	/* Clear the old ref to the original allocation tag. */
 	clear_page_tag_ref(&old->page);
 	/* Decrement the counters of the tag on get_new_folio. */
-	alloc_tag_sub(ref, folio_nr_pages(new));
+	alloc_tag_sub(ref, folio_size(new));
 
 	__alloc_tag_ref_set(ref, tag);
 
-- 
2.47.0.105.g07ac214952-goog
Re: [PATCH] mm/codetag: fix arg in pgalloc_tag_copy alloc_tag_sub
Posted by Pasha Tatashin 1 month ago
On Tue, Oct 22, 2024 at 4:56 PM Sourav Panda <souravpanda@google.com> wrote:
>
> alloc_tag_sub() takes bytes as opposed to number of pages as argument.
>
> Currently pgalloc_tag_copy() passes the number of pages. This fix passes
> the current unit, which is the number of bytes allocated.
>
> Fixes: e0a955bf7f61 ("mm/codetag: add pgalloc_tag_copy()")
> Signed-off-by: Sourav Panda <souravpanda@google.com>

Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>

Thanks,
Pasha

> ---
>  include/linux/mm.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index ecf63d2b0582..2890001c8b97 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -4203,7 +4203,7 @@ static inline void pgalloc_tag_copy(struct folio *new, struct folio *old)
>         /* Clear the old ref to the original allocation tag. */
>         clear_page_tag_ref(&old->page);
>         /* Decrement the counters of the tag on get_new_folio. */
> -       alloc_tag_sub(ref, folio_nr_pages(new));
> +       alloc_tag_sub(ref, folio_size(new));
>
>         __alloc_tag_ref_set(ref, tag);
>
> --
> 2.47.0.105.g07ac214952-goog
>
Re: [PATCH] mm/codetag: fix arg in pgalloc_tag_copy alloc_tag_sub
Posted by Suren Baghdasaryan 1 month ago
On Tue, Oct 22, 2024 at 2:03 PM Pasha Tatashin
<pasha.tatashin@soleen.com> wrote:
>
> On Tue, Oct 22, 2024 at 4:56 PM Sourav Panda <souravpanda@google.com> wrote:
> >
> > alloc_tag_sub() takes bytes as opposed to number of pages as argument.
> >
> > Currently pgalloc_tag_copy() passes the number of pages. This fix passes
> > the current unit, which is the number of bytes allocated.
> >
> > Fixes: e0a955bf7f61 ("mm/codetag: add pgalloc_tag_copy()")
> > Signed-off-by: Sourav Panda <souravpanda@google.com>
>
> Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>

Oops... Thanks for the fix!

Acked-by: Suren Baghdasaryan <surenb@google.com>

>
> Thanks,
> Pasha
>
> > ---
> >  include/linux/mm.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/linux/mm.h b/include/linux/mm.h
> > index ecf63d2b0582..2890001c8b97 100644
> > --- a/include/linux/mm.h
> > +++ b/include/linux/mm.h
> > @@ -4203,7 +4203,7 @@ static inline void pgalloc_tag_copy(struct folio *new, struct folio *old)
> >         /* Clear the old ref to the original allocation tag. */
> >         clear_page_tag_ref(&old->page);
> >         /* Decrement the counters of the tag on get_new_folio. */
> > -       alloc_tag_sub(ref, folio_nr_pages(new));
> > +       alloc_tag_sub(ref, folio_size(new));
> >
> >         __alloc_tag_ref_set(ref, tag);
> >
> > --
> > 2.47.0.105.g07ac214952-goog
> >