From: Song Liu <songliubraving@fb.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux MM <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
"Matthew Wilcox" <matthew.wilcox@oracle.com>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Kernel Team <Kernel-team@fb.com>,
"William Kucharski" <william.kucharski@oracle.com>,
"srikar@linux.vnet.ibm.com" <srikar@linux.vnet.ibm.com>,
Johannes Weiner <hannes@cmpxchg.org>,
"Kirill A. Shutemov" <kirill@shutemov.name>
Subject: Re: [PATCH v12 5/6] khugepaged: enable collapse pmd for pte-mapped THP
Date: Tue, 13 Aug 2019 14:44:40 +0000 [thread overview]
Message-ID: <857DA509-D891-4F4C-A55C-EE58BC2CC452@fb.com> (raw)
In-Reply-To: <2D11C742-BB7E-4296-9E97-5114FA58474B@fb.com>
Hi Oleg,
> On Aug 12, 2019, at 2:04 PM, Song Liu <songliubraving@fb.com> wrote:
>
>
>
>> On Aug 12, 2019, at 7:40 AM, Kirill A. Shutemov <kirill@shutemov.name> wrote:
>>
>> On Mon, Aug 12, 2019 at 03:22:58PM +0200, Oleg Nesterov wrote:
>>> On 08/12, Kirill A. Shutemov wrote:
>>>>
>>>> On Fri, Aug 09, 2019 at 06:01:18PM +0000, Song Liu wrote:
>>>>> + if (pte_none(*pte) || !pte_present(*pte))
>>>>> + continue;
>>>>
>>>> You don't need to check both. Present is never none.
>>>
>>> Agreed.
>>>
>>> Kirill, while you are here, shouldn't retract_page_tables() check
>>> vma->anon_vma (and probably do mm_find_pmd) under vm_mm->mmap_sem?
>>>
>>> Can't it race with, say, do_cow_fault?
>>
>> vma->anon_vma can race, but it doesn't matter. False-negative is fine.
>> It's attempt to avoid taking mmap_sem where it can be not productive.
>>
>> mm_find_pmd() cannot race with do_cow_fault() since the page is locked.
>> __do_fault() has to return locked page before we touch page tables.
>> It is somewhat subtle, but I wanted to avoid taking mmap_sem where it is
>> possible.
>>
>> --
>> Kirill A. Shutemov
>
> Updated version attached.
>
>
> Besides feedbacks from Oleg and Kirill, I also revise the locking in
> collapse_pte_mapped_thp(): use pte_offset_map_lock() for the two loops
> to cover highmem. zap_pte_range() has similar use of the lock.
>
> This change is suggested by Johannes.
>
Do you have further comments for the version below? If not, could you
please reply with your Acked-by or Reviewed-by?
Thanks,
Song
>
> ================ 8< ======================
> From 3d931bc4780abb6109fe478a4b1a0004ce81efe1 Mon Sep 17 00:00:00 2001
> From: Song Liu <songliubraving@fb.com>
> Date: Sun, 28 Jul 2019 03:43:48 -0700
> Subject: [PATCH 5/6] khugepaged: enable collapse pmd for pte-mapped THP
>
[...]
next prev parent reply other threads:[~2019-08-13 14:44 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
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 [this message]
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=857DA509-D891-4F4C-A55C-EE58BC2CC452@fb.com \
--to=songliubraving@fb.com \
--cc=Kernel-team@fb.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew.wilcox@oracle.com \
--cc=oleg@redhat.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