From patchwork Tue Mar 23 13:54:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12158047 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 DC426C433C1 for ; Tue, 23 Mar 2021 13:55:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 745E161994 for ; Tue, 23 Mar 2021 13:55:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 745E161994 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 F2C146B0157; Tue, 23 Mar 2021 09:55:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EB4D46B015B; Tue, 23 Mar 2021 09:55:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC9116B015C; Tue, 23 Mar 2021 09:55:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id BFF086B0157 for ; Tue, 23 Mar 2021 09:55:06 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 779AB610C for ; Tue, 23 Mar 2021 13:55:06 +0000 (UTC) X-FDA: 77951285412.02.DA2441A Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf21.hostedemail.com (Postfix) with ESMTP id 06D5FE0011E3 for ; Tue, 23 Mar 2021 13:55:03 +0000 (UTC) Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4F4Xr525Kmz19HXN; Tue, 23 Mar 2021 21:52:53 +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; Tue, 23 Mar 2021 21:54:42 +0800 From: Miaohe Lin To: CC: , , , , , , , Subject: [PATCH v2 0/5] Cleanup and fixup for mm/migrate.c Date: Tue, 23 Mar 2021 09:54:00 -0400 Message-ID: <20210323135405.65059-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: 51xkn9y6kb3kwyw64fwxfqu5ytc7zqw9 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 06D5FE0011E3 Received-SPF: none (huawei.com>: No applicable sender policy available) receiver=imf21; identity=mailfrom; envelope-from=""; helo=szxga04-in.huawei.com; client-ip=45.249.212.190 X-HE-DKIM-Result: none/none X-HE-Tag: 1616507703-229646 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! 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: remove unnecessary VM_BUG_ON_PAGE on putback_movable_page() 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() mm/migrate.c: fix potential deadlock in NUMA balancing shared exec THP case mm/migrate.c | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-)