Re: [PATCH 01/10] sparc/mm: Fix MAX_ORDER usage in tsb_grow()

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

 



On 3/15/23 12:31, Kirill A. Shutemov wrote:
> MAX_ORDER is not inclusive: the maximum allocation order buddy allocator
> can deliver is MAX_ORDER-1.
> 
> Fix MAX_ORDER usage in tsb_grow().
> 
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>

Acked-by: Vlastimil Babka <vbabka@xxxxxxx>

> Cc: sparclinux@xxxxxxxxxxxxxxx
> Cc: David Miller <davem@xxxxxxxxxxxxx>
> ---
>  arch/sparc/mm/tsb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/sparc/mm/tsb.c b/arch/sparc/mm/tsb.c
> index 912205787161..dba8dffe2113 100644
> --- a/arch/sparc/mm/tsb.c
> +++ b/arch/sparc/mm/tsb.c
> @@ -402,8 +402,8 @@ void tsb_grow(struct mm_struct *mm, unsigned long tsb_index, unsigned long rss)
>  	unsigned long new_rss_limit;
>  	gfp_t gfp_flags;
>  
> -	if (max_tsb_size > (PAGE_SIZE << MAX_ORDER))
> -		max_tsb_size = (PAGE_SIZE << MAX_ORDER);
> +	if (max_tsb_size > (PAGE_SIZE << (MAX_ORDER - 1)))
> +		max_tsb_size = (PAGE_SIZE << (MAX_ORDER - 1));
>  
>  	new_cache_index = 0;
>  	for (new_size = 8192; new_size < max_tsb_size; new_size <<= 1UL) {




[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux