From: Oleg Nesterov <oleg@redhat.com>
To: Song Liu <songliubraving@fb.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
akpm@linux-foundation.org, matthew.wilcox@oracle.com,
kirill.shutemov@linux.intel.com, kernel-team@fb.com,
william.kucharski@oracle.com, srikar@linux.vnet.ibm.com
Subject: Re: [PATCH v12 3/6] mm, thp: introduce FOLL_SPLIT_PMD
Date: Thu, 8 Aug 2019 18:37:45 +0200 [thread overview]
Message-ID: <20190808163745.GC7934@redhat.com> (raw)
In-Reply-To: <20190807233729.3899352-4-songliubraving@fb.com>
On 08/07, Song Liu wrote:
>
> @@ -399,7 +399,7 @@ static struct page *follow_pmd_mask(struct vm_area_struct *vma,
> spin_unlock(ptl);
> return follow_page_pte(vma, address, pmd, flags, &ctx->pgmap);
> }
> - if (flags & FOLL_SPLIT) {
> + if (flags & (FOLL_SPLIT | FOLL_SPLIT_PMD)) {
> int ret;
> page = pmd_page(*pmd);
> if (is_huge_zero_page(page)) {
> @@ -408,7 +408,7 @@ static struct page *follow_pmd_mask(struct vm_area_struct *vma,
> split_huge_pmd(vma, pmd, address);
> if (pmd_trans_unstable(pmd))
> ret = -EBUSY;
> - } else {
> + } else if (flags & FOLL_SPLIT) {
> if (unlikely(!try_get_page(page))) {
> spin_unlock(ptl);
> return ERR_PTR(-ENOMEM);
> @@ -420,6 +420,10 @@ static struct page *follow_pmd_mask(struct vm_area_struct *vma,
> put_page(page);
> if (pmd_none(*pmd))
> return no_page_table(vma, flags);
> + } else { /* flags & FOLL_SPLIT_PMD */
> + spin_unlock(ptl);
> + split_huge_pmd(vma, pmd, address);
> + ret = pte_alloc(mm, pmd) ? -ENOMEM : 0;
> }
Can't resist, let me repeat that I do not like this patch because imo
it complicates this code for no reason.
But I can't insist and of course I could miss something.
Oleg.
next prev parent reply other threads:[~2019-08-08 16:37 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-07 23:37 [PATCH v12 0/6] THP aware uprobe Song Liu
2019-08-07 23:37 ` [PATCH v12 1/6] mm: move memcmp_pages() and pages_identical() Song Liu
2019-08-07 23:37 ` [PATCH v12 2/6] uprobe: use original page when all uprobes are removed Song Liu
2019-08-07 23:37 ` [PATCH v12 3/6] mm, thp: introduce FOLL_SPLIT_PMD Song Liu
2019-08-08 16:37 ` Oleg Nesterov [this message]
2019-08-08 17:16 ` Song Liu
2019-08-09 16:35 ` Oleg Nesterov
2019-08-09 16:50 ` Song Liu
2019-08-07 23:37 ` [PATCH v12 4/6] uprobe: use FOLL_SPLIT_PMD instead of FOLL_SPLIT Song Liu
2019-08-07 23:37 ` [PATCH v12 5/6] khugepaged: enable collapse pmd for pte-mapped THP Song Liu
2019-08-08 16:33 ` Oleg Nesterov
2019-08-08 17:05 ` Song Liu
2019-08-09 15:24 ` Oleg Nesterov
2019-08-09 16:30 ` Song Liu
2019-08-09 18:01 ` Song Liu
2019-08-12 12:11 ` Kirill A. Shutemov
2019-08-12 13:22 ` Oleg Nesterov
2019-08-12 14:40 ` Kirill A. Shutemov
2019-08-12 21:04 ` Song Liu
2019-08-13 14:44 ` Song Liu
2019-08-15 10:16 ` Oleg Nesterov
2019-08-15 16:27 ` Song Liu
2019-08-13 13:30 ` Oleg Nesterov
2019-08-13 14:05 ` Oleg Nesterov
2019-08-13 15:05 ` Kirill A. Shutemov
2019-08-13 16:24 ` Oleg Nesterov
2019-08-16 14:54 ` Kirill A. Shutemov
2019-08-12 13:06 ` Oleg Nesterov
2019-08-12 14:36 ` Song Liu
2019-08-07 23:37 ` [PATCH v12 6/6] uprobe: collapse THP pmd after removing all uprobes 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=20190808163745.GC7934@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=kernel-team@fb.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew.wilcox@oracle.com \
--cc=songliubraving@fb.com \
--cc=srikar@linux.vnet.ibm.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