From patchwork Fri Mar 18 11:16:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12784162 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3331AC4332F for ; Thu, 17 Mar 2022 14:41:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC77F6B0071; Thu, 17 Mar 2022 10:41:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A765F8D0005; Thu, 17 Mar 2022 10:41:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9187A8D0002; Thu, 17 Mar 2022 10:41:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 82BF66B0071 for ; Thu, 17 Mar 2022 10:41:56 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 56F711A3F for ; Thu, 17 Mar 2022 14:41:56 +0000 (UTC) X-FDA: 79254142632.03.9F50BA5 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf24.hostedemail.com (Postfix) with ESMTP id 79BBD18003B for ; Thu, 17 Mar 2022 14:41:53 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4KK8q43V09z1GCTj; Thu, 17 Mar 2022 22:36:48 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 17 Mar 2022 22:41:47 +0800 From: Miaohe Lin To: CC: , , , , , , , Subject: [PATCH v2 00/11] A few cleanup and fixup patches for migration Date: Fri, 18 Mar 2022 19:16:58 +0800 Message-ID: <20220318111709.60311-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Queue-Id: 79BBD18003B X-Stat-Signature: gbxkzdkwt6nme8x9csqs8oy8481qwe4z Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf24.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspamd-Server: rspam03 X-HE-Tag: 1647528113-226349 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 everyone, This series contains a few patches to remove unneeded variables, jump label and use helper to simplify the code. Also we fix some bugs such as page refcounts leak , invalid node access and so on. More details can be found in the respective changelogs. Thanks! --- v1->v2: collect reviewed-by tag fix some commit log remove unneeded nr_failed assignment per Huang Ying getting the types correct to use min() per Andrew delay some patches to make this easier to move forward Thanks Muchun, Baolin, Zi Yan,Huang Ying, Andrew, Alistair for review! --- Miaohe Lin (11): mm/migration: remove unneeded local variable mapping_locked mm/migration: remove unneeded out label mm/migration: remove unneeded local variable page_lru mm/migration: fix the confusing PageTransHuge check mm/migration: use helper function vma_lookup() in add_page_for_migration mm/migration: use helper macro min in do_pages_stat mm/migration: avoid unneeded nodemask_t initialization mm/migration: remove some duplicated codes in migrate_pages mm/migration: fix potential page refcounts leak in migrate_pages mm/migration: fix potential invalid node access for reclaim-based migration mm/migration: fix possible do_pages_stat_array racing with memory offline mm/migrate.c | 94 +++++++++++++++++++++++----------------------------- 1 file changed, 42 insertions(+), 52 deletions(-)