Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18917004rwd; Wed, 28 Jun 2023 02:26:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7cF2mrOa2GPd7KpKpWVzXwq0zYvTEItQyBJN1SYlC2Rcei0r2+hBk5iZbsKg3xXjcoNobT X-Received: by 2002:a17:907:3d92:b0:98e:1c4b:10bb with SMTP id he18-20020a1709073d9200b0098e1c4b10bbmr10411882ejc.35.1687944402311; Wed, 28 Jun 2023 02:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687944402; cv=none; d=google.com; s=arc-20160816; b=eZRFdd7326BNJMRIMA5GYQb6QKtwF8leZsiMsnaCgRbjwxg4s8hXzVEJnRIR1n560m d/RsZ+mAkP84lafN7ihr1RBsk2BRQoUlGNjtQuRo4Adhd8Ml2M8WcaUmfeUQQ9GFA1Wp obOSAiHGJ80ju5krYsdXyeobAIT492juRNFjofQaxtiUeQpD+CdP7EVNpr5kozJQKng0 zDPAo4EuxqTRyJWgiGIJRYPcDms90RyUhBx2bb6b92gnaZ8G1pbFvT/sTTPmMG6lQQ8T 3MysCxA/9B6y340//baNU810t0OPVzfDkOys332t52GhnNU7IaBTB2oNt/ERbAqn9J1R i/UA== 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:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=6Q86n1mHk0BE6RgkRnw6hMZZbrZDijUwhzfBhT4vxVU=; fh=fclos0ogelXzajl1AKsgH2i8SKPkK6eZ8iOsGqlo7iQ=; b=uetnZjIOFOramGltjkKsC3MpqcKRBJpJbValovcskXAZEL3VjS2+0iNoUqxGrJ9kB7 rMNGpmZEosceKTkROz4jlS0yRYf5kUkYTViF5/o1SDzMhts0FmrKQ4wCGJ2nBVwOhST1 EtydvtA5w6+vEnbjXPqJczQbqFbaqTyZUStJ4e6Vp8kJIm3sNdk+h5V8SPMjhl0yvVUd uEfWQwyBRS9ezpmf/f7rcFjDJOvc1ZNgPoUqjiEW/6t9931L2x1VGg1c6cy4WI9HoNZi lF4H3dOKzRJlxHhkH1XENQ4GNz26XAtPxDR5b+Ue39cpAPQp3NwrYFB0vjNbLX7zN/Ej kIlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=mtwgShxL; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qc12-20020a170906d8ac00b0098aa2c4209esi5390180ejb.424.2023.06.28.02.26.17; Wed, 28 Jun 2023 02:26:42 -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=@collabora.com header.s=mail header.b=mtwgShxL; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234860AbjF1IeD (ORCPT + 99 others); Wed, 28 Jun 2023 04:34:03 -0400 Received: from madras.collabora.co.uk ([46.235.227.172]:32772 "EHLO madras.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235465AbjF1Ibj (ORCPT ); Wed, 28 Jun 2023 04:31:39 -0400 Received: from [192.168.10.54] (unknown [182.179.162.32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id 52947660716D; Wed, 28 Jun 2023 07:03:51 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687932238; bh=Mnlsggp9LUoS8ve7lv1HuoaS0bmkESWlf5OUJi5Yvkg=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=mtwgShxLJXCcwEam7M0PfR4SvBpDh8abUYPjYTamu74SIzmR2joyzzavKdoArvNuB nRSob2PXk934h4fvu2vLMtqfmEH257l2n5sSuLNTcht9AjHnEBIEA4X9b2iD7s6Kdp oyLtdDgOsFk1pwIGepOZCkT0WiuzwivKJVDQ1pZ9WzWzytIRWyhufS6hgn6UVTSys+ iwH9DPNXEw6t5FZ1bKlSPXEBxg3jTg4miZptd7d63NVeFHuLTYhcpLhpS84vbUnX0w IlsCZCstDQQ+LinINZe5gE5lY2Il64nYqc4HtIPtZludnhDTh9+qzMIbtaBDMR836V y2vShbeIgCJvQ== Message-ID: Date: Wed, 28 Jun 2023 11:03:46 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Cc: Muhammad Usama Anjum , 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 Subject: Re: [PATCH v21 2/5] fs/proc/task_mmu: Implement IOCTL to get and optionally clear info about PTEs Content-Language: en-US To: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Andrei Vagin References: <20230626113156.1274521-1-usama.anjum@collabora.com> <20230626113156.1274521-3-usama.anjum@collabora.com> <13ea54c0-25a3-285c-f47e-d6da11c91795@collabora.com> <6ac9c60e-0a6b-110a-cace-97afbd9708a0@collabora.com> From: Muhammad Usama Anjum In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/28/23 12:54 AM, Michał Mirosław wrote: > On Tue, 27 Jun 2023 at 21:20, Muhammad Usama Anjum > wrote: >> Thanks Michał for replying. >> >> On 6/27/23 11:52 PM, Michał Mirosław wrote: >>> 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 AM, 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 address? >>>> >>>> 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. >> This is ambiguous. > > Can you explain? Both solutions would allow to return the restart > point back to the caller (the second one would need to stop the walk > as soon as the matching page range finishes -- that creates > discontinuity). > >>> 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 != end). >> Nice idea. But returning ending address in len seems a bit strange. > > I mean that it would update `start` = start value for next call' and > `len` = `len` - (new `start` - original `start`). > > By replacing `len` I meant to remove the field and add `end` instead > to make the requested range use begin .. end (iterator range) style > instead of start + len (buffer and length). In this version you only > need to update `start` (or `begin` if you prefer). The `start` and `end` with updating the `start` with ending address seems most appropriate. I'll make updates. > > Best Regards > Michał Mirosław -- BR, Muhammad Usama Anjum