linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Roman Gushchin <klamm@yandex-team.ru>
To: linux-mm@kvack.org
Subject: Question about __zone_reclaim()
Date: Fri, 23 Nov 2012 15:44:43 +0400	[thread overview]
Message-ID: <92581353671083@webcorp2g.yandex-team.ru> (raw)

Hi!

I have a question about __zone_reclaim() function:

mm/vmscan.c:
static int __zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
{
        <cut>
	nr_slab_pages0 = zone_page_state(zone, NR_SLAB_RECLAIMABLE);
        if (nr_slab_pages0 > zone->min_slab_pages) {
               <cut>
                for (;;) {
                        unsigned long lru_pages = zone_reclaimable_pages(zone);

                        /* No reclaimable slab or very low memory pressure */
                        if (!shrink_slab(&shrink, sc.nr_scanned, lru_pages))
                                break;

                        /* Freed enough memory */
                        nr_slab_pages1 = zone_page_state(zone,
                                                        NR_SLAB_RECLAIMABLE);
                        if (nr_slab_pages1 + nr_pages <= nr_slab_pages0)
                                break;
                }
                <cut>

Why we don't stop the for cycle if we meet zone->min_slab_pages watermark?

Is it an issue or do I miss something?

IMHO, we should add something like this:
                        if (nr_slab_pages1 < zone->min_slab_pages)
                                break;

Thank you!

Regards,
Roman

--
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:[~2012-11-23 11:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=92581353671083@webcorp2g.yandex-team.ru \
    --to=klamm@yandex-team.ru \
    --cc=linux-mm@kvack.org \
    /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