Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3136322pxb; Tue, 19 Jan 2021 15:00:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzwg7vKyylm/q6/JtYCbDizyTLI/h9o0wVIWFpypDz5zEM/ssL3l1Te9DETWFyj0em6l/wK X-Received: by 2002:a05:6402:50a:: with SMTP id m10mr5163508edv.324.1611097232570; Tue, 19 Jan 2021 15:00:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611097232; cv=none; d=google.com; s=arc-20160816; b=uPRTZBb438qMUQ5kw534Zp8lJ7ywiRcONUlOI7+KKAIO8qjbZzgsjglkVFpsDQs9Mk lckgx/1rsV8ZUvAVz01UVP0at1RbqvLK097VxpxqyN6t50ar1VvLK+EIlMQ7ERxKi/vk 465Yz1wbHh1f2FcaR/dYFXGOCAjnemS3X8ungpJZ63wM/OM+9BFViys8x0kskteSQzTi 0Fu+FE/gIRVJRC0+77JG6wZYRFJQKS3LdVqQALIv8krP4f2MQCD9tQ2qlBnQdpfmSuKJ KBL1cnsRPHJHfR+ZbYqPCU1OTCZkIxl/Jkpx0swfTtJ9DP5wuOGuDc7XfBLIl494/Ifp BQvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=S5oU2Ie/VxNNle5UC5ptcg2zY6dliYar7/T7TMF+R/8=; b=kxz5zxBsg+vaDxSXc+I1LJ0alNi+3yL0nlr5a4OtC5CrXo5MCCeAjpVPRd2kEylS89 hPlO72gVie7WpRLw8J2ph6fqUbQFQkm5etCP/6HjatnVAJ9sTpuKz+CV6TssRCZGizNS xpluUmHqU9CC7sSxdov19Y9UMQInGplk+RBSnXUcG6QZqi9wgQZbgeZ81dsVZ890njVx 3rCimROZRExxRaldnO/G2PqUkLf1gBJkpHVffgNXU4HfA5DOwRsZa7KcFRdkh4BJxThk gjoviNIWwpYL2GHcfd/84dq2l+5tA0qABnECLkU+EdHbPU3DHWccWuPGRK7Lvg70HWYI 7zAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VtIaQmiC; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t11si131217edc.101.2021.01.19.14.59.58; Tue, 19 Jan 2021 15:00:32 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=VtIaQmiC; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729007AbhASW4P (ORCPT + 99 others); Tue, 19 Jan 2021 17:56:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:29898 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2395064AbhASO0U (ORCPT ); Tue, 19 Jan 2021 09:26:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611066294; 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=S5oU2Ie/VxNNle5UC5ptcg2zY6dliYar7/T7TMF+R/8=; b=VtIaQmiCdvhEZ3fk1eS9pa20pm6I+6HVZYuatrgth4ow105PV+e0Ygbea3HqRwHJper+HJ 7zAMvKKBLTpFesAjEbJcilUV0s+5RngyWB2+YbQi0HwTGZEMv2PGuw2AX/gsFgEqvyd6eU iFlxCQtaQpll/gsrs8kRImrKAVkCXl8= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-40-YKJy7ar7N-CElPQo6wXPLA-1; Tue, 19 Jan 2021 09:24:52 -0500 X-MC-Unique: YKJy7ar7N-CElPQo6wXPLA-1 Received: by mail-qv1-f71.google.com with SMTP id m1so19835196qvp.0 for ; Tue, 19 Jan 2021 06:24:52 -0800 (PST) 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=S5oU2Ie/VxNNle5UC5ptcg2zY6dliYar7/T7TMF+R/8=; b=WodZLaxuUv0Y3bzy6b2nD2VYXToHZ9L2NBhpFwnj1+/EFSnH+Aa1gZA27SLSz0JIb8 VRan3DgIAai4FCUubCXPl5xCHJaoEmGU9qj5DCTweHpzZ2i6t0YsOW6Cp4ef15eaPvUU kyIxl1OOqKlOtwYSmb/Oq4bxQKhkRb/7HyPRaoAwwvjvYeFQwSIbpF8dpRJDPy8D4y/+ H0SR3pVFtIUMCXpWpJ9O+LRb2oMTmGTUXAC0aqHdC9gdApm9GflafqYjgKTtDzWKQx2X RaJ2lf9pAEhi85Mdw2bNSPXthkBuwOp5nUtu39vfjZbBRj8wX4trXWW3MTbRYh5n3GsC s1Jg== X-Gm-Message-State: AOAM531pQedee0ib4fJO3gtmHhHlpP0stddEUj6W6qQBfzcEXSWWlTVj v9df71fhnWEVCjEvsAYv9IXHPucCUC/P26BpU13fcmnXHrRfIaTa0gTUhHsbw+rdG83C5lP/W8H SpTbNZIf2qY1phzMmK/Wulkfh X-Received: by 2002:a0c:eed3:: with SMTP id h19mr4758385qvs.18.1611066292184; Tue, 19 Jan 2021 06:24:52 -0800 (PST) X-Received: by 2002:a0c:eed3:: with SMTP id h19mr4758354qvs.18.1611066291871; Tue, 19 Jan 2021 06:24:51 -0800 (PST) Received: from xz-x1 ([142.126.83.202]) by smtp.gmail.com with ESMTPSA id c136sm12986344qkg.71.2021.01.19.06.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jan 2021 06:24:51 -0800 (PST) Date: Tue, 19 Jan 2021 09:24:49 -0500 From: Peter Xu To: Jason Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mike Rapoport , Mike Kravetz , Jerome Glisse , "Kirill A . Shutemov" , Hugh Dickins , Axel Rasmussen , Matthew Wilcox , Andrew Morton , Andrea Arcangeli , Nadav Amit Subject: Re: [PATCH RFC 07/30] mm/swap: Introduce the idea of special swap ptes Message-ID: <20210119142449.GE76571@xz-x1> References: <20210115170907.24498-1-peterx@redhat.com> <20210115170907.24498-8-peterx@redhat.com> <20210118194013.GM4605@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210118194013.GM4605@ziepe.ca> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 18, 2021 at 03:40:13PM -0400, Jason Gunthorpe wrote: > Does the stuff in hmm.c need updating too? > > if (!pte_present(pte)) { > swp_entry_t entry = pte_to_swp_entry(pte); This idea should be cross-tree, so yes.. even if I'm not 100% sure whether HMM would be a good candidate for file-backed uffd-wp, I agree we should also take care of those. I guess I managed to take care of all the is_swap_pte() callers but forget I should also look for pte_to_swp_entry() users too, since sometimes pte_none() and pte_present() is checked separately, so there're quite a few places that I should have taken care of but got lost. HMM is one of them. Thanks for spotting this, Jason. I'll coordinate in the next version. -- Peter Xu