Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp941257iob; Fri, 13 May 2022 17:12:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrm2EhciYZRdnDUe9OJJArcbWusGnxlwXsXuMF3XrwLIX6mrcePva8gKDbJa9yjK2+4JQd X-Received: by 2002:adf:f4c5:0:b0:20a:ece1:1e91 with SMTP id h5-20020adff4c5000000b0020aece11e91mr5937647wrp.172.1652487133781; Fri, 13 May 2022 17:12:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652487133; cv=none; d=google.com; s=arc-20160816; b=NVIASH+n7kYYWDQohx7SaN4BVCL2ByTbJcxFu4n8wnk1j59YE2EcBozxB5iJ/K9IA6 R6InD23AdJ8at2XDQRMIcKuNekXjDrtXqqevU14oIeDB0mKffW7m6pON1E6O3F35+StX ZYdLRgIDsbAIqx3XP9wEalnQiVVs80U5CN9Rt8hrXvEuELcF2r3lkgrmUDUU/4aOHEKl rgcedmhuSXw5PII9Ca3CZHXC/5RmYk/b1W7W5qhbqCJNapu1Yzv32Gw0Uo9bipLR8TnS n2LPNC5g+oay8wZ3UzDEMu4rQX9aIGqgWd5eb/fzSmC6Cn4fzle+MhWZQOewzS+6V2ZC d2QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=m2PZ7/ergchDUvDU1q/dXdJquLBZCPQq2ci7Ijk/I3o=; b=nfb4Dz3prfz7OeMenV3JIlVegRkhatqcNmcdslSUFRqNIk8E388zPVh/ak/ExrQuPr Lai1JP4uaMuWCGBlkjQDx/6cFpKtge24YAwNzWEqrOZN0Vwt5AsEPZ/2EijlVadvkNqD cUVJnQPZQf6EQIS1GXG5HXraC56CLSMo054omGU9waG4cfcchL4QIm81T+oCXH+93Erc vcFCkukDDSwAcyK7uXzfmOmiR+O0+b2+K1NlnH8wcYcnKZwGrytpovyvixXh6y60SBtq f4VznRvqvkFF4MmXsQKcjxB2DS9xdAH6IiXmmvpDz3tXNFmVgzCFbEhD5E6BhGovwDtA mZQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=M4QjA4Sk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i12-20020a5d584c000000b0020cfe065a8dsi63597wrf.974.2022.05.13.17.12.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 17:12:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=M4QjA4Sk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B7E6531AF9A; Fri, 13 May 2022 16:13:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349071AbiEKXPY (ORCPT + 99 others); Wed, 11 May 2022 19:15:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349052AbiEKXPV (ORCPT ); Wed, 11 May 2022 19:15:21 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52CDA16A11C for ; Wed, 11 May 2022 16:15:20 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id c1-20020a17090a558100b001dca2694f23so3335743pji.3 for ; Wed, 11 May 2022 16:15:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=m2PZ7/ergchDUvDU1q/dXdJquLBZCPQq2ci7Ijk/I3o=; b=M4QjA4SkWhdKZ4VkoGA74I2zNJd01CKQqCeov3Rkl/dmflAQtAHHVHBQnwwB9rFKXX U6Z3nkjmpZnQr/91j8VdrH45ohKSPdMwKq6BhiC6VP6/GD3BXg/9AfpT1WgRO7kjj93M rOhelHLMXeiJZKg/tO1XJtQGbatXB7evVCU9CyU93gg19rIKiAR5DZp9mJnnq8sqS1Cq c3zHvjYOhujXQ+RHgpVVn3z/kV6dK26AJIPkolYP2xVoEaI7FS98EWVekkpCihlIE1lW ledrjajj/M1I29UdJHCEqgB31G87bTYP0JEMnWC3CGtJCEtCi3FtdhSwpeRepgtfV9p7 Co7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=m2PZ7/ergchDUvDU1q/dXdJquLBZCPQq2ci7Ijk/I3o=; b=WgAYo0o1ck0sGukApp6t9WKbIf6eM9BQr22KUiCttD+sHQ7i1KnZApLsuO6/gG9nRB i3nfeqg+mONqDILhK+xBy8QxFW+KVxLpEWcjJGGcasYV2gVcsrZLcQnDXI1b93wCReLt BOycjkmY0onuykVV2Mu9sdiSxY9c5PQbJK6LengMwaFNxeDrthToMZVH9BwndcJyr3ds O26vi/OoYGlXLAzRJMR2EJRAgtZzFFzRd0IEUktq6nTi6c8WzG9przVgKHdmROJMemOs fV95tiZyE3oiqSs81nyfqNxo2eorBlZLpLBxhqoeMUkHYfhqeEf/ym9IRJjiDMbeSRl6 fwDw== X-Gm-Message-State: AOAM530tNAoTd3+Xf9SDzVopIsROV/ZC94CIiLEbOHq1STOuIRrS0j+W OPev/Q6mwJ3pjKipi7MhtQ4= X-Received: by 2002:a17:90b:17c5:b0:1dc:e0a6:340b with SMTP id me5-20020a17090b17c500b001dce0a6340bmr7816101pjb.34.1652310919815; Wed, 11 May 2022 16:15:19 -0700 (PDT) Received: from google.com ([2620:15c:211:201:69ef:9c87:7816:4f74]) by smtp.gmail.com with ESMTPSA id c5-20020a170902b68500b0015f0dcd1579sm2498181pls.9.2022.05.11.16.15.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 May 2022 16:15:19 -0700 (PDT) Sender: Minchan Kim Date: Wed, 11 May 2022 16:15:17 -0700 From: Minchan Kim To: John Hubbard Cc: Andrew Morton , linux-mm , LKML , "Paul E . McKenney" , John Dias , David Hildenbrand Subject: Re: [PATCH v4] mm: fix is_pinnable_page against on cma page Message-ID: References: <2ffa7670-04ea-bb28-28f8-93a9b9eea7e8@nvidia.com> <54b5d177-f2f4-cef2-3a68-cd3b0b276f86@nvidia.com> <8f083802-7ab0-15ec-b37d-bc9471eea0b1@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8f083802-7ab0-15ec-b37d-bc9471eea0b1@nvidia.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, May 11, 2022 at 04:13:10PM -0700, John Hubbard wrote: > 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. Oh, if that's true, yeah, I could live with it. Thanks, let me post next revision with commenting about that.