From patchwork Tue Feb 14 03:18:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 13139322 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 7DBE5C64ED8 for ; Tue, 14 Feb 2023 03:18:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CAA42280002; Mon, 13 Feb 2023 22:18:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C32D76B0075; Mon, 13 Feb 2023 22:18:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A8585280002; Mon, 13 Feb 2023 22:18:35 -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 9342E6B0074 for ; Mon, 13 Feb 2023 22:18:35 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 5BECF80897 for ; Tue, 14 Feb 2023 03:18:35 +0000 (UTC) X-FDA: 80464439790.10.E1AD327 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by imf29.hostedemail.com (Postfix) with ESMTP id 50F9512000A for ; Tue, 14 Feb 2023 03:18:32 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; spf=pass (imf29.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=1676344713; 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:in-reply-to:references:references; bh=IZQcyJjFlkQ044twydhzOb1ViDGQSIC6qjIfQyHiSiA=; b=WWtwHb/NP0AG9RwQ8m/4M1d1542MaJrlZa91JnhNG5Kq+pdqUdpX6ZYTik/16gitmF94Lt eJ3yOWUuJ0rdSp76seSREWZnNGF1WAd5+y/nSMZpgfNoqQy2ji8fOmPW4BcBhgyWq7JsX5 4ysYfytnxlY6bwX59S5ZXEMevRDuqMw= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; spf=pass (imf29.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=1676344713; a=rsa-sha256; cv=none; b=0sqif5PPjybowTYF6MMmhX5vbKeoyYp9uZ0EMdlK5+xm7amfbEAxvXFcx7Tw+Fcb6e+eZp mvdfaUkjMZMIL/y3nnP3C5JB4Sx9Qd+CcXYyu7nG8eFJGcsgjp2uAQCQunfM0XnJT0LSyW 3wXvL2e62FhjjDuydA3JXi0jPHzhN8Q= 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=ay29a033018045192;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=13;SR=0;TI=SMTPD_---0VbdtbCo_1676344708; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VbdtbCo_1676344708) by smtp.aliyun-inc.com; Tue, 14 Feb 2023 11:18:28 +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, baolin.wang@linux.alibaba.com, damon@lists.linux.dev, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] mm: mempolicy: check negative error of isolate_hugetlb() when failed to isolate a hugetlb Date: Tue, 14 Feb 2023 11:18:08 +0800 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: 4hf7ztobd8o3rk51psy4aybkecagzq5w X-Rspamd-Queue-Id: 50F9512000A X-HE-Tag: 1676344712-100456 X-HE-Meta: U2FsdGVkX1+13bumji834uWXiMZM5wrCvWCJMXJlzXEFqn2mUM3Za9e/OeSh7G2dp4FrcDzZD3vwInXde1/evBx0OoHjtprwnQWr5aKe1a0JKc4UN2Ah0ykALkwQPoOx/vwF5e3/JXh0JGqjz7Y26qyfJ4APzXptm03ia61L7IjsBbWn7ukGcbkbRU+ed5RcBmpJL50b+9CHSzl2Ezji7d6rept8iGcWdrvRAA4cxcgRD4UIrNKike4j2j88gjcxdXJiBS2rKSi8jzUYgGo8UennhNYzq+oc6ADjindSnlPOExhtsgtzbJb1FjdQDJ4nW8oY3oBfOR9chvAO2GwhBSn/pURZ9Qy7rHXuz6/XU22QL3Rh9RMV0D+NQkw/ShPQBie9nSYLeJz+L5IwLLCgxrFVTKmkadqEBZt5PrrsdVOZ2+eyTO/P0oomkXWOzAmrwx8C5hIQow0sZNAdCQ04cpg6Emn9eyKmP2M5HrkmEqahDspuup0VfXo0YNVeg0mUnrx07LUbMB6Mwskdu4QlvbNZkOrvk8j6eeuOFUvnkWPI+B8BQaqEtk3YQUU3yfO5DAK7QxJ+17aV13Sk+znAiw8K/2MXfh/DXz+01WkAKzkLyTAJTmbK/cUlgmDYu4I7fD95VxKDmjYODK3RIhdOhmTQ1ucArh+Ry3fjtUmuXLM52BgnUTop9/eAuWowPoYFpxYCkinqAiVoQ2IOAxZ8X5xSR1Qkt5MI6PMhFfHZ2LxgiSAq0KcDlgH182qjTW1mdqJBT/z8dwT/RZauC0EIrijacEOT4nTtFJuyAQmcUgr1v6U1rVkesDkVRDGD3cBlDv/aC+mppC0a0cg/HD0FBUuvsHS6QKjED6RGRy4GXkBY6EIzqFWJb0jYRp2NHFLuw+XcThCaYhu/3zyo6N9/RnJZCA8YqC8O5tUyOukgYejZQ9tTcmQQpn9o/L4xdErmkoNl0DJRMOMIa88btUN OXDwcu3W nuroDZy/omsPhjfzsCULQxYYr3z7v8B23uX7yXRcfTMAHcF/9hyXFJUnNrqBSSafyqro8jiC96PYtjkagV0szHQzP0P4OuhUMtEsIvltqY9O1DjuuIOzxdFg7rKB6Za46GCC6AKYJehgKZZ5EFvE0+5s1+wKPemAn5emG 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: Better to check the negative error of isolate_hugetlb() when failed to isolate a hugetlb page, which makes the code more clear. No functional changes. Signed-off-by: Baolin Wang --- mm/mempolicy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 0919c7a719d4..e3d87b21516b 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -609,7 +609,7 @@ static int queue_folios_hugetlb(pte_t *pte, unsigned long hmask, if (flags & (MPOL_MF_MOVE_ALL) || (flags & MPOL_MF_MOVE && folio_estimated_sharers(folio) == 1 && !hugetlb_pmd_shared(pte))) { - if (isolate_hugetlb(folio, qp->pagelist) && + if (isolate_hugetlb(folio, qp->pagelist) < 0 && (flags & MPOL_MF_STRICT)) /* * Failed to isolate folio but allow migrating pages