From: "Huang\, Ying" <ying.huang@intel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Andrea Arcangeli <aarcange@redhat.com>,
Ebru Akagunduz <ebru.akagunduz@gmail.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>, Tejun Heo <tj@kernel.org>,
Hugh Dickins <hughd@google.com>, Shaohua Li <shli@kernel.org>,
Minchan Kim <minchan@kernel.org>, Rik van Riel <riel@redhat.com>,
cgroups@vger.kernel.org
Subject: Re: [PATCH -mm -v11 1/5] mm, THP, swap: Delay splitting THP during swap out
Date: Thu, 18 May 2017 13:33:47 +0800 [thread overview]
Message-ID: <87k25ed8zo.fsf@yhuang-dev.intel.com> (raw)
In-Reply-To: <20170515112522.32457-2-ying.huang@intel.com> (Ying Huang's message of "Mon, 15 May 2017 19:25:18 +0800")
"Huang, Ying" <ying.huang@intel.com> writes:
> From: Huang Ying <ying.huang@intel.com>
>
> In this patch, splitting huge page is delayed from almost the first
> step of swapping out to after allocating the swap space for the
> THP (Transparent Huge Page) and adding the THP into the swap cache.
> This will batch the corresponding operation, thus improve THP swap out
> throughput.
>
> This is the first step for the THP swap optimization. The plan is to
> delay splitting the THP step by step and avoid splitting the THP
> finally.
>
I found two issues in this patch, could you fold the following fix patch
into the original patch?
Best Regards,
Huang, Ying
------------------------------------------------------------->
From: Huang Ying <ying.huang@intel.com>
Subject: [PATCH] mm, THP, swap: Fix two issues in THP optimize patch
When changing the logic for cluster allocation for THP in
get_swap_page(), I made a mistake so that a normal swap slot may be
allocated for a THP instead of return with failure. This is fixed in
the patch.
And I found two likely/unlikely annotation is wrong in
get_swap_pages(), because that is slow path, I just removed the
likely/unlikely annotation.
Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Minchan Kim <minchan@kernel.org>
---
mm/swap_slots.c | 5 +++--
mm/swapfile.c | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/mm/swap_slots.c b/mm/swap_slots.c
index 78047d1efedd..90c1032a8ac3 100644
--- a/mm/swap_slots.c
+++ b/mm/swap_slots.c
@@ -309,8 +309,9 @@ swp_entry_t get_swap_page(struct page *page)
entry.val = 0;
- if (IS_ENABLED(CONFIG_THP_SWAP) && PageTransHuge(page)) {
- get_swap_pages(1, true, &entry);
+ if (PageTransHuge(page)) {
+ if (IS_ENABLED(CONFIG_THP_SWAP))
+ get_swap_pages(1, true, &entry);
return entry;
}
diff --git a/mm/swapfile.c b/mm/swapfile.c
index f4c0f2a92bf0..984f0dd94948 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -937,13 +937,13 @@ int get_swap_pages(int n_goal, bool cluster, swp_entry_t swp_entries[])
spin_unlock(&si->lock);
goto nextsi;
}
- if (likely(cluster))
+ if (cluster)
n_ret = swap_alloc_cluster(si, swp_entries);
else
n_ret = scan_swap_map_slots(si, SWAP_HAS_CACHE,
n_goal, swp_entries);
spin_unlock(&si->lock);
- if (n_ret || unlikely(cluster))
+ if (n_ret || cluster)
goto check_out;
pr_debug("scan_swap_map of si %d failed to find offset\n",
si->type);
--
2.11.0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-05-18 5:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-15 11:25 [PATCH -mm -v11 0/5] THP swap: Delay splitting THP during swapping out Huang, Ying
2017-05-15 11:25 ` Huang, Ying
2017-05-15 11:25 ` [PATCH -mm -v11 1/5] mm, THP, swap: Delay splitting THP during swap out Huang, Ying
2017-05-15 11:25 ` Huang, Ying
2017-05-18 5:33 ` Huang, Ying [this message]
2017-05-15 11:25 ` [PATCH -mm -v11 2/5] mm, THP, swap: Unify swap slot free functions to put_swap_page Huang, Ying
2017-05-15 11:25 ` Huang, Ying
2017-05-15 11:25 ` [PATCH -mm -v11 3/5] mm, THP, swap: Move anonymous THP split logic to vmscan Huang, Ying
2017-05-15 11:25 ` Huang, Ying
2017-05-15 11:25 ` [PATCH -mm -v11 4/5] mm, THP, swap: Check whether THP can be split firstly Huang, Ying
2017-05-15 11:25 ` Huang, Ying
2017-05-15 11:25 ` [PATCH -mm -v11 5/5] mm, THP, swap: Enable THP swap optimization only if has compound map Huang, Ying
2017-05-15 11:25 ` Huang, Ying
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=87k25ed8zo.fsf@yhuang-dev.intel.com \
--to=ying.huang@intel.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=ebru.akagunduz@gmail.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=minchan@kernel.org \
--cc=riel@redhat.com \
--cc=shli@kernel.org \
--cc=tj@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.