From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A1C5EB64DC for ; Tue, 27 Jun 2023 19:20:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229957AbjF0TUc (ORCPT ); Tue, 27 Jun 2023 15:20:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbjF0TUb (ORCPT ); Tue, 27 Jun 2023 15:20:31 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E590AE6C; Tue, 27 Jun 2023 12:20:29 -0700 (PDT) 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)) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id C722C6602B7B; Tue, 27 Jun 2023 20:20:20 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1687893628; bh=F15IKQFG8u9IA2svUTjlj+/hsiBSNLiVRfc6Ea4qK5Y=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=LOFsHOBX4U4Uy7UEUZWZ9MD/sgEEQnXUPJ+PgInwntLBz8NCYLV2NWdKQC6xJSN9t 5PMAm0JXmkf5t+AuNrzjesiNU0aV8cXovWxXYwIo9CdyBjX2SF+SsDzHt7FQD6pdnq AyB4LtU3+GIGkwCpiWzVppiq+uUONypRnev2BLiFqwftfArFrV0c+va3i+VamrQceM 5PDZmAJUNG5ULcVU52WtGNB4O/sW9hbubxcey/dBnPc0TB2COuFDtfrnh0AoDm1wWF Z0Z/OPHd41D5S6/n7POqDERCDuvHs4R9ym079MJE6BQZglz28kGtEBN70vs2HGRj7s wyzaL6AVZZnLg== Message-ID: <6ac9c60e-0a6b-110a-cace-97afbd9708a0@collabora.com> Date: Wed, 28 Jun 2023 00:20:16 +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> 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-fsdevel@vger.kernel.org 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. > > 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. pm_scan_arg already has 11 members. Wouldn't it be okay to add one more? It would be straight forward as well. If nobody replies until tomorrow, I'll start returning ending address in len. > > Best Regards > Michał Mirosław -- BR, Muhammad Usama Anjum