Re: [PATCH] support tmpfs hugepage PMD is not split when COW

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

 



On Wed, Jan 10, 2024 at 05:20:28PM +0800, Chen Haixiang wrote:
> +++ b/include/linux/mm.h
> @@ -573,6 +573,7 @@ struct vm_operations_struct {
>  			unsigned long end, unsigned long newflags);
>  	vm_fault_t (*fault)(struct vm_fault *vmf);
>  	vm_fault_t (*huge_fault)(struct vm_fault *vmf, unsigned int order);
> +	vm_fault_t (*shmem_huge_fault)(struct vm_fault *vmf, pmd_t orig_pmd);

No new operation for this.

> +++ b/mm/memory.c
> @@ -4942,6 +4942,13 @@ static inline vm_fault_t wp_huge_pmd(struct vm_fault *vmf)
>  		}
>  	}
>  
> +	if (vmf->vma->vm_ops->shmem_huge_fault) {
> +		vm_fault_t ret = vmf->vma->vm_ops->shmem_huge_fault(vmf, vmf->orig_pmd);
> +
> +		if (!(ret & VM_FAULT_FALLBACK))
> +			return ret;
> +	}

Why would you do this when ->huge_fault is called in the stanza above?





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux