linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Bradley Christiansen <bradc1@us.ibm.com>
To: linux-mm@kvack.org
Subject: PageReserved increment patch
Date: Fri, 23 Apr 2004 11:31:21 -0700	[thread overview]
Message-ID: <1082745080.1854.30.camel@DYN318078BLD.beaverton.ibm.com> (raw)

Here is a short patch that addresses a problem I found where page->count
gets incremented for all pages in page_cache_get/get_page, but in
put_page it is only decremented for non reserved pages.  

I noticed this problem while trying to keep track of how memory is
allocated and noticing that the zero page count variable was continually
being incremented but never decremented.  This created some very large
counts on the zero page, and while this probably wont hurt anything it
just doesn't seem like its right.

This patch only fixes the problem I know of with the zero page, and
there is still a potential imbalance for any reserved page calling
page_cache_get/get_page.

Brad



--- linux-2.6.4/mm/memory.c     Wed Mar 10 18:55:26 2004
+++ linux-2.6.4-brad/mm/memory.c        Thu Apr 22 16:00:38 2004
@@ -1050,7 +1050,9 @@
        /*
         * Ok, we need to copy. Oh, well..
         */
-       page_cache_get(old_page);
+       if (!PageReserved(old_page))
+               page_cache_get(old_page);
+
        spin_unlock(&mm->page_table_lock);
  
        pte_chain = pte_chain_alloc(GFP_KERNEL);

--
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>

                 reply	other threads:[~2004-04-23 18:30 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=1082745080.1854.30.camel@DYN318078BLD.beaverton.ibm.com \
    --to=bradc1@us.ibm.com \
    --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