Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp773677pxj; Thu, 3 Jun 2021 20:18:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8qL4xrqfkQVVXToqFNQf/gjXQ5IAD5Jywprjz62e+bhEvToCJDONq4Sg2pOsgwSjdIXyL X-Received: by 2002:a17:906:f6cb:: with SMTP id jo11mr2153595ejb.439.1622776683353; Thu, 03 Jun 2021 20:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622776683; cv=none; d=google.com; s=arc-20160816; b=DQlEtnBVPCaPB+/Iu0g8tZtEQvNBTS1huKhCua+aJoT7RlpZIePBFUePKDWVMDfFXa xJ0JTbxVicUXxFrYsQVkmuxuVYyrunwk/Xzl6ayVI3yheH10MI3oeW4M8Fv+DN5rX1Df RR02PiJGllNQ8AqaxEckFmZAhltmw+xE0dlIn7CVQI2v+o+wSJe2brBuFPjF2GRNrRVB PjepfXOS8uC7hiaE/l2zdxjbYcuZlUURRoUHRSRhAUo81Rst8D/z1jL+DnuYbYc76B5/ wu5nKi5VMr7qQU6g5wbmCQ5NW2uVoI6e/oyuhb1ke/x+Nrp3WHMRvK2Qf2wxb/YFVyYl ZDSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=FLTijI0qtWn0Gr6xLjK6ZMfCKnwIuGsHja/fIL/u8Nk=; b=tvVRoNFb5/Yur8CIQoPGwBvaGpbDNJ3hpYQm5GR461O6RzB+aNZJ+H+ODuLkioD5L3 1UFZTaLkZhuIiS1sN1aO7D4f1j+z050Qji0IRh9HeszTZNm9w3j/xSPyleRVMa9jQnhl nGaYy274yyH/R6E4MtXilBdBjej4hr7EBM0MxG4cYZLw9CkesxBP6KD3hwPmJ1iQta5X JJMkuPp6NmVky9xgv6yHOEgPVUriv7krO5g+7SN+a6VM8gNJ/vWdIXJjHfAGPAcJKHJw l11+A58msZpZ5Qmlk125theMvsHdYCBxtcVvsOVVpH422AQ0aFcGsLspBFC1GFISrQsN swiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=GYyyLvoD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si3501461ejn.195.2021.06.03.20.17.39; Thu, 03 Jun 2021 20:18:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=GYyyLvoD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229778AbhFDDRd (ORCPT + 99 others); Thu, 3 Jun 2021 23:17:33 -0400 Received: from mail-qk1-f170.google.com ([209.85.222.170]:34581 "EHLO mail-qk1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229704AbhFDDRd (ORCPT ); Thu, 3 Jun 2021 23:17:33 -0400 Received: by mail-qk1-f170.google.com with SMTP id k11so6443644qkk.1 for ; Thu, 03 Jun 2021 20:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=FLTijI0qtWn0Gr6xLjK6ZMfCKnwIuGsHja/fIL/u8Nk=; b=GYyyLvoDRE7Yb4Jcrj7W2St5vOQJhmelZYfcmVWFRN5a01CXXukjthcvsdvUonxBCJ 1UD87DLXnmpCFBhEEg0dZmwzPCw1kGspz1gU6rChfHshaSAdUqJngD2dWsl9s7Y1ssHi iDNHZap+6opPvskaTmXVOoD/sfvi3WdhXYYtGHR5z7UYVMQwR3XL6+0E4qx37mh+ciAd FoEa76z5ZI6aDZfCQFqjJDUm0aefNAr8qElZuvkzKFpLR5poLjvcL2b4lsvT96Bn9nzU GeD29FkgA3NvCkzLaDGPVjCKPxyaxhPKGiDzPc/kGyBCBRyMWLOGNi2GsmgBbitshv8V xGig== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=FLTijI0qtWn0Gr6xLjK6ZMfCKnwIuGsHja/fIL/u8Nk=; b=s4D25odicrMCrefIVFLO6PQnl3HI1SyNxqdgszQAW7vp+DdefuGbLOr8uNxtTliYkO 9SoIZIlCstpO/Zz6KW8Me77jG6I6bscMaLp2m9NsOMKBzW/UzCOMcRLngcPrC5YzS/Jg oeG9hd5EVWDLBrEWYKCG6WqeDox3i9x/fJkLEkTkLVBkjpc7NdBEryCUGwHlJgkYALaC Lc6I9f5XAhsO6kgba4ztU2gfa2bFU6eCFyC1zT43k5sT2DxNS4UjghXOaa5Hb1rKczIX gcY57USUPbOTVCGWekWbuYzUq4jrc78TwZ2L2O+p16eKhaK9Rth7L1dI3DRz7YuY3Jka ogTg== X-Gm-Message-State: AOAM530DOXttF1aUAkYt4MENkQFnPak6ywIa91godtU0HDLUjcxPMHdq gWWIvPCtnJTsG/ddteckCjhIOg== X-Received: by 2002:a05:620a:e09:: with SMTP id y9mr2356795qkm.359.1622776474736; Thu, 03 Jun 2021 20:14:34 -0700 (PDT) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id v25sm2942592qtf.68.2021.06.03.20.14.32 (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Thu, 03 Jun 2021 20:14:34 -0700 (PDT) Date: Thu, 3 Jun 2021 20:14:31 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Alistair Popple cc: Peter Xu , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Axel Rasmussen , "Kirill A . Shutemov" , Hugh Dickins , Andrew Morton , Miaohe Lin , Mike Rapoport , Jerome Glisse , Andrea Arcangeli , Nadav Amit , Mike Kravetz , Jason Gunthorpe , Matthew Wilcox Subject: Re: [PATCH v3 04/27] mm/userfaultfd: Introduce special pte for unmapped file-backed mem In-Reply-To: <1780227.rxkhHXaqZV@nvdebian> Message-ID: References: <20210527201927.29586-1-peterx@redhat.com> <4688876.HeLTNyGTSD@nvdebian> <1780227.rxkhHXaqZV@nvdebian> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 4 Jun 2021, Alistair Popple wrote: > > The detail which is perhaps less important is whether to implement this using > a new swap entry type or arch-specific swap bit. The argument for using a swap > type is it will work across architectures due to the use of pte_to_swp_entry() > and swp_entry_to_pte() to convert to and from the arch-dependent and > independent representations. > > The argument against seems to have been that it is wasting a swap type. > However if I'm understanding correctly that's not true for all architectures, > and needing to reserve a bit is more wasteful than using a swap type. I'm on the outside, not paying much attention here, but thought Peter would have cleared this up already. My understanding is that it does *not* use an additional arch-dependent bit, but puts the _PAGE_UFFD_WP bit (already set aside by any architecture implementing UFFD WP) to an additional use. That's why I called this design (from Andrea) more elegant than mine (swap type business). If I've got that wrong, and yet another arch-dependent bit is needed, then I very much agree with you: finding arch-dependent pte bits is a much tougher job than another play with swap type. (And "more elegant" might not be "easier to understand": you decide.) Hugh