From: Andrew Morton <akpm@linux-foundation.org>
To: Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com>
Cc: linux-ext4@vger.kernel.org, sct@redhat.com,
linux-fsdevel@vger.kernel.org
Subject: Re: [RFC][PATCH] JBD: release checkpoint journal heads through try_to_release_page when the memory is exhausted
Date: Mon, 27 Oct 2008 14:26:57 -0700 [thread overview]
Message-ID: <20081027142657.2120aa3f.akpm@linux-foundation.org> (raw)
In-Reply-To: <20081023174101.85b59177.toshi.okajima@jp.fujitsu.com>
(added linux-fsdevel)
On Thu, 23 Oct 2008 17:41:01 +0900
Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com> wrote:
> Hi Andrew.
>
> > > rather costly. An alternative might be to implement a shrinker
> > > callback function for the journal_head slab cache. Did you consider
> > > this?
> > Yes.
> > But the unused-list and counters are required by managing the shrink targets("journal head")
> > if we implement a shrinker.
> > I thought that comparatively big code changes were necessary for jbd to accomplish it.
>
> > However I will try it.
>
> I managed to build a shrinker callback function for the journal_head slab cache.
> This code size is less than before but the logic of it seems to be more complex
> than before.
> However, I haven't got any troubles while I am testing some easy load operations
> on the fixed kernel.
> But I think a system may hang up if concurrently several journal_head shrinker
> are executed.
> So, I will retry to build more appropriate fix.
yeah, that's not very pretty either, is it?
> Please give me comments if you have a nicer idea.
Stepping back a bit...
The basic problem is, I believe, that some client of the blockdev
(ext3) is adding metadata to the blockdev's data structures
(buffer_heads) but we have no means by which the blockdev code can call
back into that client requesting that the metadata be released, yes?
We can fix the problem which you've identified by adding a means for
the blockdev code (def_blk_aops.releasepage()) to call back into ext3,
yes?
If so, how do we do that?
I seem to recall that there's code somewhere in the tree which does
things like taking a copy of bdev->address_space_operations and
reinstalling that, and overwriting selected fields, and then arranging
somehow for the old value to be reinstalled when the client releases
the blockdev. That's plain nasty.
Perhaps what we could do is to add a new
blkdev_register_releasepage(struct block-device *,
int (*)(struct page *, gfp_t)
function and call that from within ext3 initialisation. (This could be
a block_device_operations entry, but is there any point in doing that?)
Within blkdev_register_releasepage(), record the address of that
function in the `struct block_device' (with what locking??) and then
implement def_blk_aops.releasepage(), which calls
bdev->registered_releasepage(). Set def_blk_aops.releaspage() to point
at try_to_free_buffers() to provide the default behaviour.
Then we'd need a blkdev_unregister_releasepage() which restores the old
value. Or, better, make blkdev_register_releasepage()
return the old value and require that clients of the blockdev (ie:
ext3) restore the old value prior to releasing the blockdev.
Or something along these lines, anyway..
next parent reply other threads:[~2008-10-27 21:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20081017.223716.147444348.00960188@stratos.soft.fujitsu.com>
[not found] ` <20081020160249.ff41f762.akpm@linux-foundation.org>
[not found] ` <20081023174101.85b59177.toshi.okajima@jp.fujitsu.com>
2008-10-27 21:26 ` Andrew Morton [this message]
2008-10-28 2:46 ` [RFC][PATCH] JBD: release checkpoint journal heads through try_to_release_page when the memory is exhausted Toshiyuki Okajima
2008-11-05 4:11 ` [PATCH][BUG] jbd: fix the root cause of "no transactions" error in __log_wait_for_space() Toshiyuki Okajima
2008-11-05 13:53 ` Theodore Tso
2008-11-07 3:17 ` Toshiyuki Okajima
2008-11-12 7:49 ` [PATCH 0/3][RFC] release block-device-mapping buffer_heads which have the filesystem private data for avoiding oom-killer Toshiyuki Okajima
2008-11-12 7:51 ` [PATCH 1/3][RFC] vfs: " Toshiyuki Okajima
2008-11-12 7:53 ` [PATCH 2/3][RFC] ext3: " Toshiyuki Okajima
2008-11-12 7:55 ` [PATCH 3/3][RFC] ext4: " Toshiyuki Okajima
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=20081027142657.2120aa3f.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=sct@redhat.com \
--cc=toshi.okajima@jp.fujitsu.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).