From: Tim Chen <tim.c.chen@linux.intel.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Ying Huang <ying.huang@intel.com>,
dave.hansen@intel.com, ak@linux.intel.com, aaron.lu@intel.com,
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>,
Andrea Arcangeli <aarcange@redhat.com>,
"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
Vladimir Davydov <vdavydov.dev@gmail.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Hillf Danton <hillf.zj@alibaba-inc.com>
Subject: Re: [PATCH v2 0/8] mm/swap: Regular page swap optimizations
Date: Fri, 21 Oct 2016 10:40:20 -0700 [thread overview]
Message-ID: <20161021174020.GA29180@linux.intel.com> (raw)
In-Reply-To: <ffa08555-c170-7c6b-0c7e-798e9988adba@de.ibm.com>
On Fri, Oct 21, 2016 at 12:05:19PM +0200, Christian Borntraeger wrote:
> On 10/21/2016 10:16 AM, Christian Borntraeger wrote:
> > [ 308.206297] Call Trace:
> > [ 308.206299] ([<000000000025d3ec>] __alloc_pages_nodemask+0x134/0xdf8)
> > [ 308.206303] ([<0000000000280d6a>] kmalloc_order+0x42/0x70)
> > [ 308.206305] ([<0000000000280dd8>] kmalloc_order_trace+0x40/0xf0)
> > [ 308.206310] ([<00000000002a7090>] init_swap_address_space+0x68/0x138)
> > [ 308.206312] ([<00000000002ac858>] SyS_swapon+0xbd0/0xf80)
> > [ 308.206317] ([<0000000000785476>] system_call+0xd6/0x264)
> > [ 308.206318] Last Breaking-Event-Address:
> > [ 308.206319] [<000000000025db38>] __alloc_pages_nodemask+0x880/0xdf8
> > [ 308.206320] ---[ end trace aaeca736f47ac05b ]---
> >
>
> Looks like that 1TB of swap is just too big for your logic (you try kmalloc without checking the size).
>
Thanks for giving this patch series a spin.
Let's use vzalloc instead. Can you try the following change.
Thanks.
Tim
--->8---
diff --git a/mm/swap_state.c b/mm/swap_state.c
index af4ed5f..0f84526 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -526,11 +526,9 @@ int init_swap_address_space(unsigned int type, unsigned long nr_pages)
unsigned int i, nr;
nr = DIV_ROUND_UP(nr_pages, SWAP_ADDRESS_SPACE_PAGES);
- spaces = kzalloc(sizeof(struct address_space) * nr, GFP_KERNEL);
+ spaces = vzalloc(sizeof(struct address_space) * nr);
if (!spaces) {
- spaces = vzalloc(sizeof(struct address_space) * nr);
- if (!spaces)
- return -ENOMEM;
+ return -ENOMEM;
}
for (i = 0; i < nr; i++) {
space = spaces + i;
--
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>
prev parent reply other threads:[~2016-10-21 17:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-20 23:31 [PATCH v2 0/8] mm/swap: Regular page swap optimizations Tim Chen
2016-10-20 23:31 ` [PATCH v2 1/8] mm/swap: Fix kernel message in swap_info_get() Tim Chen
2016-10-20 23:31 ` [PATCH v2 2/8] mm/swap: Add cluster lock Tim Chen
2016-10-24 16:31 ` Jonathan Corbet
2016-10-25 2:05 ` Huang, Ying
2016-12-28 3:34 ` huang ying
2016-10-20 23:31 ` [PATCH v2 3/8] mm/swap: Split swap cache into 64MB trunks Tim Chen
2016-10-20 23:31 ` [PATCH v2 4/8] mm/swap: skip read ahead for unreferenced swap slots Tim Chen
2016-10-20 23:31 ` [PATCH v2 5/8] mm/swap: Allocate swap slots in batches Tim Chen
2016-10-20 23:31 ` [PATCH v2 6/8] mm/swap: Free swap slots in batch Tim Chen
2016-10-20 23:31 ` [PATCH v2 7/8] mm/swap: Add cache for swap slots allocation Tim Chen
2016-10-20 23:31 ` [PATCH v2 8/8] mm/swap: Enable swap slots cache usage Tim Chen
2016-10-21 8:16 ` [PATCH v2 0/8] mm/swap: Regular page swap optimizations Christian Borntraeger
2016-10-21 10:05 ` Christian Borntraeger
2016-10-21 17:40 ` Tim Chen [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=20161021174020.GA29180@linux.intel.com \
--to=tim.c.chen@linux.intel.com \
--cc=aarcange@redhat.com \
--cc=aaron.lu@intel.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=borntraeger@de.ibm.com \
--cc=dave.hansen@intel.com \
--cc=hannes@cmpxchg.org \
--cc=hillf.zj@alibaba-inc.com \
--cc=hughd@google.com \
--cc=kirill.shutemov@linux.intel.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=vdavydov.dev@gmail.com \
--cc=ying.huang@intel.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;
as well as URLs for NNTP newsgroup(s).