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=-14.8 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1, USER_IN_DEF_DKIM_WL autolearn=no 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 D6066C47082 for ; Fri, 4 Jun 2021 03:14:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 740806140A for ; Fri, 4 Jun 2021 03:14:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 740806140A 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 C04D96B0036; Thu, 3 Jun 2021 23:14:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BB5026B006C; Thu, 3 Jun 2021 23:14:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A2E0E6B006E; Thu, 3 Jun 2021 23:14:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id 74E016B0036 for ; Thu, 3 Jun 2021 23:14:44 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0C6DE180AD804 for ; Fri, 4 Jun 2021 03:14:44 +0000 (UTC) X-FDA: 78214574088.19.E8FDFF3 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) by imf09.hostedemail.com (Postfix) with ESMTP id 917F160002C4 for ; Fri, 4 Jun 2021 03:14:28 +0000 (UTC) Received: by mail-qk1-f180.google.com with SMTP id i68so4510505qke.3 for ; Thu, 03 Jun 2021 20:14:36 -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=XWhTDEbQIVzzHqxZSHFPZ2H+uT8fY1PVScOu2wIuYxPK5nBO4KyYuxYPLNMrn+uyi3 XAM3OFe7RtvRjjqOXywlyi7jvmn0gTb3J1/WeRAyv5QnPLHFljVb/nJe0tyxQBZgy1LJ l5J5twDFMgSda8HWIoinakaj3v9QhhzdutS7ZqmQ5Er1ZlrdiDIxScDFkQfkSfiB7IJb Qd2O0ckLfddo7Ho+NNL1t/TKU8wqUfQr1WfdrnCR85y4dJYWAdPw0xZxFTcGp6X7vVCZ GhFl/ae2xGqpDbsiG+XsoC/vHebIISm/FS4XcfDOv0XhFgeuwXC/t/0i79iN5Amjisgd f43w== X-Gm-Message-State: AOAM532JV5k/NeBJjEf7XWvOMBiz2kqQmOvJZV63SsnvEFH7aDiTVk4Y xuw1vSs8zb368cbz1Srta2hBmQ== X-Google-Smtp-Source: ABdhPJwtG7KBNA+9nOH+6w+vKhjcwj4i2cwWs0sxMbftMbUoDFHoU5MkEf0SX53FKoOB6xmDupdl8g== 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 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=GYyyLvoD; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf09.hostedemail.com: domain of hughd@google.com designates 209.85.222.180 as permitted sender) smtp.mailfrom=hughd@google.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 917F160002C4 X-Stat-Signature: j9mjux7xi8d4jmfxwks8onw6kadtwrfy X-HE-Tag: 1622776468-821308 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 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