From: Vinayak Menon <vinmenon@codeaurora.org>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, vdavydov@parallels.com,
mhocko@suse.cz, mgorman@suse.de, minchan@kernel.org
Subject: Re: [PATCH] mm: vmscan: fix the page state calculation in too_many_isolated
Date: Wed, 14 Jan 2015 16:57:59 +0530 [thread overview]
Message-ID: <54B652BF.9020300@codeaurora.org> (raw)
In-Reply-To: <20150113160940.GD8180@phnom.home.cmpxchg.org>
On 01/13/2015 09:39 PM, Johannes Weiner wrote:
> On Tue, Jan 13, 2015 at 04:37:27PM +0530, Vinayak Menon wrote:
>> @@ -1392,6 +1392,44 @@ int isolate_lru_page(struct page *page)
>> return ret;
>> }
>>
>> +static int __too_many_isolated(struct zone *zone, int file,
>> + struct scan_control *sc, int safe)
>> +{
>> + unsigned long inactive, isolated;
>> +
>> + if (file) {
>> + if (safe) {
>> + inactive = zone_page_state_snapshot(zone,
>> + NR_INACTIVE_FILE);
>> + isolated = zone_page_state_snapshot(zone,
>> + NR_ISOLATED_FILE);
>> + } else {
>> + inactive = zone_page_state(zone, NR_INACTIVE_FILE);
>> + isolated = zone_page_state(zone, NR_ISOLATED_FILE);
>> + }
>> + } else {
>> + if (safe) {
>> + inactive = zone_page_state_snapshot(zone,
>> + NR_INACTIVE_ANON);
>> + isolated = zone_page_state_snapshot(zone,
>> + NR_ISOLATED_ANON);
>> + } else {
>> + inactive = zone_page_state(zone, NR_INACTIVE_ANON);
>> + isolated = zone_page_state(zone, NR_ISOLATED_ANON);
>> + }
>> + }
>
> if (safe) {
> inactive = zone_page_state_snapshot(zone, NR_INACTIVE_ANON + 2*file)
> isolated = zone_page_state_snapshot(zone, NR_ISOLATED_ANON + file)
> } else {
> inactive = zone_page_state(zone, NR_INACTIVE_ANON + 2*file)
> isolated = zone_page_state(zone, NR_ISOLATED_ANON + file)
> }
>
Ok. Will change that.
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
member of the Code Aurora Forum, hosted by The Linux Foundation
--
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:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Vinayak Menon <vinmenon@codeaurora.org>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, vdavydov@parallels.com,
mhocko@suse.cz, mgorman@suse.de, minchan@kernel.org
Subject: Re: [PATCH] mm: vmscan: fix the page state calculation in too_many_isolated
Date: Wed, 14 Jan 2015 16:57:59 +0530 [thread overview]
Message-ID: <54B652BF.9020300@codeaurora.org> (raw)
In-Reply-To: <20150113160940.GD8180@phnom.home.cmpxchg.org>
On 01/13/2015 09:39 PM, Johannes Weiner wrote:
> On Tue, Jan 13, 2015 at 04:37:27PM +0530, Vinayak Menon wrote:
>> @@ -1392,6 +1392,44 @@ int isolate_lru_page(struct page *page)
>> return ret;
>> }
>>
>> +static int __too_many_isolated(struct zone *zone, int file,
>> + struct scan_control *sc, int safe)
>> +{
>> + unsigned long inactive, isolated;
>> +
>> + if (file) {
>> + if (safe) {
>> + inactive = zone_page_state_snapshot(zone,
>> + NR_INACTIVE_FILE);
>> + isolated = zone_page_state_snapshot(zone,
>> + NR_ISOLATED_FILE);
>> + } else {
>> + inactive = zone_page_state(zone, NR_INACTIVE_FILE);
>> + isolated = zone_page_state(zone, NR_ISOLATED_FILE);
>> + }
>> + } else {
>> + if (safe) {
>> + inactive = zone_page_state_snapshot(zone,
>> + NR_INACTIVE_ANON);
>> + isolated = zone_page_state_snapshot(zone,
>> + NR_ISOLATED_ANON);
>> + } else {
>> + inactive = zone_page_state(zone, NR_INACTIVE_ANON);
>> + isolated = zone_page_state(zone, NR_ISOLATED_ANON);
>> + }
>> + }
>
> if (safe) {
> inactive = zone_page_state_snapshot(zone, NR_INACTIVE_ANON + 2*file)
> isolated = zone_page_state_snapshot(zone, NR_ISOLATED_ANON + file)
> } else {
> inactive = zone_page_state(zone, NR_INACTIVE_ANON + 2*file)
> isolated = zone_page_state(zone, NR_ISOLATED_ANON + file)
> }
>
Ok. Will change that.
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
member of the Code Aurora Forum, hosted by The Linux Foundation
next prev parent reply other threads:[~2015-01-14 11:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 11:07 [PATCH] mm: vmscan: fix the page state calculation in too_many_isolated Vinayak Menon
2015-01-13 11:07 ` Vinayak Menon
2015-01-13 16:09 ` Johannes Weiner
2015-01-13 16:09 ` Johannes Weiner
2015-01-14 11:27 ` Vinayak Menon [this message]
2015-01-14 11:27 ` Vinayak Menon
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=54B652BF.9020300@codeaurora.org \
--to=vinmenon@codeaurora.org \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@suse.cz \
--cc=minchan@kernel.org \
--cc=vdavydov@parallels.com \
/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.