linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Raghavendra D Prabhu <rprabhu@wnohang.net>
To: linux-mm@kvack.org
Subject: Regarding find_get_pages{,_contig}
Date: Sun, 24 Jul 2011 20:09:11 +0530	[thread overview]
Message-ID: <20110724143708.GA5193@Xye> (raw)

Hi mm,

     I was looking to use 

     find_get_pages (struct address_space *mapping, pgoff_t start, unsigned int nr_pages, struct page **pages) 

     and the comment in the code says -- "There may be holes in the
     indices due to not-present pages." I perceived this to be filling
     pages which are in the cache  and skipping the ones which are not
     present -- after the function returns, pages[i] to be not set (NULL
     when pages is from a kzalloc) if corresponding page at index i +
     offset is not in cache ie. a hole. 
     
     But from what I have seen, what it does is set pages[0..nr_in_cache]
     to pages found and rest pages[nr_in_cache + 1 .. nr_pages]  to be
     unset/NULL. By looking at the code, it is calling
     radix_tree_gang_lookup_slot, which again returns entries in a
     similar way and loops nr_found times (and not nr_pages times). I
     looked at the difference between find_get_pages and
     find_get_pages_contig, and the only difference I could spot is it
     increments index which is used only when a condition is true.

     So, does holes in indices mean something else or is there a
     different function which can be used for this ?
--------------------------
Raghavendra Prabhu
GPG Id : 0xD72BE977
Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977
www: wnohang.net

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

                 reply	other threads:[~2011-07-24 14:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20110724143708.GA5193@Xye \
    --to=rprabhu@wnohang.net \
    --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;
as well as URLs for NNTP newsgroup(s).