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] [day] [month] [year] [list]
Message-ID: <3bd0c129-fdca-4f30-b5a6-c0b8d997d3e6@linux.alibaba.com>
Date: Fri, 26 Jul 2024 09:09:30 +0800
From: Baolin Wang <baolin.wang@...ux.alibaba.com>
To: David Hildenbrand <david@...hat.com>, Ryan Roberts
 <ryan.roberts@....com>, akpm@...ux-foundation.org, hughd@...gle.com
Cc: willy@...radead.org, 21cnbao@...il.com, ziy@...dia.com,
 ioworker0@...il.com, linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/3] mm: shmem: move shmem_huge_global_enabled() into
 shmem_allowable_huge_orders()



On 2024/7/25 21:09, David Hildenbrand wrote:
>>>>    /*
>>>> @@ -1625,27 +1632,39 @@ static gfp_t limit_gfp_mask(gfp_t huge_gfp, 
>>>> gfp_t limit_gfp)
>>>>    #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>>>>    unsigned long shmem_allowable_huge_orders(struct inode *inode,
>>>>                    struct vm_area_struct *vma, pgoff_t index,
>>>> -                bool global_huge)
>>>> +                bool shmem_huge_force)
>>>>    {
>>>>        unsigned long mask = READ_ONCE(huge_shmem_orders_always);
>>>>        unsigned long within_size_orders = 
>>>> READ_ONCE(huge_shmem_orders_within_size);
>>>> -    unsigned long vm_flags = vma->vm_flags;
>>>> +    unsigned long vm_flags = vma ? vma->vm_flags : 0;
>>>> +    struct mm_struct *fault_mm = vma ? vma->vm_mm : NULL;
>>>
>>> nit: rather than deriving the fault_mm here, I wonder if its cleaner 
>>> to just
>>> pass vma to shmem_huge_global_enabled()? shmem_huge_global_enabled() 
>>> is just
>>> using it as a guard to access vm_flags, which you can just as easily 
>>> do by
>>> testing the vma for non-NULL. And you can access mm flags with 
>>> vma->vm_mm->flags
>>> after testing the vma too.
>>
>> Make sense to me, and will do in next version.
> 
> Feel free to add my
> 
> Acked-by: David Hildenbrand <david@...hat.com>

Thanks David.

Andrew has already queued my v3 patchset into the mm-unstable branch.

Andrew, please help to add David's acked tag for v3 series. Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ