linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lance Yang <ioworker0@gmail.com>
To: david@redhat.com, akpm@linux-foundation.org
Cc: 21cnbao@gmail.com, baolin.wang@linux.alibaba.com,
	fengwei.yin@intel.com, ioworker0@gmail.com,
	libang.li@antgroup.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, maskray@google.com, mhocko@suse.com,
	minchan@kernel.org, peterx@redhat.com, ryan.roberts@arm.com,
	shy828301@gmail.com, sj@kernel.org, songmuchun@bytedance.com,
	wangkefeng.wang@huawei.com, willy@infradead.org,
	xiehuan09@gmail.com, ziy@nvidia.com, zokeefe@google.com
Subject: Re: [PATCH v8 3/3] mm/vmscan: avoid split lazyfree THP during shrink_folio_list()
Date: Sat, 22 Jun 2024 18:00:57 +0800	[thread overview]
Message-ID: <20240622100057.3352-1-ioworker0@gmail.com> (raw)
In-Reply-To: <e7c0aff1-b690-4926-9a34-4e32c9f3faaa@redhat.com>

Hi Andrew,

I made some minor changes suggested by David[1]. Could you please fold the
following changes into this patch?

[1] https://lore.kernel.org/linux-mm/e7c0aff1-b690-4926-9a34-4e32c9f3faaa@redhat.com/

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 4b2817bb2c7d..0cb52ae29259 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2693,21 +2693,11 @@ static bool __discard_anon_folio_pmd_locked(struct vm_area_struct *vma,
 					    unsigned long addr, pmd_t *pmdp,
 					    struct folio *folio)
 {
-	VM_WARN_ON_FOLIO(folio_test_swapbacked(folio), folio);
-	VM_WARN_ON_FOLIO(!folio_test_anon(folio), folio);
-
 	struct mm_struct *mm = vma->vm_mm;
 	int ref_count, map_count;
 	pmd_t orig_pmd = *pmdp;
 	struct page *page;
 
-	if (unlikely(!pmd_present(orig_pmd) || !pmd_trans_huge(orig_pmd)))
-		return false;
-
-	page = pmd_page(orig_pmd);
-	if (unlikely(page_folio(page) != folio))
-		return false;
-
 	if (folio_test_dirty(folio) || pmd_dirty(orig_pmd))
 		return false;
 
diff --git a/mm/rmap.c b/mm/rmap.c
index df1a43295c85..b358501fb7e8 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1678,9 +1678,8 @@ static bool try_to_unmap_one(struct folio *folio, struct vm_area_struct *vma,
 
 			if (flags & TTU_SPLIT_HUGE_PMD) {
 				/*
-				 * We temporarily have to drop the PTL and start
-				 * once again from that now-PTE-mapped page
-				 * table.
+				 * We temporarily have to drop the PTL and
+				 * restart so we can process the PTE-mapped THP.
 				 */
 				split_huge_pmd_locked(vma, pvmw.address,
 						      pvmw.pmd, false, folio);
-- 

Thanks,
Lance


      parent reply	other threads:[~2024-06-22 10:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14  1:51 [PATCH v8 0/3] Reclaim lazyfree THP without splitting Lance Yang
2024-06-14  1:51 ` [PATCH v8 1/3] mm/rmap: remove duplicated exit code in pagewalk loop Lance Yang
2024-06-14  1:51 ` [PATCH v8 2/3] mm/rmap: integrate PMD-mapped folio splitting into " Lance Yang
2024-06-14  7:34   ` David Hildenbrand
2024-06-14  7:46     ` Lance Yang
2024-06-14 14:26   ` Zi Yan
2024-06-14 14:41     ` Lance Yang
2024-06-14  1:51 ` [PATCH v8 3/3] mm/vmscan: avoid split lazyfree THP during shrink_folio_list() Lance Yang
2024-06-17 18:04   ` David Hildenbrand
2024-06-18  1:56     ` Lance Yang
2024-06-22 10:00     ` Lance Yang [this message]

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=20240622100057.3352-1-ioworker0@gmail.com \
    --to=ioworker0@gmail.com \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@redhat.com \
    --cc=fengwei.yin@intel.com \
    --cc=libang.li@antgroup.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maskray@google.com \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    --cc=peterx@redhat.com \
    --cc=ryan.roberts@arm.com \
    --cc=shy828301@gmail.com \
    --cc=sj@kernel.org \
    --cc=songmuchun@bytedance.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=willy@infradead.org \
    --cc=xiehuan09@gmail.com \
    --cc=ziy@nvidia.com \
    --cc=zokeefe@google.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