From: Wang Sheng-Hui <shhuiw@gmail.com>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, mel@csn.ul.ie
Subject: Question about mm/compaction.c/acct_isolated: computing nr_anon, nr_file
Date: Fri, 25 Nov 2011 13:42:43 +0800 [thread overview]
Message-ID: <4ECF2AD3.5050801@gmail.com> (raw)
Why does it double the number in line 233/234?
222/* Update the number of anon and file isolated pages in the zone */
223static void acct_isolated(struct zone *zone, struct compact_control *cc)
224{
225 struct page *page;
226 unsigned int count[NR_LRU_LISTS] = { 0, };
227
228 list_for_each_entry(page, &cc->migratepages, lru) {
229 int lru = page_lru_base_type(page);
230 count[lru]++;
231 }
232
233 cc->nr_anon = count[LRU_ACTIVE_ANON] + count[LRU_INACTIVE_ANON];
234 cc->nr_file = count[LRU_ACTIVE_FILE] + count[LRU_INACTIVE_FILE];
235 __mod_zone_page_state(zone, NR_ISOLATED_ANON, cc->nr_anon);
236 __mod_zone_page_state(zone, NR_ISOLATED_FILE, cc->nr_file);
237}
thanks,
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Wang Sheng-Hui <shhuiw@gmail.com>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, mel@csn.ul.ie
Subject: Question about mm/compaction.c/acct_isolated: computing nr_anon, nr_file
Date: Fri, 25 Nov 2011 13:42:43 +0800 [thread overview]
Message-ID: <4ECF2AD3.5050801@gmail.com> (raw)
Why does it double the number in line 233/234?
222/* Update the number of anon and file isolated pages in the zone */
223static void acct_isolated(struct zone *zone, struct compact_control *cc)
224{
225 struct page *page;
226 unsigned int count[NR_LRU_LISTS] = { 0, };
227
228 list_for_each_entry(page, &cc->migratepages, lru) {
229 int lru = page_lru_base_type(page);
230 count[lru]++;
231 }
232
233 cc->nr_anon = count[LRU_ACTIVE_ANON] + count[LRU_INACTIVE_ANON];
234 cc->nr_file = count[LRU_ACTIVE_FILE] + count[LRU_INACTIVE_FILE];
235 __mod_zone_page_state(zone, NR_ISOLATED_ANON, cc->nr_anon);
236 __mod_zone_page_state(zone, NR_ISOLATED_FILE, cc->nr_file);
237}
thanks,
next reply other threads:[~2011-11-25 5:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-25 5:42 Wang Sheng-Hui [this message]
2011-11-25 5:42 ` Question about mm/compaction.c/acct_isolated: computing nr_anon, nr_file Wang Sheng-Hui
2011-11-25 8:03 ` Wang Sheng-Hui
2011-11-25 8:03 ` Wang Sheng-Hui
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=4ECF2AD3.5050801@gmail.com \
--to=shhuiw@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.