lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <28c262360905140633q3a7ace7byec2f47b0f0d2e78d@mail.gmail.com>
Date:	Thu, 14 May 2009 22:33:16 +0900
From:	Minchan Kim <minchan.kim@...il.com>
To:	Rik van Riel <riel@...hat.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	linux-mm <linux-mm@...ck.org>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Johannes Weiner <hannes@...xchg.org>
Subject: Re: [PATCH] mmtom: Prevent shrinking of active anon lru list in case 
	of no swap space V2

On Thu, May 14, 2009 at 10:18 PM, Rik van Riel <riel@...hat.com> wrote:
> Minchan Kim wrote:
>>
>> HI, Rik
>>
>> Thanks for careful review. :)
>>
>> On Thu, May 14, 2009 at 9:58 PM, Rik van Riel <riel@...hat.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?

Now inactive_anon_is_low called following as.

1. shrink_zone => Looks good since your idea.
2. balance_pgdat => Looks good since aging.
3. shrink_list
shrink_list is called at two places.
1. shrink_zone => It's OK since get_scan_ratio can't prevent it.
2. shrink_all_zones. => It's OK since we can't suspend without swap space.

So, Okay I will do that in next version.
Thanks for good review. Rik :)
Could I add your ack in next version ?

> --
> All rights reversed.
>



-- 
Kinds regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ