Re: [PATCH v2 1/3] mm: add __ prefix to page_cpupid_reset_last because it is non-atomic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ping? Any concerns about these patches?

Thanks,
Nick

Excerpts from Nicholas Piggin's message of March 17, 2021 4:47 pm:
> Add a __ prefix to indicate that it should be used in non-atomic
> situations (where the page is not subject to concurrent flags
> access, following the pattern of the other page flags modifications).
> 
> This prepares for an atomic version.
> 
> Signed-off-by: Nicholas Piggin <npiggin@xxxxxxxxx>
> ---
> Rebase only. Any comments on this idea?
> 
> Thanks,
> Nick
> 
>  include/linux/mm.h | 6 +++---
>  mm/page_alloc.c    | 4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 64a71bf20536..086ab710383f 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1396,7 +1396,7 @@ static inline int page_cpupid_last(struct page *page)
>  {
>  	return page->_last_cpupid;
>  }
> -static inline void page_cpupid_reset_last(struct page *page)
> +static inline void __page_cpupid_reset_last(struct page *page)
>  {
>  	page->_last_cpupid = -1 & LAST_CPUPID_MASK;
>  }
> @@ -1408,7 +1408,7 @@ static inline int page_cpupid_last(struct page *page)
>  
>  extern int page_cpupid_xchg_last(struct page *page, int cpupid);
>  
> -static inline void page_cpupid_reset_last(struct page *page)
> +static inline void __page_cpupid_reset_last(struct page *page)
>  {
>  	page->flags |= LAST_CPUPID_MASK << LAST_CPUPID_PGSHIFT;
>  }
> @@ -1449,7 +1449,7 @@ static inline bool cpupid_pid_unset(int cpupid)
>  	return true;
>  }
>  
> -static inline void page_cpupid_reset_last(struct page *page)
> +static inline void __page_cpupid_reset_last(struct page *page)
>  {
>  }
>  
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index cfc72873961d..172368357e73 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1266,7 +1266,7 @@ static __always_inline bool free_pages_prepare(struct page *page,
>  	if (bad)
>  		return false;
>  
> -	page_cpupid_reset_last(page);
> +	__page_cpupid_reset_last(page);
>  	page->flags &= ~PAGE_FLAGS_CHECK_AT_PREP;
>  	reset_page_owner(page, order);
>  
> @@ -1463,7 +1463,7 @@ static void __meminit __init_single_page(struct page *page, unsigned long pfn,
>  	set_page_links(page, zone, nid, pfn);
>  	init_page_count(page);
>  	page_mapcount_reset(page);
> -	page_cpupid_reset_last(page);
> +	__page_cpupid_reset_last(page);
>  	page_kasan_tag_reset(page);
>  
>  	INIT_LIST_HEAD(&page->lru);
> -- 
> 2.23.0
> 
> 





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux