lkml.org 
[lkml]   [2019]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 08/11] mm: convert vma_interval_tree to half closed intervals
On Thu, Oct 03, 2019 at 01:18:55PM -0700, Davidlohr Bueso wrote:
> +++ b/mm/nommu.c
> @@ -1793,7 +1793,7 @@ int nommu_shrink_inode_mappings(struct inode *inode, size_t size,
> size_t r_size, r_top;
>
> low = newsize >> PAGE_SHIFT;
> - high = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
> + high = (size + PAGE_SIZE) >> PAGE_SHIFT;

Uhh ... are you sure about this? size is in bytes here, and we're rounding
up to the next page size. So if size is [1-4096], then we add on 4095 and get
the answer 1. With your patch, if size is [0-4095], we get the answer 1.
I think you meant:

high = ((size + PAGE_SIZE - 1) >> PAGE_SHIFT) + 1;

\
 
 \ /
  Last update: 2019-10-03 22:41    [W:0.205 / U:2.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site