linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
To: Ning Qu <quning@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Hugh Dickins <hughd@google.com>,
	Al Viro <viro@zeniv.linux.org.uk>Hugh Dickins <hughd@google.com>,
	Wu Fengguang <fengguang.wu@intel.com>, Jan Kara <jack@suse.cz>,
	Mel Gorman <mgorman@suse.de>,
	linux-mm@kvack.org, Andi Kleen <ak@linux.intel.com>,
	Matthew Wilcox <willy@linux.intel.com>,
	Hillf Danton <dhillf@gmail.com>, Dave Hansen <dave@sr71.net>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: RE: [PATCH 05/12] mm, thp, tmpfs: request huge page in shm_fault when needed
Date: Tue, 15 Oct 2013 13:37:44 +0300 (EEST)	[thread overview]
Message-ID: <20131015103744.A0BD3E0090@blue.fi.intel.com> (raw)
In-Reply-To: <20131015001242.GF3432@hippobay.mtv.corp.google.com>

Ning Qu wrote:
> Add the function to request huge page in shm_fault when needed.
> And it will fall back to regular page if huge page can't be
> satisfied or allocated.
> 
> If small page requested but huge page is found, the huge page will
> be splitted.
> 
> Signed-off-by: Ning Qu <quning@gmail.com>
> ---
>  mm/shmem.c | 32 +++++++++++++++++++++++++++++---
>  1 file changed, 29 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 68a0e1d..2fc450d 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -1472,19 +1472,45 @@ unlock:
>  static int shmem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
>  {
>  	struct inode *inode = file_inode(vma->vm_file);
> +	struct page *page = NULL;
>  	int error;
>  	int ret = VM_FAULT_LOCKED;
>  	gfp_t gfp = mapping_gfp_mask(inode->i_mapping);
> -
> -	error = shmem_getpage(inode, vmf->pgoff, &vmf->page, SGP_CACHE, gfp,
> -				0, &ret);
> +	bool must_use_thp = vmf->flags & FAULT_FLAG_TRANSHUGE;
> +	int flags = 0;
> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE_PAGECACHE
> +	flags |= AOP_FLAG_TRANSHUGE;
> +#endif

ifdef is not needed: shmem_getpage will ignore AOP_FLAG_TRANSHUGE if
CONFIG_TRANSPARENT_HUGEPAGE_PAGECACHE is not defined.

-- 
 Kirill A. Shutemov

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2013-10-15 10:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-15  0:12 [PATCH 05/12] mm, thp, tmpfs: request huge page in shm_fault when needed Ning Qu
2013-10-15 10:37 ` Kirill A. Shutemov [this message]
2013-10-15 18:49   ` Ning Qu
2013-10-16 18:29     ` Ning Qu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131015103744.A0BD3E0090@blue.fi.intel.com \
    --to=kirill.shutemov@linux.intel.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=quning@google.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).