linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@fb.com>
To: Song Liu <songliubraving@fb.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Cc: "matthew.wilcox@oracle.com" <matthew.wilcox@oracle.com>,
	"kirill.shutemov@linux.intel.com"
	<kirill.shutemov@linux.intel.com>,
	"Kernel Team" <Kernel-team@fb.com>,
	"william.kucharski@oracle.com" <william.kucharski@oracle.com>,
	"chad.mynhier@oracle.com" <chad.mynhier@oracle.com>,
	"mike.kravetz@oracle.com" <mike.kravetz@oracle.com>
Subject: Re: [PATCH v2 3/3] mm,thp: add read-only THP support for (non-shmem) FS
Date: Mon, 17 Jun 2019 15:42:13 +0000	[thread overview]
Message-ID: <e4b7a74c400a8b337af0f019d770c96ba6a23675.camel@fb.com> (raw)
In-Reply-To: <20190614182204.2673660-4-songliubraving@fb.com>

On Fri, 2019-06-14 at 11:22 -0700, Song Liu wrote:
> 
> +#ifdef CONFIG_READ_ONLY_THP_FOR_FS
> +	if (shmem_file(vma->vm_file) ||
> +	    (vma->vm_file && (vm_flags & VM_DENYWRITE))) {
> +#else
>  	if (shmem_file(vma->vm_file)) {
> +#endif
>  		if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGE_PAGECACHE))
>  			return false;

Future cleanup idea: could it be nice to hide the
above behind a "vma_can_have_file_thp" function or
similar?

That inline function could also have a comment explaining
why the check is the way it is.

OTOH, I guess this series is just the first step towards
more complete functionality, and things are likely to change
again soon(ish).

> @@ -1628,14 +1692,14 @@ static void khugepaged_scan_shmem(struct
> mm_struct *mm,
>  			result = SCAN_EXCEED_NONE_PTE;
>  		} else {
>  			node = khugepaged_find_target_node();
> -			collapse_shmem(mm, mapping, start, hpage,
> node);
> +			collapse_file(vma, mapping, start, hpage,
> node);
>  		}
>  	}

If for some reason you end up posting a v3 of this
series, the s/_shmem/_file/ renaming could be broken
out into its own patch.

All the code looks good though.

Acked-by: Rik van Riel <riel@surriel.com>


  reply	other threads:[~2019-06-17 15:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 18:22 [PATCH v2 0/3] Enable THP for text section of non-shmem files Song Liu
2019-06-14 18:22 ` [PATCH v2 1/3] mm: check compound_head(page)->mapping in filemap_fault() Song Liu
2019-06-17 14:59   ` Rik van Riel
2019-06-14 18:22 ` [PATCH v2 2/3] mm,thp: stats for file backed THP Song Liu
2019-06-17 15:00   ` Rik van Riel
2019-06-21 12:50   ` Kirill A. Shutemov
2019-06-21 14:09     ` Song Liu
2019-06-14 18:22 ` [PATCH v2 3/3] mm,thp: add read-only THP support for (non-shmem) FS Song Liu
2019-06-17 15:42   ` Rik van Riel [this message]
2019-06-21 12:58   ` Kirill A. Shutemov
2019-06-21 13:08     ` Song Liu
2019-06-21 13:11       ` Kirill A. Shutemov
2019-06-18 21:12 ` [PATCH v2 0/3] Enable THP for text section of non-shmem files Andrew Morton
2019-06-18 21:48   ` Song Liu
2019-06-20  1:13     ` Andrew Morton
2019-06-20  2:04       ` Song Liu
2019-06-19  6:26   ` Song Liu

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=e4b7a74c400a8b337af0f019d770c96ba6a23675.camel@fb.com \
    --to=riel@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=chad.mynhier@oracle.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-mm@kvack.org \
    --cc=matthew.wilcox@oracle.com \
    --cc=mike.kravetz@oracle.com \
    --cc=songliubraving@fb.com \
    --cc=william.kucharski@oracle.com \
    /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).