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 EA89BC6FD1D for ; Tue, 21 Mar 2023 12:43:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230285AbjCUMn3 (ORCPT ); Tue, 21 Mar 2023 08:43:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbjCUMnZ (ORCPT ); Tue, 21 Mar 2023 08:43:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BF28F945; Tue, 21 Mar 2023 05:42:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6DF3DB8166B; Tue, 21 Mar 2023 12:42:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52A45C433EF; Tue, 21 Mar 2023 12:42:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679402534; bh=DJXLZL3qhKzSZg0yYA16xG9Xycg6KPkRYGZFn8WH8io=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VHb1kWo4K2q7A8RJ+a3MaCsVbB0HMoAhyUpsj2mqPMF3eqeBeLI/+UgU6QIQjNF7/ Xeqmzcy6PPqUka8X1duBZ3hfNMGq2ndukzPKDawLPp8N/KJNIoviON91Wn+2rffEI2 VV3GXliTpV5VcqAryDSFyY04QYNVuepAnLBjnh2CvhmLZFltie1Pv2SVTPOCiwJg6m qgCb91dg54pggiW1iSzoMdCYna6cATElLFGz1yAjC86VAvyISgHOwiLCal4Vg/ofB3 YcSg4p5MWyi8ntAVr/EgkfBg3J/K7/83iVamyyz5Mx1meJvFGgT2LAxex2b84XDUCA GHNCtAZuWHP4Q== Date: Tue, 21 Mar 2023 14:41:53 +0200 From: Mike Rapoport To: Andrei Vagin Cc: Andrew Morton , Muhammad Usama Anjum , Peter Xu , David Hildenbrand , =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Danylo Mocherniuk , Paul Gofman , Cyrill Gorcunov , 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 v11 0/7] Implement IOCTL to get and optionally clear info about PTEs Message-ID: References: <20230309135718.1490461-1-usama.anjum@collabora.com> <20230309115818.170dd5ef2cde7b58b9354ecd@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 20, 2023 at 11:30:00AM -0700, Andrei Vagin wrote: > On Thu, Mar 9, 2023 at 11:58 AM 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 and > > > swapped is required for the CRIU project [5][6]. The addition of the > > > required mask, any mask, excluded mask and return masks are also required > > > 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 improvements: > > * 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. There is still a caveat in using userfaultfd for tracking dirty pages in CRIU because we still don't support C/R of processes that use uffd. > 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! -- Sincerely yours, Mike.