From patchwork Sun Jan 29 03:39:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Wandun X-Patchwork-Id: 13120020 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 BFBC3C05027 for ; Sun, 29 Jan 2023 03:39:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 043A26B0072; Sat, 28 Jan 2023 22:39:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F35456B0073; Sat, 28 Jan 2023 22:39:31 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E24116B0074; Sat, 28 Jan 2023 22:39:31 -0500 (EST) 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 CEC726B0072 for ; Sat, 28 Jan 2023 22:39:31 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9EC8CAAAA4 for ; Sun, 29 Jan 2023 03:39:31 +0000 (UTC) X-FDA: 80406431742.08.1470DC9 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf20.hostedemail.com (Postfix) with ESMTP id 3F2311C0008 for ; Sun, 29 Jan 2023 03:39:27 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of chenwandun@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=chenwandun@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674963569; 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; bh=T/ZaVvi5Wjw8TD8gHZ1vsadj+YnB5XGAbyKA2pXSmbU=; b=GDrkMaJ2wOxXdqyeKoP/GJZR076GvUjSBP6E5+3fOjs/yg3L+DGigXnhrVk4OujQ0s28Al IVvsoadUjNcosbVA9+GXGEw8zS7fbn+FOkcUp3rDmQPy9sHqhU+SapRMkKCPnHZhPQbniL Bcuk1LrQi6Ai2REwf9IWzFpBLVGdmHE= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; spf=pass (imf20.hostedemail.com: domain of chenwandun@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=chenwandun@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674963569; a=rsa-sha256; cv=none; b=i2gb1Yyu1jrYBKeU7C6JeEjAW9FLWgwCzgTZb3hjSCab8FMdPXWlkUJIoQ/SEzOitZcLp6 /wvS5HIBtKDMFKXPlYrVRDLFjeJ2IlINYD0qJYl8AzHb5pJhY+RMUPh2RUtgOEySIrdo6w +r+gglOukKLnAu9fP+j5mZv0ShXHtSw= Received: from dggpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4P4H7x6YHlzJrPk; Sun, 29 Jan 2023 11:37:49 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Sun, 29 Jan 2023 11:39:22 +0800 From: Chen Wandun To: , , , CC: Subject: [PATCH v2] mm/migrate: Continue to migrate for non-hugetlb folios Date: Sun, 29 Jan 2023 11:39:10 +0800 Message-ID: <20230129033910.1327277-1-chenwandun@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: apo4fzpyh8gs4kmr5np1ea85qrf998e7 X-Rspamd-Queue-Id: 3F2311C0008 X-HE-Tag: 1674963567-840793 X-HE-Meta: U2FsdGVkX18Z4t7Sm1MAST7+WF0G/tOLLIYIb8tXExrAuwgkRJ2cediwCnU9AATSEl7dQvr3LR0m8uC0P6pGRe06N7BQZjhxXORXmTWCN6R+XYcM8vlCGox1Bb4aRVpKvmMIhvJUO2XA3/ov0P3zfNxpA2fUyRTOCtXNJMcd09e9zjSFcu0Wq3MFlOejv088JPPvLyhbZA2YOjSzclvF8pdIaBnLocaeia1R9jRFQz0Bnc8z/ptiCarTN3pJU8aQ0+2aQw5HkwMDOK3t5U4WN+uaDOx3cqmWyoECgWs5JMHbuK/596Fu47YV3N3KtaZK9AX4JHVO37IEMmqGzRgNsUUInqsKgBHJL9IyuZZPYSRRwBZj44G3C08TmaRwIVCTU5rQWBCItDbL9CgnZh7T6JztUb48EBdt6BHJ/hg1H7e5bPtddysS0I9/zzjZJclbhD+6RK0iMc2MFNyhcxKiioVy1TgJ7F+8aqort3yiBzNeWYRqxqjvcCkA+GjXruB1Jbwlm0/Ddcuwly717PDdq27JUzJBoQT6oLDuAYCYQxwACZTiA5dv3R2NVhUH07Xeuiy60HftEwNxHPx6E1/qZqnmGc2X8HwdjvXxtE3ttdDEkQHOID/0KU86zPD1FXJLRdwPbtz/Nuogtq0IzvPgG+G6vIKKsjrcReNfprJ9AZ8nSTjR/UjF6vBwfyRq9SUr/8ipp4pvQ/1b7y29pNMOsfYM2jYLQAXDfI7wnPnuwlPScx49fAAeafwuYUgd8oCwY8Zw+vT4PGm92sGQt2A+2jZzYO1jdEdxpi7yci3shEg2bteXcG7rRvjXcjHiUR5EjAVmqxy+6MgPJNHd4A2KQj0TIZKoiX8HWOuHil+6qAEeaDT7NSoMzSShLCHd1HSteCoOG3UVSQUTRMjCnWoukPJ4QO0pfqi98kEyvkar9oOd/nDqqXiLPjrDSyjKMyiVdiDC32FJQXwmAadSSIz QPZpWSyR r+Fla9N/Zogg85PA56E1C74lMwZi5prIA2AOFwrA+WmxwDhGLu7Qht1GUEYTfUAU0FPyjxQZDTV1dt4tw7p5QDhJfD4YqRIk+o6qLDjyZcZremaLFSB7/5r7ML5TTrY9iYoAWpM+IcoqQ3yHd2TmbWLVzyy1mDeUqMATX 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: migrate_hugetlbs returns -ENOMEM when no enough hugetlb, however there may be free non-hugetlb folios available, so continue to migrate for non-hugetlb folios. Nowdays the only negtive return value of migrate_hugetlbs is -ENOMEM, keep compatible for coming negtive return value instead of ignore return value. Signed-off-by: Chen Wandun Reviewed-by: "Huang, Ying" --- v1 --> v2: modify changelog and comment. thanks Huang Ying. --- mm/migrate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index b971edbf32fc..68927aa06f9b 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1939,7 +1939,8 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, rc_gather = migrate_hugetlbs(from, get_new_page, put_new_page, private, mode, reason, &stats, &ret_folios); - if (rc_gather < 0) + /* There may be free non-hugetlb folios available, continue to migrate. */ + if (rc_gather < 0 && rc_gather != -ENOMEM) goto out; again: nr_pages = 0;