From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757302Ab3JOASc (ORCPT ); Mon, 14 Oct 2013 20:18:32 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:57395 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756734Ab3JOASb (ORCPT ); Mon, 14 Oct 2013 20:18:31 -0400 Date: Mon, 14 Oct 2013 17:18:26 -0700 From: Ning Qu To: Andrea Arcangeli , Andrew Morton , "Kirill A. Shutemov" , Hugh Dickins Cc: Al Viro , Hugh Dickins , Wu Fengguang , Jan Kara , Mel Gorman , linux-mm@kvack.org, Andi Kleen , Matthew Wilcox , Hillf Danton , Dave Hansen , Alexander Shishkin , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Ning Qu Subject: [PATCH 11/12] mm, thp, tmpfs: enable thp page cache in tmpfs Message-ID: <20131015001826.GL3432@hippobay.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Ning Qu --- mm/Kconfig | 4 ++-- mm/shmem.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mm/Kconfig b/mm/Kconfig index 562f12f..4d2f90f 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -428,8 +428,8 @@ config TRANSPARENT_HUGEPAGE_PAGECACHE help Enabling the option adds support hugepages for file-backed mappings. It requires transparent hugepage support from - filesystem side. For now, the only filesystem which supports - hugepages is ramfs. + filesystem side. For now, the filesystems which support + hugepages are: ramfs and tmpfs. config CROSS_MEMORY_ATTACH bool "Cross Memory Support" diff --git a/mm/shmem.c b/mm/shmem.c index 75c0ac6..50a3335 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1672,6 +1672,11 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode break; case S_IFREG: inode->i_mapping->a_ops = &shmem_aops; + /* + * TODO: make tmpfs pages movable + */ + mapping_set_gfp_mask(inode->i_mapping, + GFP_TRANSHUGE & ~__GFP_MOVABLE); inode->i_op = &shmem_inode_operations; inode->i_fop = &shmem_file_operations; mpol_shared_policy_init(&info->policy, -- 1.8.4