Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp482988pxh; Wed, 10 Nov 2021 05:01:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWrRJjez8M3L/OBeTSlk0vPiDX4khRaz3bRlfY6o7onnuTW8S/y5mIAF/JyIzqStuZtx00 X-Received: by 2002:a17:907:1689:: with SMTP id hc9mr20111189ejc.445.1636549279797; Wed, 10 Nov 2021 05:01:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636549279; cv=none; d=google.com; s=arc-20160816; b=p80tnew2zW2LLXec+lGHGhlPH3xWnGKliw8BChp7Zk86VB0GJSt7WMYKl56VCbuH1y fGKXSyWfhdviElyxuOZHcRQymjraH0I5v+R2QT3XKw+GbyI8KlzxUqtZ7sSO+1qhOVNh y/5JUA5Q5xih1OlOa4GowuBOrFIQzNN8TGtL9YfTa3tpE3IUmIWWSK5EajIg1jFb+Ha6 KuB4bTZ5dqs1S9apou0i/OUP65M8alwOlHhxXVG6hx2tPJCd08hrsieGmGILyGka97Ui NsiO8njocqTZHhfvuYX6Ww6mAf6+6yPbQ4+PxAKnyq5kfqciPTkAGo4feW7Q8Ypwe5ZX zNKg== ARC-Message-Signature: i=1; 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:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=bYJCDmXhbZdwQcqQV6p0qfHrLLCZuMTTGmF8KIZ2ebg=; b=hnsxJEsSJFoglI3rF3CRKRZ75rEYYZGG5eVoG0aKibzWlzzrJ84ZFBkey7o5xNtMwR ddCUOT3UbHyI/gveLDlgEwZnK188DZ9A74C3rG04wba2KFA9N8mpLf/9D1G/Y/lai/r+ aKl8DR0QcehKBJPQMNwFUGJtjpzLyl17BWcodJFRDMfWFvcxn2g4hAFCItKQkkP2XFjQ C5G0h6eWdW8z0FK4EUCjAdzPByrUuhFvAudXW0hIM55aKkaP7WeBZaNrcsvmKIvTFTkF MYW6lSqW+aHSbhXh1yjNQ1Fh8pVgcU1MlR2ASbSY9nEwsZVCw11QV6ZYyE6KqV6jkuXi l2HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=0Qj3WziV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z18si54578309edd.70.2021.11.10.05.00.51; Wed, 10 Nov 2021 05:01:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=0Qj3WziV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231503AbhKJNBa (ORCPT + 99 others); Wed, 10 Nov 2021 08:01:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231460AbhKJNB3 (ORCPT ); Wed, 10 Nov 2021 08:01:29 -0500 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 776E6C061764 for ; Wed, 10 Nov 2021 04:58:42 -0800 (PST) Received: by mail-pf1-x434.google.com with SMTP id r130so2613978pfc.1 for ; Wed, 10 Nov 2021 04:58:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:to:cc:references :from:in-reply-to:content-transfer-encoding; bh=bYJCDmXhbZdwQcqQV6p0qfHrLLCZuMTTGmF8KIZ2ebg=; b=0Qj3WziVPa6/9jW1dnkM0js30+i48RZdsL8Xr/KA/YP6GLcSd+4iDZ8d/hdjQ+QcSU M8tFdlfYx5DT9eFjBgBgX7wvdySyiUT9yMOii2gUfVN7Vv786Jo8n1ZQKGoQfLnrfzJn kMgCMuI8xZSKKQlHTzYYmwz4+QugGvdqrpEtRr5n8XEjx8U8wfFrwqOfsoMyKoTGZEPV XRghj6fVtEnWuGAMGy4rAqXylpKvDJsxJFvTlcRDQX/x3u17FhglF+aADpjYSkShkleA n8FYpYmuiyTdm9uJcgJVQIbN9ugR1fXEb0+HnKgzmL8CrG3jk/y35V85ws19b9PJfZTg V8lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :to:cc:references:from:in-reply-to:content-transfer-encoding; bh=bYJCDmXhbZdwQcqQV6p0qfHrLLCZuMTTGmF8KIZ2ebg=; b=rKBLyBqjcTLW2F3JKcx/0mHNUfUqmVpA+gIJHFFSzrbXVPGPP56vBFMiKzUJRxEeNx 35tWYw5LcdnOZxCtEnhacSzAGGNjgL7SZECtOslSEKjETZqYHM9fyfYHSPYWPc+zYc9+ RDFdJAl9bSYyN+Gz/Yy5A3LZxpJ1z2GXzXWoTf4zwm4GFBGx7zEk6RWAbwXsjyxH3Djx /g8BN3iXVx8ljK5mX5EOryaKLOKgpESFXqa6xG/EzwWpuv6O9eIkp4JyU1+eELqkmgVP rEy1MOGPvO7zFzKViOxTYmV7AVAq7p+1IGG/B/Xob2Xr23i/2shwfzGRzmgxgHipC3PP GjCw== X-Gm-Message-State: AOAM533VWaC0Mjp5jDx1jytVWaJ5ecJPB/Yl3677bnZUYbJr4N7Qacgu XEzkfr172rkpM7xfgeON+QeEgQ== X-Received: by 2002:a05:6a00:844:b0:49f:dbe4:b911 with SMTP id q4-20020a056a00084400b0049fdbe4b911mr16603220pfk.6.1636549122022; Wed, 10 Nov 2021 04:58:42 -0800 (PST) Received: from [10.254.189.129] ([139.177.225.251]) by smtp.gmail.com with ESMTPSA id t4sm23081243pfj.166.2021.11.10.04.58.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Nov 2021 04:58:41 -0800 (PST) Message-ID: <18fa08bf-847b-1c47-10ee-01c92caeb0cc@bytedance.com> Date: Wed, 10 Nov 2021 20:58:35 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH v3 02/15] mm: introduce is_huge_pmd() helper To: Jason Gunthorpe Cc: akpm@linux-foundation.org, tglx@linutronix.de, kirill.shutemov@linux.intel.com, mika.penttila@nextfour.com, david@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, songmuchun@bytedance.com, zhouchengming@bytedance.com References: <20211110084057.27676-1-zhengqi.arch@bytedance.com> <20211110084057.27676-3-zhengqi.arch@bytedance.com> <20211110122945.GO1740502@nvidia.com> From: Qi Zheng In-Reply-To: <20211110122945.GO1740502@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/10/21 8:29 PM, Jason Gunthorpe wrote: > On Wed, Nov 10, 2021 at 04:40:44PM +0800, Qi Zheng wrote: >> Currently we have some times the following judgments repeated in the >> code: >> >> is_swap_pmd(*pmd) || pmd_trans_huge(*pmd) || pmd_devmap(*pmd) >> >> which is to determine whether the *pmd is a huge pmd, so introduce >> is_huge_pmd() helper to deduplicate them. > > Isn't this pmd_leaf() ? Currently, the implementation of pmd_leaf() does not include pmd_devmap() checks. But considering the semantics of pmd_leaf(), the "devmap" pmd should also belong to "leaf" pmd. Maybe we should modify pmd_leaf() to make it more semantically consistent? By the way, something went wrong when sending this patchset, and I have re-sent the complete patchset, please comment over there. Thanks, Qi > > Jason >