From patchwork Thu Mar 25 13:15:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12164123 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0CA14C433DB for ; Thu, 25 Mar 2021 13:34:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9457061A17 for ; Thu, 25 Mar 2021 13:34:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9457061A17 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 274A46B0071; Thu, 25 Mar 2021 09:34:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 224EF6B0072; Thu, 25 Mar 2021 09:34:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 050F46B0074; Thu, 25 Mar 2021 09:34:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0153.hostedemail.com [216.40.44.153]) by kanga.kvack.org (Postfix) with ESMTP id E05A36B0071 for ; Thu, 25 Mar 2021 09:34:44 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A071B184C053C for ; Thu, 25 Mar 2021 13:34:44 +0000 (UTC) X-FDA: 77958491688.18.9D0F802 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf15.hostedemail.com (Postfix) with ESMTP id 7F6E7A000279 for ; Thu, 25 Mar 2021 13:34:35 +0000 (UTC) Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4F5ltS4Q9Qz19HZk; Thu, 25 Mar 2021 21:14:08 +0800 (CST) Received: from huawei.com (10.175.104.175) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Thu, 25 Mar 2021 21:16:02 +0800 From: Miaohe Lin To: CC: , , , , , , , Subject: [PATCH v3 0/5] Cleanup and fixup for mm/migrate.c Date: Thu, 25 Mar 2021 09:15:19 -0400 Message-ID: <20210325131524.48181-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Originating-IP: [10.175.104.175] X-CFilter-Loop: Reflected X-Stat-Signature: o7x988x73yhzh8tr514h8gbxcpd3ix71 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 7F6E7A000279 Received-SPF: none (huawei.com>: No applicable sender policy available) receiver=imf15; identity=mailfrom; envelope-from=""; helo=szxga04-in.huawei.com; client-ip=45.249.212.190 X-HE-DKIM-Result: none/none X-HE-Tag: 1616679275-611178 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi all, This series contains cleanups to remove unnecessary VM_BUG_ON_PAGE and rc != MIGRATEPAGE_SUCCESS check. Also use helper function to remove some duplicated codes. What's more, this fixes potential deadlock in NUMA balancing shared exec THP case and so on. More details can be found in the respective changelogs. Thanks! v2->v3: Collect Reviewed-by tag Revert commit c77c5cbafe54 ("mm: migrate: skip shared exec THP for NUMA balancing") per Yang Remove all 3 VM_BUG_ON_PAGE and make putback_movable_page static per Yang v1->v2: Fix removing the wrong assertion per Rafael. Use pr_warn_once() instead per David. Collect Reviewed-by tag. Miaohe Lin (5): mm/migrate.c: make putback_movable_page() static mm/migrate.c: remove unnecessary rc != MIGRATEPAGE_SUCCESS check in 'else' case mm/migrate.c: fix potential indeterminate pte entry in migrate_vma_insert_page() mm/migrate.c: use helper migrate_vma_collect_skip() in migrate_vma_collect_hole() Revert "mm: migrate: skip shared exec THP for NUMA balancing" include/linux/migrate.h | 1 - mm/migrate.c | 62 +++++++++++++++-------------------------- 2 files changed, 22 insertions(+), 41 deletions(-)