From patchwork Sat May 14 19:55:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 572900 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DE9BC433EF for ; Sat, 14 May 2022 19:56:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235124AbiENT4O (ORCPT ); Sat, 14 May 2022 15:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235035AbiENTzy (ORCPT ); Sat, 14 May 2022 15:55:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2DC0377F9; Sat, 14 May 2022 12:55:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AD21BB80B05; Sat, 14 May 2022 19:55:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EBC5C340EE; Sat, 14 May 2022 19:55:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1652558128; bh=768L2okMHovk3QS5/VQ1udhDvYDydu/ER5HnELywfe4=; h=Date:To:From:Subject:From; b=bCKJ8kgSJZrwdahyvzyW5bgYOSUdOclyMvPo7KhmlLDKGFI5aPLDyjhodZR82Unse c2JfJuP+y6jUGllEiRSqx6EJqQKhyrlZ42B1sm67iRMXFYwavvxy1Q2t37HsRKtxcO O8/v3+KtfarVH34NgxnIqg6zaz/YBrpMLeyrlD9A= Date: Sat, 14 May 2022 12:55:27 -0700 To: mm-commits@vger.kernel.org, vvghjk1234@gmail.com, stable@vger.kernel.org, osalvador@suse.de, mgorman@techsingularity.net, linmiaohe@huawei.com, ddutile@redhat.com, yamamoto.rei@jp.fujitsu.com, akpm@linux-foundation.org From: Andrew Morton Subject: [merged mm-stable] mm-compaction-fast_find_migrateblock-should-return-pfn-in-the-target-zone.patch removed from -mm tree Message-Id: <20220514195528.4EBC5C340EE@smtp.kernel.org> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The quilt patch titled Subject: mm, compaction: fast_find_migrateblock() should return pfn in the target zone has been removed from the -mm tree. Its filename was mm-compaction-fast_find_migrateblock-should-return-pfn-in-the-target-zone.patch This patch was dropped because it was merged into the mm-stable branch\nof git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: Rei Yamamoto Subject: mm, compaction: fast_find_migrateblock() should return pfn in the target zone At present, pages not in the target zone are added to cc->migratepages list in isolate_migratepages_block(). As a result, pages may migrate between nodes unintentionally. This would be a serious problem for older kernels without commit a984226f457f849e ("mm: memcontrol: remove the pgdata parameter of mem_cgroup_page_lruvec"), because it can corrupt the lru list by handling pages in list without holding proper lru_lock. Avoid returning a pfn outside the target zone in the case that it is not aligned with a pageblock boundary. Otherwise isolate_migratepages_block() will handle pages not in the target zone. Link: https://lkml.kernel.org/r/20220511044300.4069-1-yamamoto.rei@jp.fujitsu.com Fixes: 70b44595eafe ("mm, compaction: use free lists to quickly locate a migration source") Signed-off-by: Rei Yamamoto Reviewed-by: Miaohe Lin Acked-by: Mel Gorman Reviewed-by: Oscar Salvador Cc: Don Dutile Cc: Wonhyuk Yang Cc: Rei Yamamoto Cc: Signed-off-by: Andrew Morton --- mm/compaction.c | 2 ++ 1 file changed, 2 insertions(+) --- a/mm/compaction.c~mm-compaction-fast_find_migrateblock-should-return-pfn-in-the-target-zone +++ a/mm/compaction.c @@ -1848,6 +1848,8 @@ static unsigned long fast_find_migratebl update_fast_start_pfn(cc, free_pfn); pfn = pageblock_start_pfn(free_pfn); + if (pfn < cc->zone->zone_start_pfn) + pfn = cc->zone->zone_start_pfn; cc->fast_search_fail = 0; found_block = true; set_pageblock_skip(freepage);