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]
Date:   Mon, 12 Apr 2021 11:28:41 -0700
From:   Mike Kravetz <mike.kravetz@...cle.com>
To:     Miaohe Lin <linmiaohe@...wei.com>, akpm@...ux-foundation.org
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linfeilong@...wei.com
Subject: Re: [PATCH v2 3/5] mm/hugeltb: clarify (chg - freed) won't go
 negative in hugetlb_unreserve_pages()

On 4/10/21 12:23 AM, Miaohe Lin wrote:
> The resv_map could be NULL since this routine can be called in the evict
> inode path for all hugetlbfs inodes and we will have chg = 0 in this case.
> But (chg - freed) won't go negative as Mike pointed out:
> 
>  "If resv_map is NULL, then no hugetlb pages can be allocated/associated
>   with the file.  As a result, remove_inode_hugepages will never find any
>   huge pages associated with the inode and the passed value 'freed' will
>   always be zero."
> 
> Add a comment clarifying this to make it clear and also avoid confusion.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>

Thanks,

Reviewed-by: Mike Kravetz <mike.kravetz@...cle.com>
-- 
Mike Kravetz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ