From: "Huang\, Ying" <ying.huang@intel.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: "Huang, Ying" <ying.huang@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Hugh Dickins <hughd@google.com>, Shaohua Li <shli@kernel.org>,
Minchan Kim <minchan@kernel.org>, Rik van Riel <riel@redhat.com>
Subject: Re: [PATCH -mm -v6 1/9] mm, swap: Make swap cluster size same of THP size on x86_64
Date: Thu, 09 Mar 2017 09:45:11 +0800 [thread overview]
Message-ID: <87k27zi5p4.fsf@yhuang-dev.intel.com> (raw)
In-Reply-To: <20170308125631.GX16328@bombadil.infradead.org> (Matthew Wilcox's message of "Wed, 8 Mar 2017 04:56:31 -0800")
Hi, Matthew,
Matthew Wilcox <willy@infradead.org> writes:
> On Wed, Mar 08, 2017 at 03:26:05PM +0800, Huang, Ying wrote:
>> In this patch, the size of the swap cluster is changed to that of the
>> THP (Transparent Huge Page) on x86_64 architecture (512). This is for
>> the THP swap support on x86_64. Where one swap cluster will be used to
>> hold the contents of each THP swapped out. And some information of the
>> swapped out THP (such as compound map count) will be recorded in the
>> swap_cluster_info data structure.
>>
>> For other architectures which want THP swap support,
>> ARCH_USES_THP_SWAP_CLUSTER need to be selected in the Kconfig file for
>> the architecture.
>>
>> In effect, this will enlarge swap cluster size by 2 times on x86_64.
>> Which may make it harder to find a free cluster when the swap space
>> becomes fragmented. So that, this may reduce the continuous swap space
>> allocation and sequential write in theory. The performance test in 0day
>> shows no regressions caused by this.
>
> Well ... if there are no regressions found, why not change it
> unconditionally? The value '256' seems relatively arbitrary (I bet it
> was tuned by some doofus with a 486, 8MB RAM and ST506 hard drive ...
> it certainly hasn't changed since git started in 2005)
>
> Might be worth checking with the PowerPC people to see if their larger
> pages causes this smaller patch to perform badly:
I found the huge page size is large not only on PowerPC, for example, on
MIPS, the PMD_SHIFT could be from 21 to 29, depends on configuration. I
don't know the situation for the other architectures. So I thought it
may be better to let the architecture developers to determine whether to
make the change and under which configuration.
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -199,7 +199,7 @@ static void discard_swap_cluster(struct swap_info_struct *si,
> }
> }
>
> -#define SWAPFILE_CLUSTER 256
> +#define SWAPFILE_CLUSTER HPAGE_PMD_NR
> #define LATENCY_LIMIT 256
>
> static inline void cluster_set_flag(struct swap_cluster_info *info,
Best Regards,
Huang, Ying
--
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-03-09 1:45 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 7:26 [PATCH -v6 0/9] THP swap: Delay splitting THP during swapping out Huang, Ying
2017-03-08 7:26 ` [PATCH -mm -v6 1/9] mm, swap: Make swap cluster size same of THP size on x86_64 Huang, Ying
2017-03-08 12:56 ` Matthew Wilcox
2017-03-09 1:45 ` Huang, Ying [this message]
2017-03-08 7:26 ` [PATCH -mm -v6 2/9] mm, memcg: Support to charge/uncharge multiple swap entries Huang, Ying
2017-03-08 11:37 ` Balbir Singh
2017-03-09 1:28 ` Huang, Ying
2017-03-09 21:22 ` Balbir Singh
2017-03-08 7:26 ` [PATCH -mm -v6 3/9] mm, THP, swap: Add swap cluster allocate/free functions Huang, Ying
2017-03-14 23:13 ` Tim Chen
2017-03-15 1:19 ` Huang, Ying
2017-03-15 17:15 ` Tim Chen
2017-03-16 6:31 ` Huang, Ying
2017-03-08 7:26 ` [PATCH -mm -v6 4/9] mm, THP, swap: Add get_huge_swap_page() Huang, Ying
2017-03-14 23:40 ` Tim Chen
2017-03-15 1:08 ` Huang, Ying
2017-03-08 7:26 ` [PATCH -mm -v6 5/9] mm, THP, swap: Support to clear SWAP_HAS_CACHE for huge page Huang, Ying
2017-03-15 0:14 ` Tim Chen
2017-03-15 0:54 ` Huang, Ying
2017-03-08 7:26 ` [PATCH -mm -v6 6/9] mm, THP, swap: Support to add/delete THP to/from swap cache Huang, Ying
2017-03-08 7:26 ` [PATCH -mm -v6 7/9] mm, THP: Add can_split_huge_page() Huang, Ying
2017-03-08 7:26 ` [PATCH -mm -v6 8/9] mm, THP, swap: Support to split THP in swap cache Huang, Ying
2017-03-08 7:26 ` [PATCH -mm -v6 9/9] mm, THP, swap: Delay splitting THP during swap out 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=87k27zi5p4.fsf@yhuang-dev.intel.com \
--to=ying.huang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=riel@redhat.com \
--cc=shli@kernel.org \
--cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).