Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18144241rwd; Tue, 27 Jun 2023 12:17:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ54b6iFRfSdWv738v7qOZJVnbpl2fONUzNGsizWhLn/XfdOuqjBcexDoxzZmMQq0hjS5jaT X-Received: by 2002:a05:6a00:1305:b0:666:c1ab:d6e5 with SMTP id j5-20020a056a00130500b00666c1abd6e5mr43622411pfu.16.1687893443748; Tue, 27 Jun 2023 12:17:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687893443; cv=none; d=google.com; s=arc-20160816; b=tVF++vh3eLO4PpST28vu45ngw7ei5AozBtvikogF/c33g/DgIkpyLlDvIqp66jlUZY qlJ/JLfKVuoFKCgXZ48KtZAIRS0clZ24quWEisJrtgIzxu3yz6rEh12YehBQIQ5UGTk1 9F8l1h3IKYWv0FO6tOGsPRX2OnSl45jcfi0tiNFbctb7b5AECBt9s8/qvpQxKVDvHqFe cAmL07+lgnObFLnc4FVr8EkTTiXZuJLhrtv8H3li87+yXPjcKurpx4vPGKwUCxTX0rIK l54jTWKyJmOIC7O2mKupWzzBkV4t1m32qC5wMPXDAvVT8W3Xi4ya3PrX1CcojkeNtvNf Xv8w== 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=zrMUD+bzjYq5U/OlRQ46C95vvZ+AhNRjqJFLfHa8n58=; fh=aKXzSaxi2e/+gZtTQRKN59HrSoaWqRVW1+pZ3HZKQ8Y=; b=pERvu6nvttbUXRZNj3I9Dm9PzJaZP7IEtFKASwOJqKt77tPnCHVaKV5nNeavOPmewl fe7ld+OLa34KbXQ4o9taaAW/o4v5f5rM+flk19bGBKaE8YRT0uHIN3kAzjkcj0Tr5b2I pZz7Mumij2U553SM8TSLk8dl40EGM3T3iRTHU/vA0Wf539bugwt2tDvq/rMJ2/NjDofU o70phGi2r14c065KuxOKfe8ycfEUsBi867CJCAL7DLizyBDFE7NRYIewKZMMyudM8PIr MTbHrsSD32wlz3foV45VVQVCLZkT7GTxxQoC5LPv89InhOb9whM8OtsQ+4Vs6qUqZcIz +Dnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Lwjol0Kz; 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 c195-20020a624ecc000000b0066716dc507csi7039688pfb.400.2023.06.27.12.17.10; Tue, 27 Jun 2023 12:17:23 -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=Lwjol0Kz; 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 S231202AbjF0Sww (ORCPT + 99 others); Tue, 27 Jun 2023 14:52:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231255AbjF0Swr (ORCPT ); Tue, 27 Jun 2023 14:52:47 -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 725D71BF9 for ; Tue, 27 Jun 2023 11:52:43 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-51d9372f027so1896a12.0 for ; Tue, 27 Jun 2023 11:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687891961; x=1690483961; 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=zrMUD+bzjYq5U/OlRQ46C95vvZ+AhNRjqJFLfHa8n58=; b=Lwjol0KzgSFyHrtVjCTTjkFPYma+RQF77JRbL0wBs9NJOySx0p1L2f3KoQOq2wtYew bTbS4LUyDDLndkY34CBSLWvRzEdphSFvMUqTZGeF54WZZxThj2qDyI+xzBCFM4pogR7W 6bazPitMsZvcEA2YauBwiyijlOt2eO2AU6tgt0np1VbzJ0e1mNjUm9eEqWYW+z1kIExA Z01Z8niT6EkjqiZzq1atZgnkgvSbxGXUcTwbQbaWqN4xOUMT4xyf3shnyJrljigB3h2A KL/F/itIeavYuh/huelf/SLkHAf8a+Z3lf6f75s5Rw9smZoquAjZxv8gONeapQ66QuF+ fv8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687891961; x=1690483961; 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=zrMUD+bzjYq5U/OlRQ46C95vvZ+AhNRjqJFLfHa8n58=; b=JG87tV5MFeXdJ1EBMOG7d1pc2UJ8hxk/iZn9eGstSLxR4HUJ5nmeMBIZh3JY/I4Zge 5VTx2XgwopDoLJu/ytuS26e+12IG+BHjcua0qr3AQr1aL7NrO7cB3NyGgQ8DuUs3jPCR TyWF5jsMlwvgccC/TxWB+pzs7PrhO0cn23Na2dCh6QmxFNkmfgUVJLMiTqt29TSSBKNW AiM/ajSbtijAvg0DI7oXBShn9dyjzOOrbOxF6p/2ZYtP/x9gZiMjRnJxj9iv0xI/IjmQ zsjZxDjWI5c1MY/VB3SFCkzPNHlov+tYd+pLNXfysn8sUFRUd7od9qNf0zYxq7L38VLh rtYg== X-Gm-Message-State: AC+VfDwr0lXXiIA41nX/HFWJP5gJNoO77HsMftn9xLvhGeb5ngz2ECdS UIP40o8JnnZwMIowc7zuLu9kSQk5qA4XOaojs6aSKA== X-Received: by 2002:a50:a6c3:0:b0:506:90c4:b63b with SMTP id f3-20020a50a6c3000000b0050690c4b63bmr12556edc.4.1687891961572; Tue, 27 Jun 2023 11:52:41 -0700 (PDT) MIME-Version: 1.0 References: <20230626113156.1274521-1-usama.anjum@collabora.com> <20230626113156.1274521-3-usama.anjum@collabora.com> <13ea54c0-25a3-285c-f47e-d6da11c91795@collabora.com> In-Reply-To: <13ea54c0-25a3-285c-f47e-d6da11c91795@collabora.com> From: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Date: Tue, 27 Jun 2023 20:52:30 +0200 Message-ID: Subject: Re: [PATCH v21 2/5] fs/proc/task_mmu: Implement IOCTL to get and optionally clear info about PTEs To: Muhammad Usama Anjum Cc: Andrei Vagin , Peter Xu , David Hildenbrand , Andrew Morton , 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 Tue, 27 Jun 2023 at 11:00, Muhammad Usama Anjum wrote: > > Hi Andrei and Michal, > > Lets resolve last two points. Please reply below. > > On 6/27/23 6:46=E2=80=AFAM, Andrei Vagin wrote: [...] > > And we need to report an address where it stopped scanning. > > We can do that by adding zero length vector. > I don't want to do multiplexing the ending address in vec. Can we add > end_addr variable in struct pm_scan_arg to always return the ending addre= ss? > > struct pm_scan_arg { > ... > _u64 end_addr; > }; The idea to emit a zero-length entry for the end looks nice. This has the disadvantage that we'd need to either reserve one entry for the ending marker or stop the walk after the last entry is no longer matching. Another solution would be to rewrite 'start' and 'len'. The caller would be forced to use non-const `pm_scan_arg`, but I expect the `vec` pointer would normally be written anyway (unless using only a statically-allocated buffer). Also, if the 'len' is replaced with 'end' that would make the ioctl easily restartable (just call again if start !=3D end). Best Regards Micha=C5=82 Miros=C5=82aw