Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9450258rwd; Wed, 21 Jun 2023 07:36:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Lb/5Ky7KwPSh1taRDxZdGe06rXoeMt4MTUuGirRGEG1otnJttxRGK0ocjqExLEBCW8HB8 X-Received: by 2002:a17:902:e541:b0:1b6:a91d:bd1f with SMTP id n1-20020a170902e54100b001b6a91dbd1fmr225345plf.6.1687358218707; Wed, 21 Jun 2023 07:36:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687358218; cv=none; d=google.com; s=arc-20160816; b=UeGvdF5qtxe6AjxjE3uvH4r4GVLk9vmmXt0Kfoh/zw4k2fnFbYkuE35Pco/jiII0j+ /wmTNOZgPO+wQJB+R6ZfPIMs9IAIwtIn3y0jto1CXmxOCgoYDbmnlKMU0xvVLHnOW+ML O/ZpmEhFJXRQGHFTzFS7TySkdLKc5rq0A0bZ6M9DMEkMrx0zOzXZtWFuk7+YpIHN/yeq oe5K2FhjyVd/FV0HLBrgmoQg2CWoDEZBiKKFmzywhUsgXLaxnXnwuqGhf8ne6Z7HvRss cm/Hi9E1q9/Ja5mnwcb945rtW7YcyIYf4TFnYJ6044OGiv9ZtA5M3z33aeCVCEcoMwb1 ITuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Nx/8tkwi/QCBsZ8gmyeG8Rkuz2KMvUk7ydKIx+Um+wA=; b=HszNBW76tH8w3rd33NAg7vm7WHNkJ9OD/qLp70ZbFUgZJZWPbot9aXko819QrbWvD9 yXK3IMx96wd+mWY4Jj5BXCdlb3swcrG6iVlQXzhjGh1sSvrcGIXxzgUlAKTzzIHkFiVq M6mu+QUDln67+SryOmQmHzaQe3igZNSVpbKhZtLGKZTFhyiSBI+HjO02IUUMBSc05UfR 5jCPu/ttn6Its/zWhHaLCVKv3+UF8/+pwyAekHujQP96gv195tY48YRYEXdPFe8K15TB nN4AnvcTsYwQa9b6i7qK2t/UWiJTDbWw4FXrFLRpZFHhgbBoNnDR1JWpGO3YUluhgLlM soWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Zx7ZT6CD; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f16-20020a63e310000000b00553851380b9si3971529pgh.352.2023.06.21.07.36.46; Wed, 21 Jun 2023 07:36:58 -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=@google.com header.s=20221208 header.b=Zx7ZT6CD; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232987AbjFUO2a (ORCPT + 99 others); Wed, 21 Jun 2023 10:28:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232955AbjFUO2J (ORCPT ); Wed, 21 Jun 2023 10:28:09 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 556851FF2 for ; Wed, 21 Jun 2023 07:27:47 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-516500163b2so3686a12.1 for ; Wed, 21 Jun 2023 07:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687357666; x=1689949666; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Nx/8tkwi/QCBsZ8gmyeG8Rkuz2KMvUk7ydKIx+Um+wA=; b=Zx7ZT6CDGiK06H867vY+sNm4wafZK+Kvmb8BqCHCD+RgK/A8TOsKrYm88ZeQ2SECqv S7fVo2jMZAWlKlfibVSF4+NdJIuFTIa0/hV9eZbzpGNs8NdeOq6Gf/hK1j41+VqJkX7f 0MdtnvEDcTvQ1qlxcyubtHy52SpsQWtzGcgMHO/beMlI2JAgE/lBuWgZO2ZNHA+12UAk 6xkAO2o6lOr6d4DjCP484PkPelet7gw71VpFO6zM1RaeJUU4GliVx6GQS/0Q1anV9/b0 1vlDsaqBmqIlvqPZnEthL85A7DkyTOobm6olApyMhJG0hLtOI5m8PH9wari0gbV3oEGX O3+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687357666; x=1689949666; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Nx/8tkwi/QCBsZ8gmyeG8Rkuz2KMvUk7ydKIx+Um+wA=; b=SqsKBGuP+76kapEesGiUJ8HzHmL6RytEObyX0aBjzvFkKawbR6ik84yul3Ss8OZa4+ OcQTBe7jnLQKv3nMvYecaelfOnxdRwM11vbkHuL1XJOTtk7t+n2YG8EsR3/LNCNSJvDr 9QTyYwasmw+GGLOnQ+JflOmDSwbgRheUGGPRli/5YwJTE7fEGiMiiXbe1LlXQwEd7gGo pCJFhsffntsCMfvWSOCcuN9dE5cPID806AU2U5pPM+Mqya5vzdrIeDh7FO5EdqmKNRba AOeBnREcEQqlt97BvM4AEoJItYZgWkbqiTVsaUZxK/xEv6tYrpgB3I7PpN9ry6/vynnc kHYA== X-Gm-Message-State: AC+VfDzbUl+f4NkYg/D/EavqIpumcI0IK9YkoHsqGWJ95v+kVnDm7ffc 8opS8uNBOQUlmxuGGJ1AltBZcHUKmB0Xiz3EMjNM1Q== X-Received: by 2002:a50:d79a:0:b0:506:b280:4993 with SMTP id w26-20020a50d79a000000b00506b2804993mr20647edi.2.1687357665556; Wed, 21 Jun 2023 07:27:45 -0700 (PDT) MIME-Version: 1.0 References: <20230621072404.2918101-1-usama.anjum@collabora.com> <20230621072404.2918101-3-usama.anjum@collabora.com> In-Reply-To: From: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Date: Wed, 21 Jun 2023 16:27:34 +0200 Message-ID: Subject: Re: [PATCH v20 2/5] fs/proc/task_mmu: Implement IOCTL to get and optionally clear info about PTEs To: Muhammad Usama Anjum Cc: Peter Xu , David Hildenbrand , Andrew Morton , Andrei Vagin , Danylo Mocherniuk , Paul Gofman , Cyrill Gorcunov , Mike Rapoport , Nadav Amit , Alexander Viro , Shuah Khan , Christian Brauner , Yang Shi , Vlastimil Babka , "Liam R . Howlett" , Yun Zhou , Suren Baghdasaryan , Alex Sierra , Matthew Wilcox , Pasha Tatashin , Axel Rasmussen , "Gustavo A . R . Silva" , Dan Williams , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, Greg KH , kernel@collabora.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Wed, 21 Jun 2023 at 16:16, Muhammad Usama Anjum wrote: > On 6/21/23 6:42=E2=80=AFPM, Micha=C5=82 Miros=C5=82aw wrote: > > On Wed, 21 Jun 2023 at 09:24, Muhammad Usama Anjum > > wrote: > > [...] > >> +static int pagemap_scan_test_walk(unsigned long start, unsigned long = end, > >> + struct mm_walk *walk) > >> +{ > >> + struct pagemap_scan_private *p =3D walk->private; > >> + struct vm_area_struct *vma =3D walk->vma; > >> + > >> + if ((p->flags & PM_SCAN_REQUIRE_UFFD) && (!userfaultfd_wp_asyn= c(vma) || > >> + !userfaultfd_wp_use_markers(vma))) > >> + return -EPERM; > >> + > >> + if (vma->vm_flags & VM_PFNMAP) > >> + return 1; > >> + > >> + return 0; > >> +} > > > > This could actually short-circuit all vma flags (e.g. IS_FILE): if > > (required_mask & IS_FILE && vma is not file-backed) return 0; > Sorry, unable to understand you. Should we do something here? It seems I had an earlier version of the patch in my mind, where PAGE_IS_FILE was based on vma type. Sorry for the noise. Best Regards Micha=C5=82 Miros=C5=82aw > > > > > Best Regards > > Micha=C5=82 Miros=C5=82aw > > -- > BR, > Muhammad Usama Anjum