Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp750301rwb; Wed, 26 Jul 2023 02:08:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlHBJd4z3uomEDDa9ZW6EB+91UqtnqkIH3FcAQ3e6rumx+ri/bZcMe4vmQAy9kK1YSSFp1F5 X-Received: by 2002:aa7:c1d2:0:b0:51e:eaf:4fea with SMTP id d18-20020aa7c1d2000000b0051e0eaf4feamr920719edp.35.1690362483695; Wed, 26 Jul 2023 02:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690362483; cv=none; d=google.com; s=arc-20160816; b=04YnFB5ygzJlmsFMkVkJ0w60GwM3wjeFN4IABON0wl5wF0dpuV2mb8vWqHoAICARC9 3xKVfcQIyly3ZVBBpITKe3hFG4YIgZ5a349JzLpKbpBgZH1rZTRkkzoYaL8b7NW9koxl 4fb8M1HmWgp9QOpUKBnABwEdxLh1R/NRTS1nxrxnSIRl1x8XrUutRTeG9PGFQIOxlJBn WDDmkIXEweOhekB0I48hU1pDiLtRskoJUy6T8ZvlhI6q1Lrfs+UMm6UFe5XkxGkdgump KTACGmHFUS3eL+6+vwHdAxeE2dFfQPLoWx3wvIhHeaDX50ppKbZyJ/1ZchT8KlBV118i xx6w== 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=D4dQiLwlj05u0sAvFknPo3GPz2Q8pjoWO/hEqdb8WlE=; fh=eEkkwVarmejJiichqOkJBDj10U9NqlZzN85AmpJa6/8=; b=xRDBHHZDFdTXyvvnbm3DpgA2QOq5cR/Tmwh663s8M7w4RJZDnOYQpFESX2/tzEDaNS okf88gbKGYUi+xcb6al1khL0C5bvYMO9mvAF9wNSam1BFFshecIZaz+hhqfPbq+96cvF 5mpuuXbnWDC8xHXYEob3WT/MINMSypIP3U1Gy4u60oBXh0QesT3nNxBB3ZTf2WTtwj7J 6QzEf0IPm77MCNKLZld2+BfFKhC1hxB48B/ag8ouqhaGOsPnnYJjRj3MxAir+2tRIfdB 89Iq1sRCvMCzVhf4dKMOoQoGq0EZxKmRJ3C+PqR6SkG5dbnTrWvnHQreYGSjlKfgs4s1 d+lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=h9vI4xVf; 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 e9-20020a056402148900b005223d10e178si3192656edv.479.2023.07.26.02.07.37; Wed, 26 Jul 2023 02:08:03 -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=h9vI4xVf; 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 S233231AbjGZIpA (ORCPT + 99 others); Wed, 26 Jul 2023 04:45:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233191AbjGZIob (ORCPT ); Wed, 26 Jul 2023 04:44:31 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AE1F6EA0; Wed, 26 Jul 2023 01:34:36 -0700 (PDT) Received: from [192.168.100.7] (unknown [59.103.218.24]) (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 0A24F6606FCD; Wed, 26 Jul 2023 09:34:24 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1690360474; bh=kbyHAewU6qDnSTSEyCglZNTxAWdvBGgIOe5Sk6F5sTk=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=h9vI4xVfSTcEGbDHFnNp1CkGPb9ffa35OppZjK5mAmcVidyByB2rlTvL5Zkh7i8oO rNof11swMdDQ6XoZmgXX9hkBQELBwhGG98hwt9vvJnulV1RvhlgTcqn1btp9/t5u6O T7cHg9go9dgQa+c7vZTN3miRAntkp2ZZYsnIkGMMMIaRy+kdpvj+aBCiOfFidy3kB+ yVnR/o1QbDrw05pt0FqkJ/LRMk3KT8T1mauAs1bdfW/Nl8beRFvqFMbe9LV0ghm3Qb RxLsslpnJtnsWF2tWh7eU+vg4oVbzPSvp6OfMZRRcEYNpeNh9cJNWPwzQWntK2bjvF v4VrM6r9ucckQ== Message-ID: Date: Wed, 26 Jul 2023 13:34:19 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: Muhammad Usama Anjum , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Andrei Vagin , Danylo Mocherniuk , Alex Sierra , Alexander Viro , Andrew Morton , Axel Rasmussen , Christian Brauner , Cyrill Gorcunov , Dan Williams , David Hildenbrand , Greg KH , "Gustavo A . R . Silva" , "Liam R . Howlett" , Matthew Wilcox , Mike Rapoport , Nadav Amit , Pasha Tatashin , Paul Gofman , Peter Xu , Shuah Khan , Suren Baghdasaryan , Vlastimil Babka , Yang Shi , Yun Zhou , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, kernel@collabora.com Subject: Re: [v3] fs/proc/task_mmu: Implement IOCTL for efficient page table scanning Content-Language: en-US To: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , "Kirill A. Shutemov" References: <20230713101415.108875-6-usama.anjum@collabora.com> <7eedf953-7cf6-c342-8fa8-b7626d69ab63@collabora.com> <382f4435-2088-08ce-20e9-bc1a15050861@collabora.com> <44eddc7d-fd68-1595-7e4f-e196abe37311@collabora.com> <1afedab8-5929-61e5-b0da-9c70dc01c254@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 On 7/25/23 11:05 PM, Michał Mirosław wrote: > On Tue, 25 Jul 2023 at 11:11, Muhammad Usama Anjum > wrote: >> >> ---- >> Michal please post your thoughts before I post this as v26. >> ---- > [...] > > Looks ok - minor things below. > > 1. I'd change the _WPASYNC things to something better, if this can > also work with "normal" UFFD WP. Yeah, but we don't have any use case where UFFD WP is required. It can be easily added later when user case arrives. Also UFFD WP sends messages to userspace. User can easily do the bookkeeping in userspace as performance isn't a concern there. > > 2. For the address tagging part I'd prefer someone who knows how this > is used take a look. We're ignoring the tag (but clear it on return in > ->start) - so it doesn't matter for the ioctl() itself. I've added Kirill if he can give his thoughts about tagged memory. Right now we are removing the tags from all 3 pointers (start, end, vec) before using the pointers on kernel side. But we are overwriting and writing the walk ending address in start which user can read/use. I think we shouldn't over-write the start (and its tag) and instead return the ending walk address in new variable, walk_end. > > 3. BTW, One of the uses is the GetWriteWatch and I wonder how it > behaves on HugeTLB (MEM_LARGE_PAGES allocation)? Shouldn't it return a > list of huge pages and write *lpdwGranularity = HPAGE_SIZE? Wine/Proton doesn't used hugetlb by default. Hugetlb isn't enabled by default on Debian as well. For GetWriteWatch() we don't care about the hugetlb at all. We have added hugetlb's implementation to complete the feature and leave out something. Also GetWriteWatch() implementation wouldn't require THP support as well because you start to get 2MB of memory dirty even when only 4kB of memory shouldn't have been dirty. > > 4. The docs and commit messages need some rewording due to the changes > in the API. Yeah, I've updated the doc. I'll update the commit message as well. > > Other than that: > > Reviewed-by: Michał Mirosław -- BR, Muhammad Usama Anjum