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 E080CC6FD1D for ; Mon, 20 Mar 2023 18:38:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230436AbjCTSir (ORCPT ); Mon, 20 Mar 2023 14:38:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230127AbjCTSiX (ORCPT ); Mon, 20 Mar 2023 14:38:23 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBF285B8A; Mon, 20 Mar 2023 11:30:14 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id fm20-20020a05600c0c1400b003ead37e6588so9754409wmb.5; Mon, 20 Mar 2023 11:30:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679337012; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DaE8Cq+3HD566AAS3cNbL9kU0VpoY/kWeisZ30TMTT8=; b=oA4w6+dDqA8sdlaThxyc3zs7OVUqGgIdMPfb9hG5XtPf9mEQy3/Wr7hm0EwAzKZaIe vuOEuEz0WcVfDc00RZMe4OittNI9xbDVeefvoHWrkwHdE8H1IsoKsA8mi8/dq6axQC7u FWNEuGqvHzOPhL5WviP7vZvv8DnMrRSxul589MhW/wLoEVNt5hqhMKHt4FWNAnv7TV9l QxP/meyuVlI3A9mZ4O4T4nr2SHGTwch1+9hs4D86dh8onYJfn3dpqFX+5B4n/PlqsOAW wzRaFP6iKCLKWaVmcUwGbGVLRYwN6+fKF9/jET2Ox/Dz3f//3dVz8WOW/kPj4xi79ipr gMug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679337012; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DaE8Cq+3HD566AAS3cNbL9kU0VpoY/kWeisZ30TMTT8=; b=wmYyTPll8EiYsC+3LUxUWXpbVxkVaL/ApsQQR13ok4G/fxE8Q4CT7QQPwBC3jnHReK I8dsiTL5hdxoFar/BkUij6wbCY7HOhb5Dr/SjD1x9KpFfqHG84zJ654Ltfjbk0ZyqfH9 0eyiDP+N/H377NFcLf7hwr/+wXqHhqgnyFTlb3vcmuywukeGrBRkMQt6IgocxDOR+IyC Oh2Btiqn+/VLdw5XuOwnyommmFrALGgx6pFOAoV3hktg93cClRa8hJOgWkS7wue6keUV xMcA0RaYf6xSRLA9RVxrAwCfWXpbVsJhkirFCw2WRTX9Qu//9Q0J/yaQFqSXQoj5Gwux yElw== X-Gm-Message-State: AO0yUKVAWeD/rly567DHUbFNs6TVOPz1WdLwWDHz1V/iBkdKgVvPNdbp 7+qoqsMhLU3BLGNY/Tb3/WXAQWvmYx+IW5OKSG8= X-Google-Smtp-Source: AK7set9Bgwg8JCn7J8ExtyKaKDVaOjrbw73S5bkBKD7eM6hgwNYtQl/5KNokOmDyTHs3W6NUlNefJfPgnBqv6sOyhQU= X-Received: by 2002:a7b:c7c6:0:b0:3ed:ce50:435a with SMTP id z6-20020a7bc7c6000000b003edce50435amr394181wmk.10.1679337011724; Mon, 20 Mar 2023 11:30:11 -0700 (PDT) MIME-Version: 1.0 References: <20230309135718.1490461-1-usama.anjum@collabora.com> <20230309115818.170dd5ef2cde7b58b9354ecd@linux-foundation.org> In-Reply-To: <20230309115818.170dd5ef2cde7b58b9354ecd@linux-foundation.org> From: Andrei Vagin Date: Mon, 20 Mar 2023 11:30:00 -0700 Message-ID: Subject: Re: [PATCH v11 0/7] Implement IOCTL to get and optionally clear info about PTEs To: Andrew Morton Cc: Muhammad Usama Anjum , Peter Xu , David Hildenbrand , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 9, 2023 at 11:58=E2=80=AFAM Andrew Morton wrote: > > On Thu, 9 Mar 2023 18:57:11 +0500 Muhammad Usama Anjum wrote: > > > The information related to pages if the page is file mapped, present an= d > > swapped is required for the CRIU project [5][6]. The addition of the > > required mask, any mask, excluded mask and return masks are also requir= ed > > for the CRIU project [5]. > > It's a ton of new code and what I'm not seeing in here (might have > missed it?) is a clear statement of the value of this feature to our > users. > > I see hints that CRIU would like it, but no description of how valuable > this is to CRIU's users. Hi Andrew, The current interface works for CRIU, and I can't say we have anything critical with it right now. On the other hand, the new interface has a number of significant improvemen= ts: * it is more granular and allows us to track changed pages more effectively. The current interface can clear dirty bits for the entire process only. In addition, reading info about pages is a separate operation. It means we must freeze the process to read information about all its pages, reset dirty bits, only then we can start dumping pages. The information about pages becomes more and more outdated, while we are processing pages. The new interface solves both these downsides. First, it allows us to read pte bits and clear the soft-dirty bit atomically. It means that CRIU will not need to freeze processes to pre-dump their memory. Second, it clears soft-dirty bits for a specified region of memory. It means CRIU will have actual info about pages to the moment of dumping them. * The new interface has to be much faster because basic page filtering is happening in the kernel. With the old interface, we have to read pagemap for each page. Thanks, Andrei > > So please spend some time preparing this info. > > Also, are any other applications of this feature anticipated? If so, > what are they? > > IOW, please sell this stuff to us!