From patchwork Tue Feb 14 13:59:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 13140175 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 1DAA4C61DA4 for ; Tue, 14 Feb 2023 13:59:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 829FC6B0072; Tue, 14 Feb 2023 08:59:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D95E6B0073; Tue, 14 Feb 2023 08:59:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C8106B0074; Tue, 14 Feb 2023 08:59:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 599226B0072 for ; Tue, 14 Feb 2023 08:59:49 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 30D0BA06F2 for ; Tue, 14 Feb 2023 13:59:49 +0000 (UTC) X-FDA: 80466055698.08.4860A5F Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by imf19.hostedemail.com (Postfix) with ESMTP id CAFA31A000A for ; Tue, 14 Feb 2023 13:59:44 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.99 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676383187; a=rsa-sha256; cv=none; b=O84zKUKA5pyU7HqYHgZp5BrquilLRAhPexQqemM1zIHZ3Oqas4OJRfPFq7P4yZrDt2joOR rsYeawFKHh7jjzWP1G+scKqsScBoOR9AzpJkmjd8RTFiB0rbZUg0UEveWOj+/lhLHMvxsc FMGZh69+ZRq+qhfpJQzD5zLDW7AZabo= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.99 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676383187; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=US9QS86tQGgAytpKxRWwsrL4TMXq7Zh7043oglz6QWY=; b=0jrelTyBv88+yW1hoAG31VheWtP0STihO4Tf1k8+/PPkoCrL5Pz5Ka+MwtKvSLm8KJELic kFFgPvmO5TAzlisLLp1nVMrjIX6HEbXCS7loJn6OdjN9iXeM4a9m0fuac4I/hQ4einDqk6 K2jlgL6JJSwOAi94SfX1jqtcodqUa88= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0VbgTJ0R_1676383178; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VbgTJ0R_1676383178) by smtp.aliyun-inc.com; Tue, 14 Feb 2023 21:59:39 +0800 From: Baolin Wang To: akpm@linux-foundation.org Cc: torvalds@linux-foundation.org, sj@kernel.org, hannes@cmpxchg.org, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, muchun.song@linux.dev, naoya.horiguchi@nec.com, linmiaohe@huawei.com, david@redhat.com, osalvador@suse.de, mike.kravetz@oracle.com, willy@infradead.org, baolin.wang@linux.alibaba.com, damon@lists.linux.dev, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/4] Change the return value for page isolation functions Date: Tue, 14 Feb 2023 21:59:28 +0800 Message-Id: X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: CAFA31A000A X-Rspamd-Server: rspam01 X-Stat-Signature: uxeeatf6qoru4oh6ko9ytbffrz3kdezn X-HE-Tag: 1676383184-743694 X-HE-Meta: U2FsdGVkX18ZNMcgg4CmL4+rLMjW6KiSEO8Fp2eJ8uZPPkzNICbCQQNoyk9jQYxTHFYqbHyqOct0goBv88HcLsd9z4ILN4/5bBCp24oGjs0+iMHPj6D7Ur7ONXmkUObfcRYu+kwftvkRWc1T7RLevIYTn9ukK/8y/kBjoCcjHMfs2h6IjQ6qxeCJQQaygwUlaNBxP4RS7PrFC6wtJa6zCokZ5/Hw+mFwhCU9sh0qgmRwty2FyfBFDIBqVVqVM14ma+M6uvoKnUEXpvJL6C0irbEJO5oDjt8Zc9Y27Kfvb/QYaWL+jfKDrCxu5HJBmWYMXCEKQXBvbi3YCkqk3OuXF8NKDJy2FcpegqEwOEpR2r3WzYsdL55v5eYYAHo8Ub6Fz/zOOhji1xbUCIbL+1n5t1A7Vqu0YI1G4lAQ1cQL6l+RPA1GVJ4G/WQGs9C6Px8BmUJ/KTfw035W6KgCvil3FNqgdnvi5LgOnXzZJM6gluPCogQRKCgquGjLkupuOI/fRbioCFmkcFxT686cLwHqidJWYmPdGMYa25GWcoZzxUq8bUCX+4NgGNzQov8IeJs2oGMTCdrUkc/46k9j+k/wdFnm4W3trnBYAsOCi16fVyzfYINXpItfSSOtl4ZqFqiCY8u8v/qXoVYyhLZZ+6tUdlRcdELqajegZok3CagLxSmCkC3EbdN9vrJ0d4o5UKN9R+SV2dJd/tVFBaanJ6IjQl1DcqVZY5r8xqqfwijhwoAb0Ffh/2rt8AZSNtDRVDgr0p1WWCczCwqmgeFi/Jf7G9Tnwx32j2D+pgZdd9uYhYXgNcnLkQcdegzvDP6tTkdIhwoXy1Jeg1LoJGsgah18YpZFNQyp9FIpjte7eETquTSA8vqtQm0PL9BrkjGNosIUGnmVtxklMza6YLtDecTNYonfWMOJj1KKXEslE36uJy15XHTPpka2gqfVao856zgHdSdkzUenB9T2091I3DT Osmk54bz hXKeZAq6GLhd4Ax+Ova7vu6vlALXkYlXV5/0Cp+U87PNxDtynas3HIbs+5AHH8zJpvpCQvGWkeX5yrPtvHHLEuNHVjQ== 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: Now the page isolation functions did not return a boolean to indicate success or not, instead it will return a negative error when failed to isolate a page. So below code used in most places seem a boolean success/failure thing, which can confuse people whether the isolation is successful. if (folio_isolate_lru(folio)) continue; Moreover the page isolation functions only return 0 or -EBUSY, and most users did not care about the negative error except for few users, thus we can convert all page isolation functions to return a boolean value, which can remove the confusion to make code more clear. No functional changes intended in this patch series. Changes from v1: - Convert all isolation functions to return bool. Baolin Wang (4): mm: change to return bool for folio_isolate_lru() mm: change to return bool for isolate_lru_page() mm: hugetlb: change to return bool for isolate_hugetlb() mm: change to return bool for isolate_movable_page() include/linux/hugetlb.h | 6 +++--- include/linux/migrate.h | 6 +++--- mm/compaction.c | 2 +- mm/damon/paddr.c | 2 +- mm/folio-compat.c | 4 ++-- mm/gup.c | 2 +- mm/hugetlb.c | 12 ++++++++---- mm/internal.h | 4 ++-- mm/khugepaged.c | 4 ++-- mm/madvise.c | 4 ++-- mm/memcontrol.c | 4 ++-- mm/memory-failure.c | 10 +++++----- mm/memory_hotplug.c | 2 +- mm/mempolicy.c | 4 ++-- mm/migrate.c | 17 ++++++++++------- mm/migrate_device.c | 2 +- mm/vmscan.c | 10 +++++----- 17 files changed, 51 insertions(+), 44 deletions(-) Acked-by: David Hildenbrand