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=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 CA1C0C433DB for ; Tue, 19 Jan 2021 14:24:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 24C26206E5 for ; Tue, 19 Jan 2021 14:24:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24C26206E5 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 5DAEA8D002E; Tue, 19 Jan 2021 09:24:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 563DC8D0017; Tue, 19 Jan 2021 09:24:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 42B5F8D002E; Tue, 19 Jan 2021 09:24:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0145.hostedemail.com [216.40.44.145]) by kanga.kvack.org (Postfix) with ESMTP id 24E9E8D0017 for ; Tue, 19 Jan 2021 09:24:56 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D27061F06 for ; Tue, 19 Jan 2021 14:24:55 +0000 (UTC) X-FDA: 77722746150.06.fork02_050fd7a27552 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 081C81004164D for ; Tue, 19 Jan 2021 14:24:55 +0000 (UTC) X-HE-Tag: fork02_050fd7a27552 X-Filterd-Recvd-Size: 4573 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Tue, 19 Jan 2021 14:24:54 +0000 (UTC) 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-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-232-Ek37F35RM4GbW6XnU0zw3g-1; Tue, 19 Jan 2021 09:24:52 -0500 X-MC-Unique: Ek37F35RM4GbW6XnU0zw3g-1 Received: by mail-qv1-f69.google.com with SMTP id l3so19849740qvr.10 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=oCpdWMGEfSzEqKAgn8ys0oEqEzJ5N4Q9Cu4pTsCf82GLROId/csgkjgxrFkHhFjFDF e1UJ+Rb7EX3aPryeEBiAfunX5c4RgHuE7eZmQ+c8/aIwGF/hvOyn+J3kyTU3zmPKwa4Q lFz5Q0wBJ1DYaKw+b/kJxLL/yg/ZfddSqJz6nz6Gks/xdGAureA/WEJ1EEenR/Q5ejC9 iV6zqFdPPsheoxZAsY2BQsIjw+tSChuxWwoVO4ZJK28W/R5Amgz5qJJfKv8D8H3ZYELb I1ZOgboO6Oebfvp27JHQlHFfrjNHmbhuCDRvMGTk8rz50ZJU++t/E9gnOD/ovMya87wj LosQ== X-Gm-Message-State: AOAM531CzpqHZYoab9RalRACConuY4C60eAlFqzVf6/8MKFw4kh4Xva9 GTv/HfwYjupOnITR9TAPtRP7JV/3hdsXdCn7mgST19iWRLLBCl4n3JZuoVqf5tHSclMJgz2vm7s o4CI9EJkVpJA= X-Received: by 2002:a0c:eed3:: with SMTP id h19mr4758383qvs.18.1611066292183; Tue, 19 Jan 2021 06:24:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxexp38ofvK77a0ePIAQrevhe43Om+FBagMzeBtmCxifRFDTtSYScAIb2+5m2HDB8gP9xBm6A== 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 In-Reply-To: <20210118194013.GM4605@ziepe.ca> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline 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 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