Re: [PATCH 6.6.y] mm: huge_memory: add vma_thp_disabled() and thp_disabled_by_hw()

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

 



On Tue, Nov 05, 2024 at 05:30:14PM +0100, David Hildenbrand wrote:
> On 05.11.24 13:56, Petr Vaněk wrote:
> > Hi David,
> > 
> 
> Hi Petr,
> 
> > On Tue, Oct 22, 2024 at 11:07:55AM +0200, David Hildenbrand wrote:
> > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> > > index 9aea11b1477c..dfd6577225d8 100644
> > > --- a/mm/huge_memory.c
> > > +++ b/mm/huge_memory.c
> > > @@ -78,19 +78,8 @@ bool hugepage_vma_check(struct vm_area_struct *vma, unsigned long vm_flags,
> > >   	if (!vma->vm_mm)		/* vdso */
> > >   		return false;
> > > -	/*
> > > -	 * Explicitly disabled through madvise or prctl, or some
> > > -	 * architectures may disable THP for some mappings, for
> > > -	 * example, s390 kvm.
> > > -	 * */
> > > -	if ((vm_flags & VM_NOHUGEPAGE) ||
> > > -	    test_bit(MMF_DISABLE_THP, &vma->vm_mm->flags))
> > > -		return false;
> > > -	/*
> > > -	 * If the hardware/firmware marked hugepage support disabled.
> > > -	 */
> > > -	if (transparent_hugepage_flags & (1 << TRANSPARENT_HUGEPAGE_UNSUPPORTED))
> > > -		return false;
> > > +	if (thp_disabled_by_hw() || vma_thp_disabled(vma, vm_flags))
> > > +		return 0;
> > 
> > Shouldn't this return false for consistency with the rest of the
> > function?
> 
> Yes, that's better. Same applies to the 6.1.y backport of this.

Ok, dropping this from the review queue, please resend the updated
versions.

thansk,

greg k-h




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux