Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18171066rwd; Tue, 27 Jun 2023 12:45:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4QVqjwxWH4Hl2RYTmNkY2gHTtIdsysM6NqjpnNGbMKOrKwVdrJfERiSJ6v2qH2cnhShsy4 X-Received: by 2002:a05:6a20:6a0e:b0:125:dd60:957a with SMTP id p14-20020a056a206a0e00b00125dd60957amr16955246pzk.26.1687895104763; Tue, 27 Jun 2023 12:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687895104; cv=none; d=google.com; s=arc-20160816; b=BycNHu1X5T4fvkpqbtBi6uyB8ReIC3AfgzmV8MZ9ajaCTVvoqUDWEUMIfWgq/qPzNu 1wpcLB7113G2ldQ4Hvn4JqZlPXCn+x3HClafUqOsA5v3w3XATndNIOZiG0U/9NIOLsGb U1PqBZmhM2uLkdraG3YTBhOhns4xPx8t6VTYl1gPrW5tRIKwly574pCMgoENMYiHHCK4 6s0qMeaS4kPj/Cc67ZHJEq57caeISumBDSsFYerV6MnFrdggCzNAKTthZJZU+s5jU0mM 4v9o+o3otG1AOxCWWRfUBvv2Hf+DVE4EqLclrl48S5bmjIbwDY06n9N5hFPGZ6xwwnBK UYOw== 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=BjcnIwiPxapJns6Fvhfj+Gzckwlkn68eXeMaqlAMhxY=; fh=fclos0ogelXzajl1AKsgH2i8SKPkK6eZ8iOsGqlo7iQ=; b=YxdyUVjNWD8X9kFOqxEmHvVkXu0GJ8VMar6n+Gyuzm9QAzkh4aKO8byS2osYMWXnad KxzFE2jgAEiMYG6mMes2YG/uMkkmKX0kz9AtBq+8ukHidBr0X63ZE/aC4HHyOPspegJ0 imqCk8oiaXYKw/a4/DJOulIsq7dKHgL5m1eXMagUuZf9NfHyiEplyb8sOvTYzH8byEbP 4bdukjDlKrPcKDJBSiYPg1hZO2/zU5InCQzkRX7qkSbZvpsVPbdcI+OjtNI5lDrE2TEQ 1YNRwIfLE896e18sEJ0NpG3YMTzUTwakzArf4UlOPUPTEou7jv5xDiHRsxdwKcQ5iDUl Zx4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=LOFsHOBX; 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 z16-20020a656650000000b005574bf28174si7772678pgv.491.2023.06.27.12.44.50; Tue, 27 Jun 2023 12:45:04 -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=LOFsHOBX; 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 S230189AbjF0TUd (ORCPT + 99 others); Tue, 27 Jun 2023 15:20:33 -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 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 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