diff mbox series

[03/16] mm: remove obsolete macro NR_PCP_ORDER_MASK

Message ID 20220909092451.24883-4-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series A few cleanup patches for mm | expand

Commit Message

Miaohe Lin Sept. 9, 2022, 9:24 a.m. UTC
Since commit 8b10b465d0e1 ("mm/page_alloc: free pages in a single pass
during bulk free"), it's not used anymore. Remove it.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 include/linux/mmzone.h | 1 -
 1 file changed, 1 deletion(-)

Comments

David Hildenbrand Sept. 9, 2022, 11:26 a.m. UTC | #1
On 09.09.22 11:24, Miaohe Lin wrote:
> Since commit 8b10b465d0e1 ("mm/page_alloc: free pages in a single pass
> during bulk free"), it's not used anymore. Remove it.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>   include/linux/mmzone.h | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index d907a29cc429..6950179a20a2 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -569,7 +569,6 @@ enum zone_watermarks {
>    * in the least significant bits.
>    */
>   #define NR_PCP_ORDER_WIDTH 8
> -#define NR_PCP_ORDER_MASK ((1<<NR_PCP_ORDER_WIDTH) - 1)
>   
>   #define min_wmark_pages(z) (z->_watermark[WMARK_MIN] + z->watermark_boost)
>   #define low_wmark_pages(z) (z->_watermark[WMARK_LOW] + z->watermark_boost)

Reviewed-by: David Hildenbrand <david@redhat.com>
Matthew Wilcox Sept. 9, 2022, 7:37 p.m. UTC | #2
On Fri, Sep 09, 2022 at 05:24:38PM +0800, Miaohe Lin wrote:
> Since commit 8b10b465d0e1 ("mm/page_alloc: free pages in a single pass
> during bulk free"), it's not used anymore. Remove it.

Yes, but this patch needs to go further.  The comment is no longer true
(after the patch you mention), so need to also delete these lines:

-/*
- * Shift to encode migratetype and order in the same integer, with order
- * in the least significant bits.
- */
-#define NR_PCP_ORDER_WIDTH 8

and the line:
-                BUILD_BUG_ON(MAX_ORDER >= (1<<NR_PCP_ORDER_WIDTH));
Miaohe Lin Sept. 13, 2022, 3:14 a.m. UTC | #3
On 2022/9/10 3:37, Matthew Wilcox wrote:
> On Fri, Sep 09, 2022 at 05:24:38PM +0800, Miaohe Lin wrote:
>> Since commit 8b10b465d0e1 ("mm/page_alloc: free pages in a single pass
>> during bulk free"), it's not used anymore. Remove it.
> 
> Yes, but this patch needs to go further.  The comment is no longer true
> (after the patch you mention), so need to also delete these lines:
> 
> -/*
> - * Shift to encode migratetype and order in the same integer, with order
> - * in the least significant bits.
> - */
> -#define NR_PCP_ORDER_WIDTH 8
> 
> and the line:
> -                BUILD_BUG_ON(MAX_ORDER >= (1<<NR_PCP_ORDER_WIDTH));
> 

Agree. Many thanks for pointing this out. Will do it in next version.

Thanks,
Miaohe Lin

> 
> .
>
Anshuman Khandual Sept. 13, 2022, 8:03 a.m. UTC | #4
On 9/9/22 14:54, Miaohe Lin wrote:
> Since commit 8b10b465d0e1 ("mm/page_alloc: free pages in a single pass
> during bulk free"), it's not used anymore. Remove it.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

With those additional changes suggested by Matthew earlier

Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>

> ---
>  include/linux/mmzone.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index d907a29cc429..6950179a20a2 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -569,7 +569,6 @@ enum zone_watermarks {
>   * in the least significant bits.
>   */
>  #define NR_PCP_ORDER_WIDTH 8
> -#define NR_PCP_ORDER_MASK ((1<<NR_PCP_ORDER_WIDTH) - 1)
>  
>  #define min_wmark_pages(z) (z->_watermark[WMARK_MIN] + z->watermark_boost)
>  #define low_wmark_pages(z) (z->_watermark[WMARK_LOW] + z->watermark_boost)
Oscar Salvador Sept. 15, 2022, 4:44 a.m. UTC | #5
On Fri, Sep 09, 2022 at 05:24:38PM +0800, Miaohe Lin wrote:
> Since commit 8b10b465d0e1 ("mm/page_alloc: free pages in a single pass
> during bulk free"), it's not used anymore. Remove it.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

with the changes from Matthew applied:

Reviewed-by: Oscar Salvador <osalvador@suse.de>

> ---
>  include/linux/mmzone.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> index d907a29cc429..6950179a20a2 100644
> --- a/include/linux/mmzone.h
> +++ b/include/linux/mmzone.h
> @@ -569,7 +569,6 @@ enum zone_watermarks {
>   * in the least significant bits.
>   */
>  #define NR_PCP_ORDER_WIDTH 8
> -#define NR_PCP_ORDER_MASK ((1<<NR_PCP_ORDER_WIDTH) - 1)
>  
>  #define min_wmark_pages(z) (z->_watermark[WMARK_MIN] + z->watermark_boost)
>  #define low_wmark_pages(z) (z->_watermark[WMARK_LOW] + z->watermark_boost)
> -- 
> 2.23.0
> 
>
diff mbox series

Patch

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index d907a29cc429..6950179a20a2 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -569,7 +569,6 @@  enum zone_watermarks {
  * in the least significant bits.
  */
 #define NR_PCP_ORDER_WIDTH 8
-#define NR_PCP_ORDER_MASK ((1<<NR_PCP_ORDER_WIDTH) - 1)
 
 #define min_wmark_pages(z) (z->_watermark[WMARK_MIN] + z->watermark_boost)
 #define low_wmark_pages(z) (z->_watermark[WMARK_LOW] + z->watermark_boost)