lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZIBY5niJ/7vvwdHC@dhcp22.suse.cz>
Date:   Wed, 7 Jun 2023 12:16:06 +0200
From:   Michal Hocko <mhocko@...e.com>
To:     Haifeng Xu <haifeng.xu@...pee.com>
Cc:     rppt@...nel.org, akpm@...ux-foundation.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/mm_init.c: add debug messsge for dma zone

On Wed 07-06-23 09:07:34, Haifeng Xu wrote:
> If freesize is less than dma_reserve, print warning message to report
> this case.

Why?

> Signed-off-by: Haifeng Xu <haifeng.xu@...pee.com>
> ---
>  mm/mm_init.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/mm_init.c b/mm/mm_init.c
> index 232efac9a929..9a9d6a52471c 100644
> --- a/mm/mm_init.c
> +++ b/mm/mm_init.c
> @@ -1561,9 +1561,14 @@ static void __init free_area_init_core(struct pglist_data *pgdat)
>  		}
>  
>  		/* Account for reserved pages */
> -		if (j == 0 && freesize > dma_reserve) {
> -			freesize -= dma_reserve;
> -			pr_debug("  %s zone: %lu pages reserved\n", zone_names[0], dma_reserve);
> +		if (j == 0) {
> +			if (freesize >= dma_reserve) {
> +				freesize -= dma_reserve;
> +				pr_debug("  %s zone: %lu pages reserved\n",
> +					 zone_names[0], dma_reserve);
> +			} else
> +				pr_warn("  %s zone: %lu reserved pages exceeds freesize %lu\n",
> +					zone_names[0], dma_reserve, freesize);
>  		}
>  
>  		if (!is_highmem_idx(j))
> -- 
> 2.25.1

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ