Re: [PATCH 02/10] mm/mremap: refactor initial parameter sanity checks

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

 



On 7/7/25 07:27, Lorenzo Stoakes wrote:
> We are currently checking some things later, and some things
> immediately. Aggregate the checks and avoid ones that need not be made.
> 
> Simplify things by aligning lengths immediately. Defer setting the delta
> parameter until later, which removes some duplicate code in the hugetlb
> case.
> 
> We can safely perform the checks moved from mremap_to() to
> check_mremap_params() because:
> 
> * If we set a new address via vrm_set_new_addr(), then this is guaranteed
>   to not overlap nor to position the new VMA past TASK_SIZE, so there's no
>   need to check these later.
> 
> * We can simply page align lengths immediately. We do not need to check for
>   overlap nor TASK_SIZE sanity after hugetlb alignment as this asserts
>   addresses are huge-aligned, then huge-aligns lengths, rounding down. This
>   means any existing overlap would have already been caught.
> 
> Moving things around like this lays the groundwork for subsequent changes
> to permit operations on batches of VMAs.
> 
> No functional change intended.
> 
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>

Reviewed-by: Vlastimil Babka <vbabka@xxxxxxx>





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux