From: Andrew Morton <akpm@osdl.org>
To: Nikita Danilov <nikita@clusterfs.com>
Cc: pmarques@grupopie.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, hch@infradead.org
Subject: Re: [RFC] per thread page reservation patch
Date: Fri, 7 Jan 2005 13:24:59 -0800 [thread overview]
Message-ID: <20050107132459.033adc9f.akpm@osdl.org> (raw)
In-Reply-To: <m1llb5q7qs.fsf@clusterfs.com>
Nikita Danilov <nikita@clusterfs.com> wrote:
>
> That's the whole idea behind this patch: at the beginning of "atomic"
> operation, some number of pages is reserved. As these pages are
> available through page allocator, _all_ allocations done by atomic
> operation will use reserved pages transparently. For example:
>
> perthread_pages_reserve(nr, GFP_KERNEL);
>
> foo()->
>
> bar()->
>
> page = find_or_create_page(some_mapping, ...);
>
> perthread_pages_release(unused_pages);
>
> find_or_create() pages will use pages reserved for this thread and,
> hence, is guaranteed to succeed (given correct reservation).
>
> Alternative is to pass some sort of handle all the way down to actual
> calls to allocator, and to modify all generic code to use reservations.
Maybe I'm being thick, but I don't see how you can protect the reservation
of an outer reserver in the above way:
perthread_pages_reserve(10);
... /* current->private_pages_count = 10 */
perthread_pages_reserve(10) /* private_pages_count = 20 */
use 5 pages /* private_pages_count = 15 */
perthread_pages_release(5);
But how does the caller come up with the final "5"?
Seems better to me if prethread_pages_reserve() were to return the initial
value of private_pages_count, so the caller can do:
old = perthread_pages_reserve(10);
use 5 pages
perthread_pages_release(old);
or whatever.
That kinda stinks too in a way, because both the outer and the inner
callers need to overallocate pages on behalf of the worst case user in some
deep call stack.
And the whole idea is pretty flaky really - how can one precalculate how
much memory an arbitrary md-on-dm-on-loop-on-md-on-NBD stack will want to
use? It really would be better if we could drop the whole patch and make
reiser4 behave more sanely when its writepage is called with for_reclaim=1.
--
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:"aart@kvack.org"> aart@kvack.org </a>
next prev parent reply other threads:[~2005-01-07 21:24 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20050103011113.6f6c8f44.akpm@osdl.org>
[not found] ` <20050103114854.GA18408@infradead.org>
[not found] ` <41DC2386.9010701@namesys.com>
[not found] ` <1105019521.7074.79.camel@tribesman.namesys.com>
[not found] ` <20050107144644.GA9606@infradead.org>
2005-01-07 17:16 ` Vladimir Saveliev
2005-01-07 18:48 ` Andrew Morton
2005-01-07 20:21 ` Nikita Danilov
2005-01-07 19:05 ` Christoph Hellwig
2005-01-07 19:12 ` Christoph Hellwig
2005-01-07 19:21 ` Robert Love
2005-01-07 20:48 ` Nikita Danilov
2005-01-07 20:54 ` Christoph Hellwig
2005-01-07 21:00 ` Nikita Danilov
2005-01-07 21:07 ` Christoph Hellwig
2005-01-07 19:14 ` Paulo Marques
2005-01-07 19:32 ` Christoph Hellwig
2005-01-07 19:42 ` Andi Kleen
2005-01-07 20:55 ` Nikita Danilov
2005-01-07 21:24 ` Andrew Morton [this message]
2005-01-07 21:24 ` Andi Kleen
2005-01-07 22:12 ` Nikita Danilov
2005-01-07 23:03 ` Andrew Morton
2005-01-07 23:17 ` Nikita Danilov
2005-01-07 23:43 ` Andrew Morton
2005-01-08 12:44 ` Nikita Danilov
2005-01-08 13:43 ` Hugh Dickins
2005-01-09 11:35 ` Marcelo Tosatti
2005-01-09 18:16 ` Nikita Danilov
2005-01-25 16:39 ` reiser4 core patches: [Was: [RFC] per thread page reservation patch] Vladimir Saveliev
2005-01-27 10:37 ` Adrian Bunk
2005-01-27 11:01 ` Christoph Hellwig
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=20050107132459.033adc9f.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nikita@clusterfs.com \
--cc=pmarques@grupopie.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