Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1017539iob; Fri, 13 May 2022 19:48:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzq/5X6YFSnoF33d4Z5VQvVQSYy0QNI2zjccrrjh/JvQQ5z3n9P7oFhko6KnJ356BNGmGAh X-Received: by 2002:a5d:56c9:0:b0:20a:c54c:70e2 with SMTP id m9-20020a5d56c9000000b0020ac54c70e2mr6205403wrw.415.1652496481758; Fri, 13 May 2022 19:48:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1652496481; cv=pass; d=google.com; s=arc-20160816; b=UXk/SPcztw3jv19piKM9EMwaZrMVyOs60fJizSr4Too6zXhDF6uvymRIP4q3Gw72V9 9IuaWEINttyV8TdZUyVDX+/OdaSsXTQzPELrbn8hFgySFsnou87s4jQwd5qwOIl1d70Y XQrtgEQuV4w5CwdzJzLqCov+dFh6Hlv7DQpwnglqcL1BaTpV77/h6gfH4g7wvTI1Gt6O KklU8Sb7ckWpm6texavWu9GTrO8qFLeVCsSpVM3wGu2Q4bTHadpfE5Kbz0iW1TQWbjSH Gj/iT218/oMuQkSaAYroaJEuqvmAixLi5gwV9KSvT+vjDT3Rcm5bJmd38mmPP6o/kIy8 SNBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=hFtBqUfOCsFrHEqi1h+oUo+5wlBEelYgMwLMW0MI0og=; b=DvCkGRDRvJv0//KBYz+GTB4s9eMazIvicJ7eBssVpMAKq846116lIx4uR6z+F1839Q tt13YirXti6wqjyyWtoP0qqi8/jamjv18jn2E6cVojkMomFUfRW08i4figAHfby/WK/P N5pWcWxGWUskoU1sIx4bfvAA6RWJU41t5PTqBsJgeOPDzi+PP8hcV+P001Yiy2oCH4gM AK73hz9tXeC/ixvZ7P6TfS3cTaQWXz6lymrLMbvhceDQjFdUwnoB5giYHYoW5MxCcLT1 fwbqhodTCylqS1RTPLzqwzDZSfSADxjlZW7OSVT+3qVZ0CV6bwNM4rozt2elRu8DDWi4 NumA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Fqdw7+2P; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u7-20020a056000160700b0020c9989cb39si4286404wrb.373.2022.05.13.19.48.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:48:01 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Fqdw7+2P; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DA765367E41; Fri, 13 May 2022 16:35:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349047AbiEKXMq (ORCPT + 99 others); Wed, 11 May 2022 19:12:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235432AbiEKXMp (ORCPT ); Wed, 11 May 2022 19:12:45 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2072.outbound.protection.outlook.com [40.107.220.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 532AD1683E7 for ; Wed, 11 May 2022 16:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CbXWNIrixe3ctH756Zsp3U/YsO605NP2blFAOTWuVJPkziC9xSUEGpfqOBDheJyZ9Q4nFffRRr7UmFnimpSTIxZ79ajW+xYTcd1Y3hH7xOmDn48IvZUajYykB6g71ZBgBcbh+JyaUOCHoqd9wK1S5tJ7Gzd/suMeRi9fJ22Ar2qH3mGmI19RlCKdsgzBVbp0eZX/FSjgz+4P2Mf2wpeOz1UmCFWtQg7RL/EDnYFukhjvWMsKLWI/BjE+o9YjnPOHj79a53xV+NgS+En8d9QXx8OQmuL3o/fpdOkyJ0NBibYM5N4XLu3Ct70UqlXztNd7oc05ReS9tKobxnuNlIgH0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hFtBqUfOCsFrHEqi1h+oUo+5wlBEelYgMwLMW0MI0og=; b=i3LrOOFcS3FsPnRrIrcSlZ0xKPlaZOGw41kFchN+rcGi+CayMDwZd7cj/HqIhTbQj06Q4ALlPnY/t/W/3E1StyPYNUEqn+DZBMT3jkweFsquGWQ/W3MKiUomuZRYa8xsw7eEimlAE88+VTHcE1k/Snzh8TzqlCwei3+H7G26QN+6hbrNGIxpqjy6jM3terNmM7+sarU9tXQR5xqJmog5PLuJ0b16NasQfjdCemiUSrDCXmlhntoPAz190Y8iAWEsrgoZWsTe0KXCn+40f+ftClBjGxhSEl/SpT2TdgH84jGOttHOmqcrGzXwdbEYzociLG8dFqqqVnS+mr+l1XMGQA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hFtBqUfOCsFrHEqi1h+oUo+5wlBEelYgMwLMW0MI0og=; b=Fqdw7+2PpsRXX3WOe8rM2wUNwEiin+0Nugefaf7Ab3dbYeUZInNYW6JPiGnLr8xSGVOPqJXDnsooiIDM5Dxsrs7gs98S41PD3OZOOnpYlPpCzmUsGKgANVLAZYP/NCYCDekIg8D5wFZG/QbpmIM8VyZiRs+YVfiED4/mPrdH0+fLLNzFhLtDcWKEU6yIKp5ISNObignAD/cxY+PemkVkiH+g/EP5GdDozwZTdvolhr2/w1TY5mIycLyeNx+AF/EVsY/BDMNzmONGCVSsCWLURnbx1VvhwfCSpkqmZElgVqCl+cp6v+20u8NaeZ4KEv7m5AM2RIh1jEKjg6lKixelng== Received: from DS7PR05CA0046.namprd05.prod.outlook.com (2603:10b6:8:2f::14) by DM4PR12MB6064.namprd12.prod.outlook.com (2603:10b6:8:af::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20; Wed, 11 May 2022 23:12:42 +0000 Received: from DM6NAM11FT011.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2f:cafe::5d) by DS7PR05CA0046.outlook.office365.com (2603:10b6:8:2f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.13 via Frontend Transport; Wed, 11 May 2022 23:12:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by DM6NAM11FT011.mail.protection.outlook.com (10.13.172.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5250.13 via Frontend Transport; Wed, 11 May 2022 23:12:42 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 11 May 2022 23:12:41 +0000 Received: from [10.110.48.28] (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Wed, 11 May 2022 16:12:40 -0700 Message-ID: <8f083802-7ab0-15ec-b37d-bc9471eea0b1@nvidia.com> Date: Wed, 11 May 2022 16:13:10 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v4] mm: fix is_pinnable_page against on cma page Content-Language: en-US To: Minchan Kim CC: Andrew Morton , linux-mm , LKML , "Paul E . McKenney" , John Dias , David Hildenbrand References: <20220510211743.95831-1-minchan@kernel.org> <857d21da-5de2-fa3e-b1ce-41cc1cfb0191@nvidia.com> <2ffa7670-04ea-bb28-28f8-93a9b9eea7e8@nvidia.com> <54b5d177-f2f4-cef2-3a68-cd3b0b276f86@nvidia.com> From: John Hubbard In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 49c258e3-4957-4df8-6ff5-08da33a3c02e X-MS-TrafficTypeDiagnostic: DM4PR12MB6064:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1r9cIjtDUNF/Ude2UUcwkcqYt8GluaBog7obxybyrocYFFhVkwetrwOxS+nzZuEk8tz+zG8gXfxXqko1YdvMiWQ4TNw3VhvAlsB0QdXZhmyNyTyAADSTLHO4Mn3dXuai36IoawQ3iH3DVk86WeQGOwRR2EMUuUYWreL+DcOmfPZ8xzZGHkJZyjpX45l5X4F1+cLNrjEZv3ulWM2NOtIXywaI2J72zGb597GprUj4em0XULtjt3ULtUAhn/ByJkx9+4QoiTxNLfsksLUnJ5U4z3/TRD7q4ya9/Aik4k77PgUGAy6msvoD3TAWJXSku3ag+mVwcOrvWMsC8sc18BiFXwphSARty4ZVF4/UDWK9LnxoOmQyevY31h9CXlXS3YHGbCwA1OF8DyMAnB7bNlNvvvz3AGKAcuKN5JUJA1G7gSg2GwE8BDUhM9vKs6vImMpZoi+fQ3xS9fIz0cx2YP+FK2jlkhKOMQmR9lq21GffpzakyHl0u60OinqKMfwd1n3WISqwqHOnPErvB4aM/kvuuu2k1Ue7klrxuknto96C3kNCO2U8i0wa77dn/RxAOepsh9KGcjknWvqhXgANkJ9biUFMaOcZ5CIs5MAFSEv+/I9K5gQmqG5skW9HIjPtMRP1lrFaxKntgnyMhxVQhHi80IkrLk3eRTHStC1W8prq2izSWGBiJFazuZqG8ipRzMWdhW6MC6jE61T6aUbS9heZdGTJKx+Fl73MdGrWXUzpG/0= X-Forefront-Antispam-Report: CIP:12.22.5.234;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(31696002)(8936002)(16576012)(508600001)(316002)(54906003)(81166007)(6916009)(36860700001)(356005)(70586007)(8676002)(86362001)(4326008)(70206006)(4744005)(16526019)(26005)(31686004)(6666004)(40460700003)(83380400001)(53546011)(2616005)(186003)(426003)(47076005)(336012)(82310400005)(2906002)(5660300002)(36756003)(43740500002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2022 23:12:42.2051 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 49c258e3-4957-4df8-6ff5-08da33a3c02e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.234];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT011.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6064 X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 5/11/22 16:08, Minchan Kim wrote: >> OK, so the code checks the wrong item each time. But the code really >> only needs to know "is either _CMA or _ISOLATE set?". And so you > > Yes. > >> can just sidestep the entire question by writing it like this: >> >> int mt = get_pageblock_migratetype(page); >> >> if (mt & (MIGRATE_ISOLATE | MIGRATE_CMA)) >> return false; > > I am confused. Isn't it same question? > > set_pageblock_migratetype(MIGRATE_ISOLATE) > if (get_pageblock_migrate(page) & MIGRATE_CMA) > > set_pageblock_migratetype(MIGRATE_CMA) > > if (get_pageblock_migrate(page) & MIGRATE_ISOLATE) Well no, because the "&" operation is a single operation on the CPU, and isn't going to get split up like that. thanks, -- John Hubbard NVIDIA