From: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
To: Bob Liu <lliubbo@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
Lisa Du <cldu@marvell.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Christoph Lameter <cl@linux.com>, Mel Gorman <mgorman@suse.de>
Subject: Re: Possible deadloop in direct reclaim?
Date: Mon, 29 Jul 2013 12:46:17 -0400 [thread overview]
Message-ID: <51F69C59.10307@gmail.com> (raw)
In-Reply-To: <CAA_GA1frSpEzKraDAuM2hMgwPcu76NfJEATAKBrDco25B-TRyA@mail.gmail.com>
(7/25/13 9:22 PM), Bob Liu wrote:
> Hi Kosaki,
>
> On Fri, Jul 26, 2013 at 2:14 AM, KOSAKI Motohiro
> <kosaki.motohiro@gmail.com> wrote:
>>> How about replace the checking in kswapd_shrink_zone()?
>>>
>>> @@ -2824,7 +2824,7 @@ static bool kswapd_shrink_zone(struct zone *zone,
>>> /* Account for the number of pages attempted to reclaim */
>>> *nr_attempted += sc->nr_to_reclaim;
>>>
>>> - if (nr_slab == 0 && !zone_reclaimable(zone))
>>> + if (sc->nr_reclaimed == 0 && !zone_reclaimable(zone))
>>> zone->all_unreclaimable = 1;
>>>
>>> zone_clear_flag(zone, ZONE_WRITEBACK);
>>>
>>>
>>> I think the current check is wrong, reclaimed a slab doesn't mean
>>> reclaimed a page.
>>
>> The code is correct, at least, it works as intentional. page reclaim
>> status is checked by zone_reclaimable() and slab shrinking status is
>> checked by nr_slab.
>
> I'm afraid in some special cases, nr_slab = 1 or any small number
> which means we reclaimed some slab objects.
> Then we don't set zone->all_unreclaimeabled =1.
>
> But even though we reclaimed some slab objects, there may be no pages freed.
> Because one page may contain several objects.
Right. This is a limitation of current slab shrinker's implementation.
We are welcome you contribution this area.
> If we reclaimed some slab objects but without actual pages, we need to
> set zone->all_unreclaimeabled=1!
> So I think we should check sc->nr_reclaimed == 0 instead of nr_slab == 0.
sc->nr_reclaimed doesn't check how much pages freed from slab.
--
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>
next prev parent reply other threads:[~2013-07-29 16:45 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-23 4:58 Possible deadloop in direct reclaim? Lisa Du
2013-07-23 20:28 ` Christoph Lameter
2013-07-24 1:21 ` Lisa Du
2013-07-25 18:19 ` KOSAKI Motohiro
2013-07-26 1:11 ` Lisa Du
2013-07-29 16:44 ` KOSAKI Motohiro
2013-07-30 1:27 ` Lisa Du
2013-08-01 2:24 ` Lisa Du
2013-08-01 2:45 ` KOSAKI Motohiro
2013-08-01 4:21 ` Bob Liu
2013-08-03 21:22 ` KOSAKI Motohiro
2013-08-04 23:50 ` Minchan Kim
2013-08-01 5:19 ` Lisa Du
2013-08-01 8:56 ` Russell King - ARM Linux
2013-08-02 1:18 ` Lisa Du
2013-07-29 1:32 ` Lisa Du
2013-07-24 1:18 ` Bob Liu
2013-07-24 1:31 ` Lisa Du
2013-07-24 2:23 ` Lisa Du
2013-07-24 3:38 ` Bob Liu
2013-07-24 5:58 ` Lisa Du
2013-07-25 18:14 ` KOSAKI Motohiro
2013-07-26 1:22 ` Bob Liu
2013-07-29 16:46 ` KOSAKI Motohiro [this message]
2013-08-01 5:43 ` Minchan Kim
2013-08-01 6:13 ` Lisa Du
2013-08-01 7:33 ` Minchan Kim
2013-08-01 8:20 ` Lisa Du
2013-08-01 8:42 ` Minchan Kim
2013-08-02 1:03 ` Lisa Du
2013-08-02 2:26 ` Minchan Kim
2013-08-02 2:33 ` Minchan Kim
2013-08-02 3:17 ` Lisa Du
2013-08-02 3:53 ` Minchan Kim
2013-08-02 8:08 ` Lisa Du
2013-08-04 23:47 ` 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=51F69C59.10307@gmail.com \
--to=kosaki.motohiro@gmail.com \
--cc=cl@linux.com \
--cc=cldu@marvell.com \
--cc=linux-mm@kvack.org \
--cc=lliubbo@gmail.com \
--cc=mgorman@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).