From patchwork Mon Aug 7 06:39:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Popple X-Patchwork-Id: 13343114 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 9BB4CC41513 for ; Mon, 7 Aug 2023 06:40:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8B7F06B0072; Mon, 7 Aug 2023 02:39:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 868E98D0002; Mon, 7 Aug 2023 02:39:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7306A8D0001; Mon, 7 Aug 2023 02:39:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 64BBF6B0072 for ; Mon, 7 Aug 2023 02:39:59 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 0B54D1606AD for ; Mon, 7 Aug 2023 06:39:59 +0000 (UTC) X-FDA: 81096358518.01.887A4AD Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2060.outbound.protection.outlook.com [40.107.244.60]) by imf23.hostedemail.com (Postfix) with ESMTP id 3A3B914000B for ; Mon, 7 Aug 2023 06:39:55 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=OSgom5mB; dmarc=pass (policy=reject) header.from=nvidia.com; spf=pass (imf23.hostedemail.com: domain of apopple@nvidia.com designates 40.107.244.60 as permitted sender) smtp.mailfrom=apopple@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691390396; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=rEFPVFdwrxwMrKik3/BpAkixiiXNn9xLrlUwbbhmRWw=; b=4lrlFKTs/GCrahxwfT+xfuxwVpv/gR8Q0up4IFZjUbDnR+OUVUMND4yd+I6mC9MslQ8Y9v IYnVwTUseTTYbHtl6Jk8i0GAznJgSb+7XTDjmeEppaRm2rkLZJpHGHr6GOnyFKn2LjlTze SdoW+5mx7nJFMgyNw58aU9J6xoXiLRo= ARC-Authentication-Results: i=2; imf23.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=OSgom5mB; dmarc=pass (policy=reject) header.from=nvidia.com; spf=pass (imf23.hostedemail.com: domain of apopple@nvidia.com designates 40.107.244.60 as permitted sender) smtp.mailfrom=apopple@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1691390396; a=rsa-sha256; cv=pass; b=DrlyYXoLZITiH6DEGtjHMSxJrBvQ3eXk728j5Dc8HNT6rL2vm/kQ/1N6vEpf2/tPLs++qB wm1G74t1W+/NO0aUw/KXOMbAdeCIy2oeKasVfmhX8w+854eJNpxtn4eIJ0cYg5siz++2lD OymlSr/EXG7CJTjvRP96Wbg1zngPWSs= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dk67eTrWwEdWr64md9xqUvuCXJD8grbtdwrqopIv8+slL4fKE0RXEpnRrqBeO/iqCdpG59qK1ueU9B3Z2zi92jVn5px9z09iXihivqDmUNrA5SBcpip4zMcZSe0394fu5EqHe+mlRZyHBE6+bAKdnKtBN7UlqWbLUTfspLRIgZXfjwQQjTPhQz6h4ad2m60Ab50eeCuZLX1e+EIoaq2xf7IgSttGacyvpPItwllPighu0hGhabYER7SAsx1/VNQsi+cO0Etdv4wxWRvtX2yCGSgyulbxqCvgNvA7gjmnJwiTbA5rVbI3eLbFI9Lf/9g9tW8ma0E9h70CQdSl6xDLow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rEFPVFdwrxwMrKik3/BpAkixiiXNn9xLrlUwbbhmRWw=; b=UOcMHkXAw9jqZtodYeI6hMR6S2RbohoiUpLaBntJEhM2JtPFnRA5vCGNwinltwahUDcUvZMOrfIIL5Tk5yHePSpCLSpiFUGhC+812xjTOzRbebEewUuudAeDoffutkmUVGH+bkqD/LtBJ/PTv1mWyiUem2ZNlmr6W/DwPEPntZk//LmC0MgDSRERzFvBrolaV7AZotevFL0J0m+cQyfMk4aC/tP6r0H3w5DpKrjYu+IQypiH3UVklB230cBRqUhbIp3M1FsPrJ07atln+tfiYhYkV3aKLDxNnv9ezjt93sseMkMaUddTTch7KLizW7mefjQ1Vb+UYMNNaL29xauOyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rEFPVFdwrxwMrKik3/BpAkixiiXNn9xLrlUwbbhmRWw=; b=OSgom5mBaCgLfL1FLDGMAgiupg6vcJKu0xMy6WjGYMXYdMJGUMnLNF7UJ1/zpPR5R04VaTyoNMR7sHNLhH2fLU+5XxXcz0hqonz+kgGoqBs5p95BRhPdmWfRRZV3KQggWav3h/WZkcU3JqZRq3v987vUoNv9NCuHeVb+VEiU/XpmzxDOoij9K9KOsjhsByKk1g4mLq2TVEL5jmcglKjDeLLja7gX7dvWgWycqjDin5TLey/8CvurdxLStvxJjjmEwT6ZOqFztVcD9SpnDUvUmcT7M/bqE1pqZKq5h1zZkzApq5ZTocIcotsHwQAUvXQItsR9weJxhsVHk2W5Jnty7g== Received: from BYAPR12MB3176.namprd12.prod.outlook.com (2603:10b6:a03:134::26) by MW4PR12MB6779.namprd12.prod.outlook.com (2603:10b6:303:20f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.25; Mon, 7 Aug 2023 06:39:51 +0000 Received: from BYAPR12MB3176.namprd12.prod.outlook.com ([fe80::df45:7f28:ee84:b0b2]) by BYAPR12MB3176.namprd12.prod.outlook.com ([fe80::df45:7f28:ee84:b0b2%6]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 06:39:52 +0000 From: Alistair Popple To: Andrew Morton Cc: linux-mm@kvack.org, mhocko@suse.com, jhubbard@nvidia.com, ying.huang@intel.com, osalvador@suse.de, baolin.wang@linux.alibaba.com, ziy@nvidia.com, shy828301@gmail.com, ryan.roberts@arm.com, Alistair Popple Subject: [PATCH 1/2] mm/migrate.c: Fix return code when migration fails Date: Mon, 7 Aug 2023 16:39:44 +1000 Message-Id: <20230807063945.911582-1-apopple@nvidia.com> X-Mailer: git-send-email 2.39.2 X-ClientProxiedBy: SY5P282CA0016.AUSP282.PROD.OUTLOOK.COM (2603:10c6:10:202::12) To BYAPR12MB3176.namprd12.prod.outlook.com (2603:10b6:a03:134::26) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB3176:EE_|MW4PR12MB6779:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a84c9df-b9a5-44db-bba4-08db97111ad3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dfWEFWaX/HHbTVj3L7fxZaqr2HzdOxt4R5+KlBM1Rel0KVkhfCmEFPc5EmbhRzI40ZaurOLO4pELgjzI7vujobo62DCz11yyHuw41tUXnYq+uynBHmz/gKXI3+bdANc5OWBWC+as54KgllzlgY+sU8HFwQPbju/kTpKCn5I1pf80fXrJuohTuWQVu/c4mg0AgL6egiATtotfV5uuZi2xHvGQrd71H89K8YB6QHCSoJ9LjKg3/nZQvEu1mz/fs1BuUnVDJjHytfVR4JUp9tUiV3MDECRRj2e3X2TgTqHCgoz7cmLxu9T3bVjqt3gRW2fI6g71KHO+5ZTVgWPGQYMjAwXNOOVne8NzdOz4sKMRSM+VAWDCD8GwBDjsRmDnRCGQL6TxcZQIjm/cDI2TmFZuJw8ALUDBbi3HeniNidW2sJ4SGV+ddhZ8s43S4eJ80HlxOsqn+JRZp6X3a8kqiqzw7qRdaOKsOQc7aT3vVe/VY7zK6Rh6oI0DapKCuI66Z0m+LONUHTAEyddxzU8LIDXxaijF4qlgE651LW+HB/PYXACFF2Up40f0ehIikZo+Cgui X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB3176.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(346002)(136003)(396003)(366004)(186006)(1800799003)(451199021)(1076003)(41300700001)(26005)(107886003)(2906002)(5660300002)(83380400001)(8676002)(8936002)(2616005)(6916009)(86362001)(316002)(6506007)(38100700002)(6486002)(66476007)(66556008)(478600001)(66946007)(6666004)(6512007)(4326008)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EHEH3cdBT9Z1v/80I74BbP6dXoGnaZdhjvtzwRjYVw79n/YEy5SdsSG91ba2lm57WyVHokcHfuGaKE7VjFK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IZh1KGqisjc1Aby4OOqeZr8ZvimGLDrZQilkmnQfbRbxadvTG0JUBMrHjxj9aZHj5Q5BfsqwFqifpwiMVIivmGuIIkVABDEQT2/bXcxWLK6JATdfy/Rw5RgR/mZf6264MquHn6GAFEGBfe50lMFf0XUPKoRZfyl8pirT6XJAyUds73lumELmjmti7ENpxfnyre7i8B77OMWlU8gyqDV+yyhpwzfSfpQRFsqK4OIljaPTVZc38RIEyt4cpPhSWkdIii2D0HiU/M1x4PTI1w9kgi6UQROIqlSeR+/vHR2TgvCdDe4mltwf7kK4VfXtaUHK/n9akbKzoEJPUlNFiEq00yc2uFY0cTNdjkLprHNd4voW+SQdDiwEwb6ZI02tKfRyTfNuCyPOx76fhEmi/lQ1nCf2L254ppMq+z9ieOiCoh/Nws X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a84c9df-b9a5-44db-bba4-08db97111ad3 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB3176.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 06:39:52.6255 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sRF8JNvzN+bt5gKZDCEI9Et2xK7fF7wYExtO569w3qNrO7rGdVIxYcMmR9zNcL2jnreRPJlJ84g6GFulVq7g0A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6779 X-Rspamd-Queue-Id: 3A3B914000B X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: fi67man6sno4hgtybmcjtgrhfxwnnohs X-HE-Tag: 1691390395-375430 X-HE-Meta: U2FsdGVkX1/fnM+P8g74lTPiDtKZl4UF+QogH8ep6+gmBjqmIfa/q1ucMmT4l927tBc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9qpSI/z+IDT3fNJ0pacZUTD/+DLRpmpWOzn1BVYmzmqdqXAzyZ9SvsU/z8cW9aTPRgVJ 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: When a page fails to migrate move_pages() returns the error code in a per-page array of status values. The function call itself is also supposed to return a summary error code indicating that a failure occurred. This doesn't always happen. Instead success can be returned even though some pages failed to migrate. This is due to incorrectly returning the error code from store_status() rather than the code from add_page_for_migration. Fix this by only returning an error from store_status() if the store actually failed. Signed-off-by: Alistair Popple Fixes: a49bd4d71637 ("mm, numa: rework do_pages_move") Acked-by: Michal Hocko --- mm/migrate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index 24baad2571e3..bb3a37245e13 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2222,7 +2222,9 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes, * If the page is already on the target node (!err), store the * node, otherwise, store the err. */ - err = store_status(status, i, err ? : current_node, 1); + err1 = store_status(status, i, err ? : current_node, 1); + if (err1) + err = err1; if (err) goto out_flush; From patchwork Mon Aug 7 06:39:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Popple X-Patchwork-Id: 13343115 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 D34AFEB64DD for ; Mon, 7 Aug 2023 06:40:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5F9C36B0074; Mon, 7 Aug 2023 02:40:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A9368D0002; Mon, 7 Aug 2023 02:40:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4234E8D0001; Mon, 7 Aug 2023 02:40:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 351676B0074 for ; Mon, 7 Aug 2023 02:40:04 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 03DA81206D8 for ; Mon, 7 Aug 2023 06:40:03 +0000 (UTC) X-FDA: 81096358728.27.50FAD4D Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2062.outbound.protection.outlook.com [40.107.244.62]) by imf28.hostedemail.com (Postfix) with ESMTP id 3F6CEC0008 for ; Mon, 7 Aug 2023 06:40:00 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=Q4lrh2Qe; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=reject) header.from=nvidia.com; spf=pass (imf28.hostedemail.com: domain of apopple@nvidia.com designates 40.107.244.62 as permitted sender) smtp.mailfrom=apopple@nvidia.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1691390401; a=rsa-sha256; cv=pass; b=2Yt9P6Mf0jFJ1tUVGWHdXyMq1RtTaAyB9vsb/8+s87/Lu+HffVRrCi0UlwZYqf+riA3vh0 4OzMMH9Z86B4AjzDRuCy7NNB37WfzPbUoQouDBlwH5eQj8KTx/FJZGosQ1Y3OVnqvceBUg eivxmilcJB6YUIW7YwmNc9lUY2nlPeE= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=Q4lrh2Qe; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=reject) header.from=nvidia.com; spf=pass (imf28.hostedemail.com: domain of apopple@nvidia.com designates 40.107.244.62 as permitted sender) smtp.mailfrom=apopple@nvidia.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691390401; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=efCB74BJHWmaOyUfSAR0E9XaVvufPYFlyr9gltn6RIs=; b=lQaCKaPB1iC0S2xZs+bbDQFtLic2SdAqBkMJAP+qOqfNwWfV1cPYhQuIagLqIvV9MexlTR sZx98f/ghhjWbJAHzcbz6HSQf3+x18w29YwMET/6qRCrSUjqGCiHVmAZcwhGmOvLGQQrlg g4Q0EbzbcUUM8BO3bJwDRoD1lEBjGkw= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZAVrb9RavHT4rz72AJqwqIRUnVaUQI3L4m9D92osFRkC+SxDcr2KAd5HDstRzN8HBpgqFPcCxqZdsZXPMxOJl8X/S0YBYbf+aqSBBK2TxgJOPeD0mz6+UJdpFvSxY0Ayvc3ZbTBKlHeU5DHKwXpNxGhvibLwMS3mPACnwZq8czT35aK3oDLTbMisMnb+lKbZ1DspSNhl1UzuPozIPs6n8J/Hbm3zyi7CweyDUuLxrba8mWMe0fSvYMY/ITPGaOmYpa2Nq6MTiXAARXeKYwBV/Xq5fokWz44g8GEwAzw+l58WwEw9t0IPuACKE9p/831LzzoXoliPriZuP19wuOv8xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=efCB74BJHWmaOyUfSAR0E9XaVvufPYFlyr9gltn6RIs=; b=EsF6XtykJA0/IJQUPUzkClIpGjYEP34M2x2K7/o/QdYQc9gOW765MJlwHCr8VKH5DQUUbKdVkOwbmQ7yfMoB9RK7ssOcX1nlSiXBQmp6lep5h7ok7LSaQWJOdJ/3UAnT00RQ4XNKa2WCFPbPTE4BiSnBYNo1w9QEv7SRA7o0MfjcKjUEVSS/uAf+fg8bP6Abwu0GcC0rK6xWEvyOHKhnVw/5mahxpBF+FAvlrLo9EsuwfjikLlQZhtD/+nWrzkGLjBR74ezs6jZ/26K9pMLiCz14ammN9fDGMaC0ivUoJlFDCh/dnIvi6ZXHI9eoby0uDuEh4O97ZpXfxvKbL/fV7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=efCB74BJHWmaOyUfSAR0E9XaVvufPYFlyr9gltn6RIs=; b=Q4lrh2QeJmj43tfRftdhNkWMY7k081X1VPqjdFnv337iqBNHmDzzL3jlm/QBJwSRIUzkWxl5qhSrc8M7U5769j61be+nddNc6s5hAJRAc48PABs4VwVv+wtJtYJLOGudmIPj56UaJZSScjf41SKJSlaFiZjgIRMDWQcQ4WSJDkxQzpa0OP8lItzxs2iasKWABOikhJGk4SJTNVrL97V1aowcCOw/A9r8pqHxzrcdxvKsX5XUA+90/xvIbMjF9WA63XZxkHMhvQgfCm+/zr6kagFF51iaJfgKK2Wk0CaquYgLn67Eem8WSHT22eJq4XvPQqFYzW9dtyt9IJJVctZ00g== Received: from BYAPR12MB3176.namprd12.prod.outlook.com (2603:10b6:a03:134::26) by MW4PR12MB6779.namprd12.prod.outlook.com (2603:10b6:303:20f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.25; Mon, 7 Aug 2023 06:39:56 +0000 Received: from BYAPR12MB3176.namprd12.prod.outlook.com ([fe80::df45:7f28:ee84:b0b2]) by BYAPR12MB3176.namprd12.prod.outlook.com ([fe80::df45:7f28:ee84:b0b2%6]) with mapi id 15.20.6652.026; Mon, 7 Aug 2023 06:39:59 +0000 From: Alistair Popple To: Andrew Morton Cc: linux-mm@kvack.org, mhocko@suse.com, jhubbard@nvidia.com, ying.huang@intel.com, osalvador@suse.de, baolin.wang@linux.alibaba.com, ziy@nvidia.com, shy828301@gmail.com, ryan.roberts@arm.com, Alistair Popple Subject: [PATCH 2/2] selftests/migration: Disable NUMA balancing and check migration status Date: Mon, 7 Aug 2023 16:39:45 +1000 Message-Id: <20230807063945.911582-2-apopple@nvidia.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230807063945.911582-1-apopple@nvidia.com> References: <20230807063945.911582-1-apopple@nvidia.com> X-ClientProxiedBy: SY0PR01CA0011.ausprd01.prod.outlook.com (2603:10c6:10:1bb::8) To BYAPR12MB3176.namprd12.prod.outlook.com (2603:10b6:a03:134::26) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB3176:EE_|MW4PR12MB6779:EE_ X-MS-Office365-Filtering-Correlation-Id: fde6c2e2-0f93-4cde-cdc1-08db97111ec1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d2AXeqUp2lbGzXR1gk7MkLGWAB+hHhane/MDteLXDFw+QLaxQtFH4hOR+MWDJJpvcq/TGzKfxlOm9pP+PB3uSqBL21dE554tk0AJy8OcsTDcWuxk98LArqlAPH15XLgXIpY3DHMNuFzDFK6cYF0XGgsMA+tE0Hk+A3a2sWUvCRow6xSIzYWNjgK7zMHQNT2+ZdKh80NUpZjxbJUmwXWd6p3HGBvbGUwK2S5M/Kb5Dj6yD3kxkC9JqG9Rcgqy/gIEOvi2mq5C6Xcx0323OfA05OPRp4LDwFMShWkGnj9PmBBkbi3HxBY2h0/LT3fAVuYsEELwi9redQwOqCjaRmWChyAZGyC04c4I/9NtOr+5pDMgf8VaFsCWGhdJ5D3b0MZJRgc1Fi77WblS0yidUlwpeEekCZvDdpux3fxMDbAkiZRmtU8UI2lw6z5u2QHeLHnfdjfRxbHskxHe12D28eU2hNo2BZSrxNmIgedZdzKqlyBSG3Icu7hx6/tFqsEZoy0ze6Q2+fZStGqo+C9lEPany0kV478Ew4y6XVRIYl9Z3xm/sZ+Thi02jygwWhrxDfBk X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB3176.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(346002)(136003)(396003)(366004)(186006)(1800799003)(451199021)(1076003)(41300700001)(26005)(107886003)(2906002)(5660300002)(83380400001)(8676002)(8936002)(2616005)(6916009)(86362001)(316002)(6506007)(38100700002)(6486002)(66476007)(66556008)(478600001)(66946007)(6666004)(6512007)(4326008)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Es5XqOP+zmnpF5ojdhCCM5MRHH2cByNnRON/232urp3FK1wbUFkBVHJhnxhAnV+2m33jzhyAlZaX/3SI17qXB1PMzZEn8GJ+YYYQq/VgLD7+bDgHNMU2lTxU3JmvQLbk4k2cVXbVng2elc2DxldD7SIeSHEDFMJ5PoWoUF/jv8vRdgFnJ5K/Ra9TnPf/q5M9Lj2be/gIC4Ay4f6QIknXdGfCbbYdxRgtQuN/1oi1CcLF5ax6Sqi7NAYm80Hq7MPHHassUqbv9bzgsKkaI/7QLYJabzfFkSz68OHES1MKKDWlptg+INJVdKvBdKglF5o5OY5zNhqvwA+NfgIzuzLknekv6p0wDzR3v+ephJYjpnZcYG9CFuq71VEoCPGAmJLYnbsHoGExZtDW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3f5yzrqkIbdhlyGBZpUA1kHn/Ammjne5La+PU5WDjdlH+rQRI6yBZwLBsWg3Vcqcq6cdFCV/Qr4FusnCl8oc388q4EFLgF0n2E5aAvFcyAvuuMRynq8lgQDL9yadmPm X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: fde6c2e2-0f93-4cde-cdc1-08db97111ec1 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB3176.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 06:39:59.0662 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AqhvzAi0nxRB7ZOh3G1WOQgNmnnUFRieFIjvu/gelCpqdzaXT41+fPfeoyfr47J9dVFsyOymdikKxg2JrKL0jw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6779 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 3F6CEC0008 X-Stat-Signature: etangryrcy7g44m7qo4hpungjwapiztd X-HE-Tag: 1691390400-545526 X-HE-Meta: U2FsdGVkX18xOnqgkRkh7TNIyt9W8AsHvng9gb1W3iCoajprp+FKV9aD/4IBvrcjl1WKleEIad3yBQwobQKEeZlYR1UBlgnjBbfowboR1fewJKbczz3fCSiWxNvT7B23nNCjBPO/Ddbi6rc+KbeR3pfLwI62e5A8QkervwYnkC21QnAFVfx+yzT/GIpZhG4tarlhGhXJjbQ+cqzHDBnOX5sTahqG2/6toPs+lMpOzXr1RJ70hZlRRT6TjUyEAYVKjA2Pzrn0o8tYI3GKE56lDeHsi3a7xIXYjcKFyzz9qYZdfCAObaasprMdYFj9x74sEeb4rVUHjyfaf8tCm3uac8ZnASUs5+QddJzvDs/YpontK7KAWemSVTQpcrw1d5gVDnKmDSoPe+6zSOpyjQHN/9es77E34N8mpRv0VgY9uSksV0GvH/Y7Kh6nU39AJogc8uG3OuRTBmWV0ex52SKngCU2U4M2XHbCdS7gYZpOVklv03BQCFK0UkGdJiK+12yf4dkNpGWZ9xCGSpHtPhpFapNxmPeSHlZSuMgk+pw1DmEl3ozFuGBQmu1dPGsZD6CES1Q+GpzeAtNKfHwA1r3VrSxMCsQuEMAoU+rjuEFR4aZVxf0LdXQpLFX2vgStETp4Do/ZYDdxsutIlRGFnp1SKOFVMybmbcG1g3dKm2c/kEUUKvfb/EiltTbe1kHPWWkVKPTY7BJ9GjOCRrC9BkmYFIPczUP6V76tgBoJCwWu7HrI8+TQGxkJx+S9XcoQQRloSQ2Z0LHE/jTJ5YBqSlIYnEwaNMi0mBMOaUFYilyZz1Zq5n7mNHRbHSPufOtCliJsqdWrXZ8FnrPRpuirguZg2MfI/RRTvBFDPF3WnCBb2omq1eICO0cIX0syXJhD9QVEpc7Ve0uZt1envf8V5oS4MEPvTYYta4Sy7ej+4i071ycwkiYQyy/fR3mYSNBuowSy8zVb4gOO6GTfzS9fZTz d9Dxwypr lWPUqCrItHEk9HU0Bi5MNdmpds1cvpd/4vB/e7j81OLChCf3Eg7+yf2PMliwefikS7qWhuFIGuzkQgeegynnlj6AowcBnLyXLYM+ju3GmpHehKKfNq511zTEwqlU1ZQoFnCFdddbZRcuyWJF4e89ENelGm9m12PrQ8CbiZhogYW7Oh1OTEjnAsxUwNejlDue/KknuqVpKaSxERKglQFoEvF/zqGiPkT4SX59uaPoic3/tMD9DJTvN/vcsx/QVbZNPL+4QMKK+SiF6E7Twrt/TyD4dqg== 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: The migration selftest was only checking the return code and not the status array for migration success/failure. Update the test to check both. This uncovered a bug in the return code handling of do_pages_move(). Also disable NUMA balancing as that can lead to unexpected migration failures. Signed-off-by: Alistair Popple Suggested-by: Ryan Roberts --- Ryan, this will still cause the test to fail if a migration failed. I was unable to reproduce a migration failure for any cases on my system once I disabled NUMA balancing though so I'd be curious if you are still seeing failures with this patch applied. AFAIK there shouldn't be anything else that would be causing migration failure so would like to know what is causing failures. Thanks! tools/testing/selftests/mm/migration.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/migration.c b/tools/testing/selftests/mm/migration.c index 379581567f27..cf079af5799b 100644 --- a/tools/testing/selftests/mm/migration.c +++ b/tools/testing/selftests/mm/migration.c @@ -51,6 +51,12 @@ FIXTURE_SETUP(migration) ASSERT_NE(self->threads, NULL); self->pids = malloc(self->nthreads * sizeof(*self->pids)); ASSERT_NE(self->pids, NULL); + + /* + * Disable NUMA balancing which can cause migration + * failures. + */ + numa_set_membind(numa_all_nodes_ptr); }; FIXTURE_TEARDOWN(migration) @@ -62,13 +68,14 @@ FIXTURE_TEARDOWN(migration) int migrate(uint64_t *ptr, int n1, int n2) { int ret, tmp; - int status = 0; struct timespec ts1, ts2; if (clock_gettime(CLOCK_MONOTONIC, &ts1)) return -1; while (1) { + int status = NUMA_NUM_NODES + 1; + if (clock_gettime(CLOCK_MONOTONIC, &ts2)) return -1; @@ -85,6 +92,15 @@ int migrate(uint64_t *ptr, int n1, int n2) return -2; } + /* + * Note we should never see this because move_pages() should + * have indicated a page couldn't migrate above. + */ + if (status < 0) { + printf("Page didn't migrate, error %d\n", status); + return -2; + } + tmp = n2; n2 = n1; n1 = tmp;