From: Hugh Dickins <hughd@google.com>
To: Shaohua Li <shli@kernel.org>
Cc: Sasha Levin <sasha.levin@oracle.com>,
Andrew Morton <akpm@linux-foundation.org>,
Shaohua Li <shli@fusionio.com>, Rik van Riel <riel@redhat.com>,
Minchan Kim <minchan@kernel.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: boot warnings due to swap: make each swap partition have one address_space
Date: Sun, 3 Feb 2013 21:12:05 -0800 (PST) [thread overview]
Message-ID: <alpine.LNX.2.00.1302032056550.4662@eggly.anvils> (raw)
In-Reply-To: <20130130095944.GA11457@kernel.org>
On Wed, 30 Jan 2013, Shaohua Li wrote:
> On Sun, Jan 27, 2013 at 01:40:40PM -0800, Hugh Dickins wrote:
> >
> > I'm glad Minchan has now pointed you to Rik's posting of two years ago:
> > I think there are more important changes to be made in that direction.
>
> Not sure how others use multiple swaps, but current lock contention forces us
> to use multiple swaps. I haven't carefully think about Rik's posting, but looks
> it doesn't solve the lock contention problem.
Nobody had reported any swap lock contention problem before your patch,
so no, Rik's posting wasn't directed at that. I always thought swap
writing patterns a much bigger problem.
But if lock contention there is, then I think it can be implemented
with reducing that in mind. There are two levels of allocation: one
to allocate the tokens which we will insert in page tables, and one
to allocate the final diskspace to which those tokens will point.
(I may be using totally different language from Rik,
it's the principles that I have in mind, not his actual posting.)
Allocating the tokens can very well be done with per-cpu batches,
perhaps of SWAP_CLUSTER_MAX 32 to match vmscan.c's batching: there
is no significance to their ordering. And allocating the diskspace
would want to be done in batches, to maximize contiguous writing.
That may not solve all the swap_info_get() contention which you saw,
but should help some.
I'm thinking that we go with your per-swapper-space locking for now;
but I wouldn't mind taking it out again later, if we arrive at a
better solution which benefits even those with a single swap area.
Hugh
--
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:[~2013-02-04 5:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-25 3:45 Sasha Levin
2013-01-25 4:25 ` Shaohua Li
2013-01-25 23:37 ` Sasha Levin
2013-01-27 2:16 ` Hugh Dickins
2013-01-27 14:12 ` Shaohua Li
2013-01-27 21:40 ` Hugh Dickins
2013-01-29 15:56 ` Valdis.Kletnieks
2013-01-30 9:59 ` Shaohua Li
2013-02-04 5:12 ` Hugh Dickins [this message]
2013-01-27 21:47 ` [PATCH next/mmotm] swap: add per-partition lock for swapfile fix Hugh Dickins
2013-01-28 0:07 ` Shaohua Li
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=alpine.LNX.2.00.1302032056550.4662@eggly.anvils \
--to=hughd@google.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=riel@redhat.com \
--cc=sasha.levin@oracle.com \
--cc=shli@fusionio.com \
--cc=shli@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox