All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH] mmtom: Prevent shrinking of active anon lru list in case of no swap space V2
Date: Thu, 14 May 2009 09:18:57 -0400	[thread overview]
Message-ID: <4A0C1A41.7040202@redhat.com> (raw)
In-Reply-To: <28c262360905140609y580b6835m759dee08f08a26ab@mail.gmail.com>

Minchan Kim wrote:
> HI, Rik
> 
> Thanks for careful review. :)
> 
> On Thu, May 14, 2009 at 9:58 PM, Rik van Riel <riel@redhat.com> wrote:
>> Minchan Kim wrote:
>>
>>> Now shrink_active_list is called several places.
>>> But if we don't have a swap space, we can't reclaim anon pages.
>> If swap space has run out, get_scan_ratio() will return
>> 0 for the anon scan ratio, meaning we do not scan the
>> anon lists.
> 
> I think get_scan_ration can't prevent scanning of anon pages in no
> swap system(like embedded system).
> That's because in shrink_zone, you add following as
> 
>         /*
>          * Even if we did not try to evict anon pages at all, we want to
>          * rebalance the anon lru active/inactive ratio.
>          */
>         if (inactive_anon_is_low(zone, sc))
>                 shrink_active_list(SWAP_CLUSTER_MAX, zone, sc, priority, 0);

That's a fair point.

How about we change this to:

	if (inactive_anon_is_low(zone, sc) && nr_swap_pages >= 0)

That way GCC will statically optimize away this branch on
systems with CONFIG_SWAP=n.

Does that look reasonable?

-- 
All rights reversed.

WARNING: multiple messages have this Message-ID (diff)
From: Rik van Riel <riel@redhat.com>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mm <linux-mm@kvack.org>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH] mmtom: Prevent shrinking of active anon lru list in case of no swap space V2
Date: Thu, 14 May 2009 09:18:57 -0400	[thread overview]
Message-ID: <4A0C1A41.7040202@redhat.com> (raw)
In-Reply-To: <28c262360905140609y580b6835m759dee08f08a26ab@mail.gmail.com>

Minchan Kim wrote:
> HI, Rik
> 
> Thanks for careful review. :)
> 
> On Thu, May 14, 2009 at 9:58 PM, Rik van Riel <riel@redhat.com> wrote:
>> Minchan Kim wrote:
>>
>>> Now shrink_active_list is called several places.
>>> But if we don't have a swap space, we can't reclaim anon pages.
>> If swap space has run out, get_scan_ratio() will return
>> 0 for the anon scan ratio, meaning we do not scan the
>> anon lists.
> 
> I think get_scan_ration can't prevent scanning of anon pages in no
> swap system(like embedded system).
> That's because in shrink_zone, you add following as
> 
>         /*
>          * Even if we did not try to evict anon pages at all, we want to
>          * rebalance the anon lru active/inactive ratio.
>          */
>         if (inactive_anon_is_low(zone, sc))
>                 shrink_active_list(SWAP_CLUSTER_MAX, zone, sc, priority, 0);

That's a fair point.

How about we change this to:

	if (inactive_anon_is_low(zone, sc) && nr_swap_pages >= 0)

That way GCC will statically optimize away this branch on
systems with CONFIG_SWAP=n.

Does that look reasonable?

-- 
All rights reversed.

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

  reply	other threads:[~2009-05-14 13:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-14 11:11 [PATCH] mmtom: Prevent shrinking of active anon lru list in case of no swap space V2 Minchan Kim
2009-05-14 11:11 ` Minchan Kim
2009-05-14 11:25 ` KOSAKI Motohiro
2009-05-14 11:25   ` KOSAKI Motohiro
2009-05-14 11:44   ` KOSAKI Motohiro
2009-05-14 11:44     ` KOSAKI Motohiro
2009-05-14 12:05     ` Minchan Kim
2009-05-14 12:05       ` Minchan Kim
2009-05-14 12:11       ` KOSAKI Motohiro
2009-05-14 12:11         ` KOSAKI Motohiro
2009-05-14 12:35         ` Minchan Kim
2009-05-14 12:35           ` Minchan Kim
2009-05-14 12:58 ` Rik van Riel
2009-05-14 12:58   ` Rik van Riel
2009-05-14 13:09   ` Minchan Kim
2009-05-14 13:09     ` Minchan Kim
2009-05-14 13:18     ` Rik van Riel [this message]
2009-05-14 13:18       ` Rik van Riel
2009-05-14 13:33       ` Minchan Kim
2009-05-14 13:33         ` Minchan Kim

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=4A0C1A41.7040202@redhat.com \
    --to=riel@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan.kim@gmail.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.