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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72280C64ED8 for ; Mon, 27 Feb 2023 21:18:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BE9A66B0074; Mon, 27 Feb 2023 16:18:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B99416B0075; Mon, 27 Feb 2023 16:18:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A13BF6B0078; Mon, 27 Feb 2023 16:18:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 8E9B76B0074 for ; Mon, 27 Feb 2023 16:18:33 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 5D782A9B53 for ; Mon, 27 Feb 2023 21:18:33 +0000 (UTC) X-FDA: 80514335706.24.2492ED4 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 32210C001D for ; Mon, 27 Feb 2023 21:18:31 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ISsZgOv7; spf=pass (imf28.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677532711; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=GHSRojRxVE6zC17aax0uBR9kKGNj5ie6daOM2pf7ZMM=; b=dfKFHYV3Atf357SW9oQUhV5U6GiUTKQ3pGJ96Q8mSjxfomYNmjGXri177Ggf9Z8ahx2PN9 YOuYCkGTF3HoQzHWrVzXEsRoKp7L/E43CQKNhnVWuaSrnOi5F7wkgnc5Y3f7yii95jLE/W gGDs4uG/QJP2suhBVlyGJJQMno1Kndw= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ISsZgOv7; spf=pass (imf28.hostedemail.com: domain of peterx@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677532711; a=rsa-sha256; cv=none; b=WIlBOr71mIR4HTZ3cIeqbHNz2pOjBhypSUXIT/Cd3O/KsnCWyZyC8y3rUjb8Khz18Pfqdm fflGkzVFVR2c6B9QTRdyVZoWYdqVL6aY+JkDi8tVBz++o9s1EqeKvDqLn4oCpSaEIRol8v TjqIjm/oWl4cKizBfJduHN51NxCX118= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677532710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GHSRojRxVE6zC17aax0uBR9kKGNj5ie6daOM2pf7ZMM=; b=ISsZgOv7FRIXML+kiVaUzKGXeMONSCBGelARTDJ8rsQRR5DEiQdm1Id0DujP0OC+5zT3od 4226WAoA4n1RGY4LnB+8EfHRk/fZiZsRxaOg40/gWsDTbywVLNmNgGeRDNxcMwbPSXAPBL nxT1BJ52D26GlHDEYBhOcpRANiYDu4U= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-30-dsipKbZwMoawsR1QvPx6kw-1; Mon, 27 Feb 2023 16:18:29 -0500 X-MC-Unique: dsipKbZwMoawsR1QvPx6kw-1 Received: by mail-io1-f72.google.com with SMTP id z5-20020a6b5c05000000b007447572f3f8so4861891ioh.3 for ; Mon, 27 Feb 2023 13:18:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GHSRojRxVE6zC17aax0uBR9kKGNj5ie6daOM2pf7ZMM=; b=uwIfj+rPxhHwUqM+kXiTXZM2EK4lQvbhfiaF+GBsOMCKOQQvK4TJ0CCnyJkj3myTVQ HB08mMlxz0DNFyu6vNlpRd2vr/lcKJ7A2+AxcJSku0zHqU2q6QgpczytWQisRpFM46bW UIuq6KYQpPS2BNyKb+8yjRa1X6lvpJ6GB9Rn02CEzSrWM6drtjd4h4s2PjXuc0kFHK7o 6QPksjqhXkGV+SLRI15BVvFAb8xTj/tfQself/cp/zEXT49n9Ro2l1Iva//kKSXswEfi UKfrpgJJJx8wAIezXfPBmlIQfgHvP6Wjp9cc9OF4HJq93rahSbr8JbmZqo0Ksd42pTB7 2QDg== X-Gm-Message-State: AO0yUKUuKqWOa7kaW7asIO+DAikl5dXLOHX6KPgN7yGuoKrTGrboKRUp oPuwWgF41YkTYEL3jwy/IbtY/xgnuBR7wQ/N4ckLMTfJVPfjS1J8FZ/SS7oyztz3B9Sb+lSFYPy fyVBFRXPp67g= X-Received: by 2002:a05:6e02:1a0c:b0:316:ef1e:5e1f with SMTP id s12-20020a056e021a0c00b00316ef1e5e1fmr688420ild.1.1677532708519; Mon, 27 Feb 2023 13:18:28 -0800 (PST) X-Google-Smtp-Source: AK7set/84o635Z+vKrcRkh21erP0lfLznxR99YMjOmgvY/p96dgESRiSUUmj+XE/9aVJEr7p0zVQmg== X-Received: by 2002:a05:6e02:1a0c:b0:316:ef1e:5e1f with SMTP id s12-20020a056e021a0c00b00316ef1e5e1fmr688396ild.1.1677532708247; Mon, 27 Feb 2023 13:18:28 -0800 (PST) Received: from x1n (bras-base-aurron9127w-grc-56-70-30-145-63.dsl.bell.ca. [70.30.145.63]) by smtp.gmail.com with ESMTPSA id i24-20020a02b698000000b003a484df1652sm2296207jam.55.2023.02.27.13.18.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 13:18:27 -0800 (PST) Date: Mon, 27 Feb 2023 16:18:25 -0500 From: Peter Xu To: Nadav Amit Cc: Muhammad Usama Anjum , Mike Rapoport , =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Andrew Morton , Alexander Viro , Cyrill Gorcunov , Paul Gofman , Danylo Mocherniuk , 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 , kernel list , linux-fsdevel , linux-mm , linux-kselftest , Greg KH , "kernel@collabora.com" , David Hildenbrand , Andrei Vagin Subject: Re: [PATCH v10 3/6] fs/proc/task_mmu: Implement IOCTL to get and/or the clear info about PTEs Message-ID: References: <20230202112915.867409-1-usama.anjum@collabora.com> <20230202112915.867409-4-usama.anjum@collabora.com> <2fe790e5-89e0-d660-79cb-15160dffd907@collabora.com> <751CCD6C-BFD1-42BD-A651-AE8E9568568C@vmware.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 32210C001D X-Rspam-User: X-Stat-Signature: sru1j3wr14c4dtyjtpsp9g18zr4amh8q X-H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nDbuZ8EL8+MZOlaK1LoYNtgj35ezaNlVZ5HEkR+2tlHDvZqCJLSQ4uX60FbYA/StBDvUd2gPNJ5ljCwM26zGQTnwPmCXp3AdmW6dQpwA6uP74Dz6KI9Er5s8KQI+iAoXJN/6dqo7xz2JsUB1FWuqfINQm0JQ79cOcSb9kLIdaOVp4ESgcu5PGLVBdSTMkfdrAxG8YWyIPxKQFV/VRs4D7dWbnme2zE9V9FaZtJ8f1li51Kxr+UAfcyk/dIMcaXCZ70s30uObs/PWwHP6lncCyz47/GFko4Scn4MnrWi7rmEL9QANy6uJt3tArXPcVYnGe/uRo2Y6pwMhuC82lE80yNBSWck9S2Fq0lNqUKJ732adpYESTPZyU02h3c1ZEyDm6R80EZFBDEtftlmov5a8Qw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Feb 23, 2023 at 05:11:11PM +0000, Nadav Amit wrote: > From my experience with UFFD, proper ordering of events is crucial, although it > is not always done well. Therefore, we should aim for improvement, not > regression. I believe that utilizing the pagemap-based mechanism for WP'ing > might be a step in the wrong direction. I think that it would have been better > to emit a 'UFFD_FEATURE_WP_ASYNC' WP-log (and ordered) with UFFD #PF and > events. The 'UFFD_FEATURE_WP_ASYNC'-log may not need to wake waiters on the > file descriptor unless the log is full. Yes this is an interesting question to think about.. Keeping the data in the pgtable has one good thing that it doesn't need any complexity on maintaining the log, and no possibility of "log full". If there's possible "log full" then the next question is whether we should let the worker wait the monitor if the monitor is not fast enough to collect those data. It adds some slight dependency on the two threads, I think it can make the tracking harder or impossible in latency sensitive workloads. The other thing is we can also make the log "never gonna full" by making it a bitmap covering any registered ranges, but I don't either know whether it'll be worth it for the effort. Thanks, -- Peter Xu