linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Chow <davidchow@shaolinmicro.com>
To: Matthew Wilcox <willy@debian.org>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: freeing pagecache
Date: Sun, 29 Sep 2002 23:12:09 +0800	[thread overview]
Message-ID: <3D971849.3010106@shaolinmicro.com> (raw)
In-Reply-To: 20020929143807.E18377@parcelfarce.linux.theplanet.co.uk

Matthew Wilcox wrote:

>On Sun, Sep 29, 2002 at 08:00:36PM +0800, David Chow wrote:
>  
>
>>cache... The reason I am asking the question is that if I am safe to 
>>make use of an unlocked mapped pagecahed page. Thanks for comments and 
>>answers.
>>    
>>
>
>You don't need to lock it, just bump its page count.  include/linux/mm.h:
>
> * Also, many kernel routines increase the page count before a critical
> * routine so they can be sure the page doesn't go away from under them.
> */
>#define get_page(p)             atomic_inc(&(p)->count)
>#define put_page(p)             __free_page(p)
>
>  
>


I've read about the struct page, I thought it is some kind of lru 
algorithm used by kswapd, that measn pagecache is just like dcache which 
has usage counts. There are a couple listhead, is there any listhead 
that are not used for a pagecached page? If there are something that I 
can make use, I can simply use the listhead for my list... but I am not 
sure are there any potential hazards. Thanks for helps, comments are 
welcome.

David


      reply	other threads:[~2002-09-29 15:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-29 12:00 freeing pagecache David Chow
2002-09-29 13:38 ` Matthew Wilcox
2002-09-29 15:12   ` David Chow [this message]

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=3D971849.3010106@shaolinmicro.com \
    --to=davidchow@shaolinmicro.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=willy@debian.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).