linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Schlichter <schlicht@uni-mannheim.de>
To: Andrew Morton <akpm@digeo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC] first try for swap prefetch
Date: Sat, 12 Apr 2003 07:05:05 +0200	[thread overview]
Message-ID: <200304120705.26408.schlicht@uni-mannheim.de> (raw)
In-Reply-To: <20030411143932.6bd0b08a.akpm@digeo.com>

[-- Attachment #1: signed data --]
[-- Type: text/plain, Size: 2410 bytes --]

On April 1, Andrew Morton wrote:
> Thomas Schlichter <schlicht@uni-mannheim.de> wrote:
> > > you can just do
> > >
> > > 	if (radix_tree_delete(...) != -ENOENT)
> > > 		list_del(...)
> > >
> > > +		read_swap_cache_async(entry);
> >
> > Sorry, but I think I can not. The list_del() needs the value returned by
> > radix_tree_lookup(), so I can not kick it...
>
> OK, I'll change radix_tree_delete() to return the deleted object address if
> it was found, else NULL.  That's a better API.

That's right, I like it better that way, too!
Thank you for the patch!

> > Do you know how expensive the radix_tree_lookup() is? O(1) or O(log(n))??
> > For my shame I do not really know that data structure... :-(
>
> It is proportional to
>
> 	log_base_64(largest index which the tree has ever stored)
>
> log_base_64: because each node has 64 slots.  Each time maxindex grows by a
> factor of 64 we need to introduce a new level.
>
> "largest index ever": because we do not (and cannot feasibly) reduce the
> height when items are removed.

Thanks for the detailed answer.

> > > It might make sense to poke the speculative swapin code in the
> > > page-freeing path too.
> >
> > I wanted to do this but don't know which function is the correct one for
> > this. But I will search harder... or can you give me a hint?
>
> free_pages_bulk() would probably suit.

I don't think so, as this is part of the buddy allocator which controls the 
usage of the physical memory. Now I've implemented following:

1. Add an entry when a page is removed by the kswapd.
2. Remove the entry when the page is added to the page_cache.
3. Remove the entry when the page is removed from the page_cache.

So with point 3 I cover the freeing of the pages. But as the kswapd calls the 
function from 3, too, I do the 1st point after kswapd did do point3...

To finish my second (and surely better) try I just need one more 
information...

How can I get the file pointer for a buffered page with the information 
available in the kswapd (minly the page struct)??

This is very importand because, as described above, I extract the needed 
information for my prefetch daemon in the kswapd. My daemon needs the file 
pointer to be able to load the buffer pages with the page_cache_read() 
function from the mm/filemap.c file.

I'm sorry if I bother you...

Best regards
   Thomas

[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2003-04-12  4:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-10 17:47 [RFC] first try for swap prefetch Thomas Schlichter
2003-04-10 23:18 ` Andrew Morton
2003-04-11 11:51   ` Thomas Schlichter
2003-04-11 12:13     ` William Lee Irwin III
2003-04-11 12:21     ` John Bradford
2003-04-11 12:22       ` Zwane Mwaikambo
2003-04-11 13:29         ` John Bradford
2003-04-11 21:39     ` Andrew Morton
2003-04-12  5:05       ` Thomas Schlichter [this message]
2003-04-12  5:37         ` Andrew Morton
2003-04-17 16:02           ` [RFC] second try for swap prefetch (does Oops!) Thomas Schlichter
2003-04-11 16:57 [RFC] first try for swap prefetch Chuck Ebbert

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=200304120705.26408.schlicht@uni-mannheim.de \
    --to=schlicht@uni-mannheim.de \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).