linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Question about __zone_reclaim()
@ 2012-11-23 11:44 Roman Gushchin
  0 siblings, 0 replies; only message in thread
From: Roman Gushchin @ 2012-11-23 11:44 UTC (permalink / raw)
  To: linux-mm

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>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-23 11:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-23 11:44 Question about __zone_reclaim() Roman Gushchin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox