linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 11/12] mm, thp, tmpfs: enable thp page cache in tmpfs
@ 2013-10-15  0:18 Ning Qu
  2013-10-15 11:09 ` Kirill A. Shutemov
  0 siblings, 1 reply; 5+ messages in thread
From: Ning Qu @ 2013-10-15  0:18 UTC (permalink / raw)
  To: Andrea Arcangeli, Andrew Morton, Kirill A. Shutemov, Hugh Dickins
  Cc: Al Viro, Hugh Dickins, Wu Fengguang, Jan Kara, Mel Gorman,
	linux-mm, Andi Kleen, Matthew Wilcox, Hillf Danton, Dave Hansen,
	Alexander Shishkin, linux-fsdevel, linux-kernel, Ning Qu

Signed-off-by: Ning Qu <quning@gmail.com>
---
 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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH 11/12] mm, thp, tmpfs: enable thp page cache in tmpfs
  2013-10-15  0:18 [PATCH 11/12] mm, thp, tmpfs: enable thp page cache in tmpfs Ning Qu
@ 2013-10-15 11:09 ` Kirill A. Shutemov
  2013-10-15 18:42   ` Ning Qu
  0 siblings, 1 reply; 5+ messages in thread
From: Kirill A. Shutemov @ 2013-10-15 11:09 UTC (permalink / raw)
  To: Ning Qu
  Cc: Andrea Arcangeli, Andrew Morton, Kirill A. Shutemov,
	Hugh Dickins, Al Viro, Hugh Dickins, Wu Fengguang, Jan Kara,
	Mel Gorman, linux-mm, Andi Kleen, Matthew Wilcox, Hillf Danton,
	Dave Hansen, Alexander Shishkin, linux-fsdevel, linux-kernel,
	Ning Qu

Ning Qu wrote:
> Signed-off-by: Ning Qu <quning@gmail.com>
> ---
>  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);

Unlike ramfs, tmpfs pages are movable before transparent page cache
patchset.
Making tmpfs pages non-movable looks like a big regression to me. It need
to be fixed before proposing it upstream.

-- 
 Kirill A. Shutemov

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 11/12] mm, thp, tmpfs: enable thp page cache in tmpfs
  2013-10-15 11:09 ` Kirill A. Shutemov
@ 2013-10-15 18:42   ` Ning Qu
  2013-10-18 18:24     ` Ning Qu
  0 siblings, 1 reply; 5+ messages in thread
From: Ning Qu @ 2013-10-15 18:42 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Andrea Arcangeli, Andrew Morton, Hugh Dickins, Al Viro,
	Wu Fengguang, Jan Kara, Mel Gorman, linux-mm, Andi Kleen,
	Matthew Wilcox, Hillf Danton, Dave Hansen, Alexander Shishkin,
	linux-fsdevel, linux-kernel

I agree with this. It has been like this just for a quick proof, but I
need to address this problem as soon as possible.

Thanks!
Best wishes,
-- 
Ning Qu (曲宁) | Software Engineer | quning@google.com | +1-408-418-6066


On Tue, Oct 15, 2013 at 4:09 AM, Kirill A. Shutemov
<kirill.shutemov@linux.intel.com> wrote:
> Ning Qu wrote:
>> Signed-off-by: Ning Qu <quning@gmail.com>
>> ---
>>  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);
>
> Unlike ramfs, tmpfs pages are movable before transparent page cache
> patchset.
> Making tmpfs pages non-movable looks like a big regression to me. It need
> to be fixed before proposing it upstream.
>
> --
>  Kirill A. Shutemov

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 11/12] mm, thp, tmpfs: enable thp page cache in tmpfs
  2013-10-15 18:42   ` Ning Qu
@ 2013-10-18 18:24     ` Ning Qu
  2013-10-18 22:16       ` Ning Qu
  0 siblings, 1 reply; 5+ messages in thread
From: Ning Qu @ 2013-10-18 18:24 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Andrea Arcangeli, Andrew Morton, Hugh Dickins, Al Viro,
	Wu Fengguang, Jan Kara, Mel Gorman, linux-mm, Andi Kleen,
	Matthew Wilcox, Hillf Danton, Dave Hansen, Alexander Shishkin,
	linux-fsdevel, linux-kernel

I guess this is the last review I have for this around, but not sure
what's the best solution right now.

Kirill, do you think it's OK to just split the huge page when it will
be moved. Will look into how thp anon handle this situation.

Then after this, I probably will post v2.

Thanks!
Best wishes,
-- 
Ning Qu (曲宁) | Software Engineer | quning@google.com | +1-408-418-6066


On Tue, Oct 15, 2013 at 11:42 AM, Ning Qu <quning@google.com> wrote:
> I agree with this. It has been like this just for a quick proof, but I
> need to address this problem as soon as possible.
>
> Thanks!
> Best wishes,
> --
> Ning Qu (曲宁) | Software Engineer | quning@google.com | +1-408-418-6066
>
>
> On Tue, Oct 15, 2013 at 4:09 AM, Kirill A. Shutemov
> <kirill.shutemov@linux.intel.com> wrote:
>> Ning Qu wrote:
>>> Signed-off-by: Ning Qu <quning@gmail.com>
>>> ---
>>>  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);
>>
>> Unlike ramfs, tmpfs pages are movable before transparent page cache
>> patchset.
>> Making tmpfs pages non-movable looks like a big regression to me. It need
>> to be fixed before proposing it upstream.
>>
>> --
>>  Kirill A. Shutemov

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 11/12] mm, thp, tmpfs: enable thp page cache in tmpfs
  2013-10-18 18:24     ` Ning Qu
@ 2013-10-18 22:16       ` Ning Qu
  0 siblings, 0 replies; 5+ messages in thread
From: Ning Qu @ 2013-10-18 22:16 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Andrea Arcangeli, Andrew Morton, Hugh Dickins, Al Viro,
	Wu Fengguang, Jan Kara, Mel Gorman, linux-mm, Andi Kleen,
	Matthew Wilcox, Hillf Danton, Dave Hansen, Alexander Shishkin,
	linux-fsdevel, linux-kernel

Hi, Kirill,

I have reviewed the current migration code and seems huge page will
get splitted during migration. Since our current split_huge_page
handle file cache as well, it seems not a problem for us?

We just simply not removing the __GFP_MOVABLE flag? Anything else I am
missing here?

Thanks!
Best wishes,
-- 
Ning Qu (曲宁) | Software Engineer | quning@google.com | +1-408-418-6066


On Fri, Oct 18, 2013 at 11:24 AM, Ning Qu <quning@google.com> wrote:
> I guess this is the last review I have for this around, but not sure
> what's the best solution right now.
>
> Kirill, do you think it's OK to just split the huge page when it will
> be moved. Will look into how thp anon handle this situation.
>
> Then after this, I probably will post v2.
>
> Thanks!
> Best wishes,
> --
> Ning Qu (曲宁) | Software Engineer | quning@google.com | +1-408-418-6066
>
>
> On Tue, Oct 15, 2013 at 11:42 AM, Ning Qu <quning@google.com> wrote:
>> I agree with this. It has been like this just for a quick proof, but I
>> need to address this problem as soon as possible.
>>
>> Thanks!
>> Best wishes,
>> --
>> Ning Qu (曲宁) | Software Engineer | quning@google.com | +1-408-418-6066
>>
>>
>> On Tue, Oct 15, 2013 at 4:09 AM, Kirill A. Shutemov
>> <kirill.shutemov@linux.intel.com> wrote:
>>> Ning Qu wrote:
>>>> Signed-off-by: Ning Qu <quning@gmail.com>
>>>> ---
>>>>  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);
>>>
>>> Unlike ramfs, tmpfs pages are movable before transparent page cache
>>> patchset.
>>> Making tmpfs pages non-movable looks like a big regression to me. It need
>>> to be fixed before proposing it upstream.
>>>
>>> --
>>>  Kirill A. Shutemov

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-10-18 22:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-15  0:18 [PATCH 11/12] mm, thp, tmpfs: enable thp page cache in tmpfs Ning Qu
2013-10-15 11:09 ` Kirill A. Shutemov
2013-10-15 18:42   ` Ning Qu
2013-10-18 18:24     ` Ning Qu
2013-10-18 22:16       ` Ning Qu

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).