From patchwork Sun Jan 29 02:54:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Wandun X-Patchwork-Id: 13120005 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 42881C61DA4 for ; Sun, 29 Jan 2023 02:55:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 679FD6B0072; Sat, 28 Jan 2023 21:55:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 629FD6B0073; Sat, 28 Jan 2023 21:55:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F1A56B0074; Sat, 28 Jan 2023 21:55:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 3B71E6B0072 for ; Sat, 28 Jan 2023 21:55:18 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 10E2F80284 for ; Sun, 29 Jan 2023 02:55:18 +0000 (UTC) X-FDA: 80406320316.08.96F8805 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf23.hostedemail.com (Postfix) with ESMTP id 300F2140008 for ; Sun, 29 Jan 2023 02:55:14 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf23.hostedemail.com: domain of chenwandun@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=chenwandun@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674960916; 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=XYDdqBuuNwBIx2R54EwUY3DJyRASbw7nTpwMy9tXA4w=; b=SKq1HlR2jtDNTsGW68h+S8nwhto2hynqkM1BV8QnfuNs9DjXC6vSkNggiB2s+8jWDnnN5q LV9XwIzBWnWj7z9t3yZPycsyuH+lA7RuppXRGrdkeAQOEr2EuZ4nyMAJVm6U8NIgpYlrZT 5EicZ6J7id0thf3fF4guyIJbv98ik4A= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf23.hostedemail.com: domain of chenwandun@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=chenwandun@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674960916; a=rsa-sha256; cv=none; b=xOLFi9XICM81RIW0qwqDp/jsWtebtgVY5gn/fndmrk1xUKIc9/SqJEiaXbkmRRwx9RrRps U4JNXE9JpHTpQjXLsefJTZTDLk2KgmFH55WSi0zX4ppu0wJ3vFGZDGXM/fVwJOQuocyzOv nF0C+PxY4+f1ARdmHEPZjkunCzBMtVc= Received: from dggpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4P4G5b31CnzJqMP; Sun, 29 Jan 2023 10:50:43 +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 10:55:09 +0800 From: Chen Wandun To: , , , CC: Subject: [PATCH] mm/migrate: Continue to migrate for small pages Date: Sun, 29 Jan 2023 10:54:04 +0800 Message-ID: <20230129025404.1262745-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: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 300F2140008 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: c8gjc756mgm55nn5jinrdxejx813krkt X-HE-Tag: 1674960914-347414 X-HE-Meta: U2FsdGVkX1+6D7JQ7qQh5CQr8ig5kjGElsDJQ+IR2aIypKYPS2/HadQQOyokOvx+A3m45OthtglWUZxMcc6tYEv2q7BRxg0KJGfLqN63Pe7wbZWHb498qzWyPheLnBzl2SFboYG8cKJBOVK6o05OrN+LQ5JM23woFfT0F31OQa/zMeeIUw5R51vO1E2umbYgn4otTzeQMo7z5Rm5qLZfOGLqs9SQoZhA8FodLX3fcOgaKFJWu6p6SvklIBkmJA3eas8n9+rYhu//QY0nTMFwy3VI1Zel5I2rPx9nZCUINlK6u+riqdjHxBgCJvjMAdgDeeKhd3KPgFBaNlymiqvKHfz6LQN3e1dqmt077s0LsrwuaSyVdP8LqOSp1MCCgsKVkAafr7Qrm/uD/0PBbWJsbjW59NIM4Fj1nJOjyYdUrbI5kMugtOSrrevVAG+EqP8OJ9zX8ixZOtva03+SdlNk7dblYAABa2SAAgwLe9AYZ6DmFewkai+eFpKzNC5NnpL6+EDNz4+BAxtLBRtwh83EhFCKYFiavF5mSHU9YBSVbO6FKznc6fbVfWzXV31WHMVSBgf+H07y/0QaOeD0voqlkl01ORdaWDAuB+axsh6iAdk2W1/ghh1/54Yrvp0VW9OfIXB0L5Cl0QVZrm0Bbt+74T6D31cNQ5suJ2hFD5X3ckBKzBhmHkYcweYZRE58ra2j9Y90ZaVTxam14t30ydHd1pf2VAK4V3ByW0Vkd7T7G1WfV7vUEp/pxidnnwR4bZ2gRPNxFJAWQmyNvGaKztFKCdBpLMYGebMkB37ygLFn2fr8l6gzQkWmpNn7PAeKf8oTvc0zqbBaWGkFBg8W69haYpeJFyXVxcLlBGK9YH12cW1vuBnEGq8/ovj1XqW33B1cdeSc4vORxL4aEa2Kw3uwSyBeXOCdspnPBinDo/g7xFKNl0/oDbLXlnuRGDnXHAFtDD9NTICfaUXLG92aRsj jtQ8RCc8 LESSHH+FZQCly4mAgHSuRF7GcL3lvAh465RQbb5PML0LEXkPFkmF1Bvw1hrG3AYa9lcq18aTnqKam30K4tLWRvN8LBjjckF7k2Hcc/Hga6VUdQj5wghyJO018vBJRhnnUwn1WoYZ7OrK146HLRCV1iUljTvjtmjfRVmm3 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 huge page, however maybe there are still free small pages, so continue to migrate for small pages. Signed-off-by: Chen Wandun --- mm/migrate.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index b971edbf32fc..c9d0d2058036 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1939,7 +1939,12 @@ 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) + /* Maybe there are free small pages, continue to migrate. + * Nowdays the only negtive return value of migrate_hugetlbs + * is -ENOMEM, keep compatible for coming negtive return + * value instead of ignore return value. + */ + if (rc_gather < 0 && rc_gather != -ENOMEM) goto out; again: nr_pages = 0;