From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, ziy@nvidia.com, ying.huang@intel.com,
willy@infradead.org, songmuchun@bytedance.com,
apopple@nvidia.com, baolin.wang@linux.alibaba.com,
akpm@linux-foundation.org
Subject: + mm-migrate-simplify-the-refcount-validation-when-migrating-hugetlb-mapping.patch added to -mm tree
Date: Tue, 12 Apr 2022 15:17:56 -0700 [thread overview]
Message-ID: <20220412221757.82147C385A5@smtp.kernel.org> (raw)
The patch titled
Subject: mm: migrate: simplify the refcount validation when migrating hugetlb mapping
has been added to the -mm tree. Its filename is
mm-migrate-simplify-the-refcount-validation-when-migrating-hugetlb-mapping.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/mm-migrate-simplify-the-refcount-validation-when-migrating-hugetlb-mapping.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/mm-migrate-simplify-the-refcount-validation-when-migrating-hugetlb-mapping.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Baolin Wang <baolin.wang@linux.alibaba.com>
Subject: mm: migrate: simplify the refcount validation when migrating hugetlb mapping
There is no need to validate the hugetlb page's refcount before trying to
freeze the hugetlb page's expected refcount, instead we can just rely on
the page_ref_freeze() to simplify the validation.
Moreover we are always under the page lock when migrating the hugetlb page
mapping, which means nowhere else can remove it from the page cache, so we
can remove the xas_load() validation under the i_pages lock.
Link: https://lkml.kernel.org/r/eb2fbbeaef2b1714097b9dec457426d682ee0635.1649676424.git.baolin.wang@linux.alibaba.com
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
--- a/mm/migrate.c~mm-migrate-simplify-the-refcount-validation-when-migrating-hugetlb-mapping
+++ a/mm/migrate.c
@@ -477,11 +477,6 @@ int migrate_huge_page_move_mapping(struc
xas_lock_irq(&xas);
expected_count = 2 + page_has_private(page);
- if (page_count(page) != expected_count || xas_load(&xas) != page) {
- xas_unlock_irq(&xas);
- return -EAGAIN;
- }
-
if (!page_ref_freeze(page, expected_count)) {
xas_unlock_irq(&xas);
return -EAGAIN;
_
Patches currently in -mm which might be from baolin.wang@linux.alibaba.com are
mm-migrate-simplify-the-refcount-validation-when-migrating-hugetlb-mapping.patch
reply other threads:[~2022-04-12 23:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220412221757.82147C385A5@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=songmuchun@bytedance.com \
--cc=willy@infradead.org \
--cc=ying.huang@intel.com \
--cc=ziy@nvidia.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