From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Hugh Dickins <hugh@veritas.com>
Cc: Robin Holt <holt@sgi.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: munmap extremely slow even with untouched mapping.
Date: Mon, 31 Oct 2005 20:19:48 +1100 [thread overview]
Message-ID: <4365E1B4.4050409@yahoo.com.au> (raw)
In-Reply-To: <4365DF9A.5040101@yahoo.com.au>
Nick Piggin wrote:
> The address based work estimate for unmapping (for lockbreak) is and
> always was horribly inefficient for sparse mappings. The problem is most
> simply explained with an example:
>
> If we find a pgd is clear, we still have to call into unmap_page_range
> PGDIR_SIZE / ZAP_BLOCK_SIZE times, each time checking the clear pgd, in
> order to progress the working address to the next pgd.
>
> The fundamental way to solve the problem is to keep track of the end address
> we've processed and pass it back to the higher layers.
>
> From: Robin Holt <holt@sgi.com>
>
> Modification to completely get away from address based work estimate and
> instead use an abstract count, with a very small cost for empty entries as
> opposed to present pages.
>
> On 2.6.14-git2, ppc64, and CONFIG_PREEMPT=y, mapping and unmapping 1TB of
> virtual address space takes 1.69s; with the following patch applied, this
> operation can be done 1000 times in less than 0.01s
>
> Signed-off-by: Nick Piggin <npiggin@suse.de>
>
Note that I think this patch will cripple our nice page table folding
in the unmap path, due to no longer using the 'next' from p??_addr_end,
even if the compiler is very smart.
I haven't confirmed this by looking at assembly, however I'd be almost
sure this is the case. Possibly a followup patch would be in order so
as to restore this, but I couldn't think of a really nice way to do it.
Basically we only want to return the return of the next level
zap_p??_range in the case that it returns with zap_work < 0.
--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com
--
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:[~2005-10-31 9:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-28 1:37 Robin Holt
2005-10-28 10:45 ` Nick Piggin
2005-10-28 15:20 ` Hugh Dickins
2005-10-30 4:29 ` Nick Piggin
2005-10-30 16:58 ` Hugh Dickins
2005-10-31 9:10 ` Nick Piggin
2005-10-31 9:19 ` Nick Piggin [this message]
2005-10-31 12:20 ` Robin Holt
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=4365E1B4.4050409@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=holt@sgi.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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