Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754627AbbFYAnI (ORCPT ); Wed, 24 Jun 2015 20:43:08 -0400 Received: from LGEMRELSE7Q.lge.com ([156.147.1.151]:55804 "EHLO lgemrelse7q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752474AbbFYAmy (ORCPT ); Wed, 24 Jun 2015 20:42:54 -0400 X-Original-SENDERIP: 10.177.222.220 X-Original-MAILFROM: iamjoonsoo.kim@lge.com From: Joonsoo Kim To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vlastimil Babka , Mel Gorman , Rik van Riel , David Rientjes , Minchan Kim , Joonsoo Kim Subject: [RFC PATCH 02/10] mm/compaction: skip useless pfn for scanner's cached pfn Date: Thu, 25 Jun 2015 09:45:13 +0900 Message-Id: <1435193121-25880-3-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435193121-25880-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1435193121-25880-1-git-send-email-iamjoonsoo.kim@lge.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1964 Lines: 56 Scanner's cached pfn is used to determine the start position of scanner at next compaction run. Current cached pfn points the skipped pageblock so we uselessly checks whether pageblock is valid for compaction and skip-bit is set or not. If we set scanner's cached pfn to next pfn of skipped pageblock, we don't need to do this check. Signed-off-by: Joonsoo Kim --- mm/compaction.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index 4397bf7..9c5d43c 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -265,7 +265,6 @@ static void update_pageblock_skip(struct compact_control *cc, unsigned long curr_pfn, bool migrate_scanner) { struct zone *zone = cc->zone; - unsigned long pfn; if (cc->ignore_skip_hint) return; @@ -285,18 +284,16 @@ static void update_pageblock_skip(struct compact_control *cc, set_pageblock_skip(page); - pfn = page_to_pfn(page); - /* Update where async and sync compaction should restart */ if (migrate_scanner) { - if (pfn > zone->compact_cached_migrate_pfn[0]) - zone->compact_cached_migrate_pfn[0] = pfn; + if (end_pfn > zone->compact_cached_migrate_pfn[0]) + zone->compact_cached_migrate_pfn[0] = end_pfn; if (cc->mode != MIGRATE_ASYNC && - pfn > zone->compact_cached_migrate_pfn[1]) - zone->compact_cached_migrate_pfn[1] = pfn; + end_pfn > zone->compact_cached_migrate_pfn[1]) + zone->compact_cached_migrate_pfn[1] = end_pfn; } else { - if (pfn < zone->compact_cached_free_pfn) - zone->compact_cached_free_pfn = pfn; + if (start_pfn < zone->compact_cached_free_pfn) + zone->compact_cached_free_pfn = start_pfn; } } #else -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/