[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1e635cfd-d461-4e56-95b8-c6ea512f64ca@redhat.com>
Date: Thu, 25 Jul 2024 15:09:38 +0200
From: David Hildenbrand <david@...hat.com>
To: Baolin Wang <baolin.wang@...ux.alibaba.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()
>>> /*
>>> @@ -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>
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists