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 X-Spam-Level: X-Spam-Status: No, score=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B1ACC4743D for ; Fri, 4 Jun 2021 21:00:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8B5EB613F4 for ; Fri, 4 Jun 2021 21:00:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B5EB613F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B4E546B0036; Fri, 4 Jun 2021 17:00:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AFD4F6B006C; Fri, 4 Jun 2021 17:00:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9779D6B006E; Fri, 4 Jun 2021 17:00:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0168.hostedemail.com [216.40.44.168]) by kanga.kvack.org (Postfix) with ESMTP id 623EE6B0036 for ; Fri, 4 Jun 2021 17:00:27 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DE75CB790 for ; Fri, 4 Jun 2021 21:00:26 +0000 (UTC) X-FDA: 78217259652.07.16D278A Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by imf01.hostedemail.com (Postfix) with ESMTP id 40C40500170A for ; Fri, 4 Jun 2021 21:00:24 +0000 (UTC) Received: by mail-pg1-f175.google.com with SMTP id 6so8816028pgk.5 for ; Fri, 04 Jun 2021 14:00:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Yx5ApbvAd7I5vFlQya+NsIeBKCKhNuXynKSzCVZw0Ng=; b=Ow6ak2yGHQosnoooJza5wlgegECt4Cytj+J3vUYKsPH7UyRFrhBB5UiGpepGpWKuN2 ckYOGfEuhw3ldWTjeEf++N6fkGSnMavpFPYoD6tsRfVZMdhDVwcMD9W+IYSHsFXlvNBj ww0QZ67eCJcXAhYwOcq+Lhup+BvRo2XvBF8FFHihg+r5/cTwsy6lPpXMBGnypw3szHhB IsGWJgN7kLfKzRRxTTqHUWhzPRGMYLIK4DYfXzr5HfF1jNCN+9DH0kpPYEQ+hsgkaEP0 HTyiv8WSILkiLc8Z34LC0euHg17qNvK+xUVZROLbx51NrGO3wVNMP/hoYirT4fbks+hm uKrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Yx5ApbvAd7I5vFlQya+NsIeBKCKhNuXynKSzCVZw0Ng=; b=i49HH+GyRstUHI/7znhBe8BazviRVfTXMC+JHJYChmfWNeyCBvAPQykoOhz6NUu67U BXlLeLEy4nqp6/UzSjfHCoiYhr+pklUuIwwkPMtTwlK8o8P29onC05iuH0SXs31T4xoX pF8iNCacrvD8flfVdxpoFkjIKDfAkhqHHjGOWbKsel/wJIRGjxGpVAB0UWCkCZBRjKqG +SYUgtMsd1wmuGXpdOf04MQJK8000YTl5sMBcSZGB3rswg1IarDiNrjnwN8Hl9An6/J/ ni0dQqqrg/0zeXT5Wg4FlCt+bgPDmUC1clFpLxXCWPvOIdclT/GU1RXhku/U/OQu5Xi9 ta/Q== X-Gm-Message-State: AOAM531ms+minmVcyQCnH4Y0JKTSwZ7CzQQxV1+MrrE5NqKhI9OObyCb yHJ7o4FLRg6Ft4xZ4fzH2kNM1U79T5MnFnyptEC2z6Nj/Ao= X-Google-Smtp-Source: ABdhPJylUKcnXTj3lAkAqJE0MKqikSfgEtIjp3eKSUiZCzkEurekTijCEnNgLvvJPnirXevjkw8VDURtcyeiAKqwdBI= X-Received: by 2002:a5e:a806:: with SMTP id c6mr4901693ioa.180.1622836254901; Fri, 04 Jun 2021 12:50:54 -0700 (PDT) MIME-Version: 1.0 References: <20210603183216.939169-1-axelrasmussen@google.com> In-Reply-To: From: Axel Rasmussen Date: Fri, 4 Jun 2021 12:50:17 -0700 Message-ID: Subject: Re: [PATCH] ioctl_userfaultfd.2, userfaultfd.2: add minor fault mode To: Peter Xu Cc: Andrea Arcangeli , Andrew Morton , Hugh Dickins , Mike Kravetz , LKML , linux-man@vger.kernel.org, Linux MM Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: awm8tpp7wtretd4nuiyj4ehetfbjn65j X-Rspamd-Queue-Id: 40C40500170A X-Rspamd-Server: rspam02 Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=Ow6ak2yG; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf01.hostedemail.com: domain of axelrasmussen@google.com designates 209.85.215.175 as permitted sender) smtp.mailfrom=axelrasmussen@google.com X-HE-Tag: 1622840424-302782 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: Thanks for the review, Peter! I'll send a v2 shortly to address the suggestions. On Thu, Jun 3, 2021 at 12:29 PM Peter Xu wrote: > > On Thu, Jun 03, 2021 at 11:32:16AM -0700, Axel Rasmussen wrote: > > [...] > > Not a native speaker, feel free to take anything I said with a grain of salt.. > > > @@ -278,14 +287,8 @@ by the current kernel version. > > (Since Linux 4.3.) > > Register a memory address range with the userfaultfd object. > > The pages in the range must be "compatible". > > -.PP > > -Up to Linux kernel 4.11, > > -only private anonymous ranges are compatible for registering with > > -.BR UFFDIO_REGISTER . > > -.PP > > -Since Linux 4.11, > > -hugetlbfs and shared memory ranges are also compatible with > > -.BR UFFDIO_REGISTER . > > +What constitutes "compatible" depends on the mode(s) being used, as described > > +below. > > Would below be slightly better? > > Please refer to the list of register modes below for the compatible memory > backends for each mode. I have no significant preference between the two, so happy to reword this one. > > [...] > > > @@ -735,6 +745,109 @@ or not registered with userfaultfd write-protect mode. > > .TP > > .B EFAULT > > Encountered a generic fault during processing. > > +.\" > > +.SS UFFDIO_CONTINUE > > +(Since Linux 5.13.) > > +Used for resolving minor faults specifically. > > +Take the existing page(s) in the range registered with > > +.B UFFDIO_REGISTER_MODE_MINOR > > +and install page table entries for them. > > "Take the existing page" reads a bit weird to me. How about something like: > "Resolving minor-mode trapped page faults by installing page table entries with > pages in the page cache"? Agreed, "take" is a bit awkward. I'll reword to something close to your suggestion. > > [...] > > > +.TP > > +.B EINVAL > > +An invalid bit was specified in the > > +.IR mode > > +field. > > +.TP > > +.B EEXIST > > +One or more pages were already mapped in the given range. > > I'd think this sentence is good enough; slightly prefer dropping the latter one > "In other words..." below, as "mapped" should mean the same to me (and the > wording "fully mapped" is a bit confusing too..). Fair enough, I had it that way at first but was worried the first sentence alone was too vague. I'm probably overthinking it. ;) I'll just drop the second sentence. > > > +In other words, not only did pages exist in the page cache, but page table > > +entries already existed for those pages and they were fully mapped. > > [...] > > Thanks, > > -- > Peter Xu >