Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp390062iol; Sat, 11 Jun 2022 06:46:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJoIJh8o4Ak8ppPvtd3CV1Wz/PL9lmnpjLeADESezgXZsFUko2msFuMNgZkqYCJyCJ7Rdu X-Received: by 2002:a17:903:234b:b0:166:4459:c43a with SMTP id c11-20020a170903234b00b001664459c43amr47147135plh.35.1654955206630; Sat, 11 Jun 2022 06:46:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654955206; cv=none; d=google.com; s=arc-20160816; b=bEaW/Sj4gAeoOJ7R3pDstOU7SueUAJtQoDqs1WKOLe8epG9xmI6e2BIMwT8oRoRjk3 fQfOQHu1W+TWTGXcd4KrPizOVIDSUg+Zt/eR6XELrDcv5KEhd4qEj+l596XHosr7Xpc7 yTgBC2A7ipu7Qkzy9rO5esmrq5EjWJo7lQ6HF79aAmJWUHcFxdK+j+OZ8+H2ImDlYF6F NgiHNOP+NB7HrtBgWCUDAQjRuCryh0feVx0rqgbI49Rkj1EwClGsSAhvEquzTmjny08e mV8Yf5thy0F90Ppl7gbsXTV5mdouheCTHmyhr0pk++JMGXolaFolBd9y7xkrLm4wqv4J uCeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=PbAl4kI4EWPjlfr5EPy02/EZq5DBezEwz9F8zcvz1MI=; b=Jq/KVvGazWaz8MPEyWpujcTgYLTVOdwATksCwSlEAxV9SkD438V5mGpp4my9XsijOb oxhifqioDvTaTUDXAd1zKWC3BGg6bs/Al/fPrL90MGuE03vauX9R7yX7l6ylN+kHghvM DMW70ttq56Q7+xoVMQ/1XyIa4ogifK/k2vZkIE+mB0UQq1nJudQJceskLFznd5ou+bcC WQWs4wL2zgam1iz07+zWqQ7kxEFfUyuC6Rdjl6J6NR9AVgFGBR0ZIzScnEXQayK/KtIg +Y4Mix2SAVteW0UNAFxFfwlGi/A5JiyhAMuCrWvwcNldDO54meZ/WVb7//xhvi3YKBCS gonQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dnfYy1gg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a056a00230800b004fa3a8dffa6si2477264pfh.93.2022.06.11.06.46.34; Sat, 11 Jun 2022 06:46:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dnfYy1gg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233660AbiFKNfL (ORCPT + 99 others); Sat, 11 Jun 2022 09:35:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233560AbiFKNfK (ORCPT ); Sat, 11 Jun 2022 09:35:10 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 996EBEA8 for ; Sat, 11 Jun 2022 06:35:07 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id g10-20020a17090a708a00b001ea8aadd42bso1868725pjk.0 for ; Sat, 11 Jun 2022 06:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PbAl4kI4EWPjlfr5EPy02/EZq5DBezEwz9F8zcvz1MI=; b=dnfYy1ggDd7wo8E0EUz0ooEKa3e3RIH+cyYmrSJawMdt2/497OMEZjpHXu2EmIJTgb nJuCZZWuy9ecGkTWmAmamFLUUpVfx/rMK71INj3ws/FrC2wyib3+r3mk1abd6siXr4Ny 79GBsLHCjeKjjzLArt7zM1+w3GHmojGfWiVQdz3pL+TZZIjjVwece4GzFn1orUzG1za8 qaF2XaDOZr6oMomXKRoeKkJF5JK3rnkgg/8jylaoYg2JmxP4/w+PPfheNOibLgzNOrKw Q9hXMgF2gvN/sPVuJStrLvqsIJo3/LIAEgUuaySw3ik8ZmSyfBjy7pU7ZDePAM6zh/Xz N6qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PbAl4kI4EWPjlfr5EPy02/EZq5DBezEwz9F8zcvz1MI=; b=QLbpxHYKhK1M9iss9JxbCKYAiKNHoyfFPcuoYnCfQTwRSTVUXosV95eq7YQH5LbMp7 KTepldD6HbVtoBnqHqZJyir8Kjlp5EDpx0RS466x8BjaYXOZvQ8jbPr3z8pCMtm1kC8n qqk2OcY8zhfJQZomI46IHNm+ORvlzzIs6/COKvhyjJKjV0Geo7qDCsTDyGmZW67OoNF3 IYAgkXMceaiGeruHsr+SwImIL1/jlZ6FkPXHOov5JQAIhF5sOhO7c5Dna+BFZ6apwezj 8kxM46tccH9Xh6fhELBG0LePZf6qEntInsDlFhYov+RLqhtsQ3xQlo2GMBmb8s22P4Hp N4dQ== X-Gm-Message-State: AOAM530HXfBMhiWBbNr6vPNr1FnbOjkCHfIMwlWY8j+7lJiQiVkpajxq 4CDFPLbmvNRoAao5M1kuSjQxQg== X-Received: by 2002:a17:90a:974b:b0:1ea:2bd3:b6f5 with SMTP id i11-20020a17090a974b00b001ea2bd3b6f5mr5254156pjw.196.1654954507141; Sat, 11 Jun 2022 06:35:07 -0700 (PDT) Received: from localhost.localdomain ([199.101.192.70]) by smtp.gmail.com with ESMTPSA id y190-20020a6264c7000000b00517c84fd24asm1587267pfb.172.2022.06.11.06.35.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 11 Jun 2022 06:35:06 -0700 (PDT) From: Zhangfei Gao To: Minchan Kim , John Hubbard , "Paul E . McKenney" , Andrew Morton , shameerali.kolothum.thodi@huawei.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Zhangfei Gao Subject: [PATCH] mm: fix is_pinnable_page return value Date: Sat, 11 Jun 2022 21:34:42 +0800 Message-Id: <20220611133442.15290-1-zhangfei.gao@linaro.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 1c563432588d ("mm: fix is_pinnable_page against a cma page") Changes from return !(is_zone_movable_page(page) || is_migrate_cma_page(page)) || is_zero_pfn(page_to_pfn(page)); to return !(is_zone_movable_page(page) || is_zero_pfn(page_to_pfn(page))); Unfortunately, this changes the return value since the ! area is error. It should be: return !(is_zone_movable_page(page)) || is_zero_pfn(page_to_pfn(page)); This causes qemu to be hung with a passthrough device. Fixes: 1c563432588d ("mm: fix is_pinnable_page against a cma page") Signed-off-by: Zhangfei Gao --- include/linux/mm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index bc8f326be0ce..bbbcdde6c4dc 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1600,7 +1600,7 @@ static inline bool is_pinnable_page(struct page *page) if (mt == MIGRATE_CMA || mt == MIGRATE_ISOLATE) return false; #endif - return !(is_zone_movable_page(page) || is_zero_pfn(page_to_pfn(page))); + return !(is_zone_movable_page(page)) || is_zero_pfn(page_to_pfn(page)); } #else static inline bool is_pinnable_page(struct page *page) -- 2.36.1