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=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 35185C47096 for ; Thu, 3 Jun 2021 19:29:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AB769613E4 for ; Thu, 3 Jun 2021 19:29:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB769613E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3D7D76B0036; Thu, 3 Jun 2021 15:29:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3AEA76B006C; Thu, 3 Jun 2021 15:29:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 276336B006E; Thu, 3 Jun 2021 15:29:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0189.hostedemail.com [216.40.44.189]) by kanga.kvack.org (Postfix) with ESMTP id EB8986B0036 for ; Thu, 3 Jun 2021 15:29:13 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 8BD7C82499A8 for ; Thu, 3 Jun 2021 19:29:13 +0000 (UTC) X-FDA: 78213400986.21.5F2A87B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf20.hostedemail.com (Postfix) with ESMTP id BE0C255F for ; Thu, 3 Jun 2021 19:28:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622748543; 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=x/gj4fleOURiB06FpwTyo6dG+WTMtW3dGT0Tg+4lxHw=; b=gcNHBU/LXediJnuDbutFeW21nTR9y97P1hYKRzrRn/9UKkE6vfCef4hgYYMxsB4MfKlEED kBVwIftIXXh/xBwPXZ+9JbBgNt7ogkV+0yzrKWsjxPKvt4Cw5aUmhjcmns+JxEHVOdGIvj 6lGNbpnQzhzz7baA1dRyKb5Tpru3NvU= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-441-6ZJoqiqkOquJmYUaeklTyg-1; Thu, 03 Jun 2021 15:29:00 -0400 X-MC-Unique: 6ZJoqiqkOquJmYUaeklTyg-1 Received: by mail-qv1-f70.google.com with SMTP id h10-20020a0cab0a0000b029020282c64ecfso5158510qvb.19 for ; Thu, 03 Jun 2021 12:29:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=x/gj4fleOURiB06FpwTyo6dG+WTMtW3dGT0Tg+4lxHw=; b=egruACTXYdmR/GN9NDAuOH5LQ6LvzMHnDSpA6xpH9mBOuivcAfUaZrikL/neE6/DSg 2apMJwyEmxLAeOtOelVXNvPSW3QxJlHIHAI+s2w/xbfQ7/o//aw65FkG6DJtImD8VKiB E7K/sGhD3tQOGkdxUmXg69ZKQizWeicU9YqI4p7H4fxo8FmAPQi0cua64YoYlLohl69t WOjgMTq8cyxEoVSYPgg+vbNeUyKccIk0/DqgUPDAlNtvyV16heWha8Ob1fvzyKCCXoBb CfFvu8r7G03Hugmh7Cu7XuB8ksoPAqnR6QCX/MsBi9fvFAKaviG3sc0TJeJf57o7nkie zQBw== X-Gm-Message-State: AOAM5325KX0r+rmeMWLZnAv3fJSHA71sqqvhvqjLhwMspAtUzUb18tM3 rydv+ux65vE+U0cPfhVMD/xO88o1KpAH+FcB8Ppp3EdtG1euitJSIbHIK8Jf/Uk1uFAcoErA0+4 D+JO1DWmKiXo= X-Received: by 2002:a05:620a:448c:: with SMTP id x12mr839812qkp.52.1622748539794; Thu, 03 Jun 2021 12:28:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLUjjqgS6V5SzDAJv1efAuEwlyGvFi855kq2nrnnQnLUOJ5tlxqeQcaZvh3Y3jB/o7M29QhQ== X-Received: by 2002:a05:620a:448c:: with SMTP id x12mr839796qkp.52.1622748539589; Thu, 03 Jun 2021 12:28:59 -0700 (PDT) Received: from t490s (bras-base-toroon474qw-grc-61-184-147-118-108.dsl.bell.ca. [184.147.118.108]) by smtp.gmail.com with ESMTPSA id p12sm2476522qkm.23.2021.06.03.12.28.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 12:28:59 -0700 (PDT) Date: Thu, 3 Jun 2021 15:28:57 -0400 From: Peter Xu To: Axel Rasmussen Cc: Andrea Arcangeli , Andrew Morton , Hugh Dickins , Mike Kravetz , linux-kernel@vger.kernel.org, linux-man@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] ioctl_userfaultfd.2, userfaultfd.2: add minor fault mode Message-ID: References: <20210603183216.939169-1-axelrasmussen@google.com> MIME-Version: 1.0 In-Reply-To: <20210603183216.939169-1-axelrasmussen@google.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Queue-Id: BE0C255F Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="gcNHBU/L"; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf20.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=peterx@redhat.com X-Rspamd-Server: rspam03 X-Stat-Signature: 7knytj6aqbgx6dqh4yzyoxfs8tjxiy8h X-HE-Tag: 1622748525-948299 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, 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. [...] > @@ -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"? [...] > +.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..). > +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