Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp753916rdb; Fri, 17 Nov 2023 11:37:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzkGIe+3L6G1FE1NuTAnArLsZ9rM4/jRlWTUhVQiLHJZi4jxsmIym6OvkwidRSlgQ/ZmYP X-Received: by 2002:a17:902:d491:b0:1ca:8169:e853 with SMTP id c17-20020a170902d49100b001ca8169e853mr730374plg.4.1700249834526; Fri, 17 Nov 2023 11:37:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700249834; cv=none; d=google.com; s=arc-20160816; b=CwO9jPQer6/C1TABtkovRErkysgXRfoB0U3ugLVN4mfuGm2sTDPVeXfr3Kr7QN1DxP d29uNVuogwXdrNYrsFuC7vn9dcro49v5obf6kUrux8ahEuntNM/BHBGv4DOEBb++yWcZ JLzBHmdyzvLUXN4+0Dy4r4sSH0DbiAoEbxSKWXhHOaVeKk4bgS4xG6qFJ6L/KjotvGu+ foJ2Xt5hlGm/Q7Vj4p4/F8eDNTsVVFBz0fXO0+lqzzQKeC8WqBTrxlVF7eQvGajuufH1 wMh+u7Y2XnMIBeBSlrNtAZ70tY22qv7e+s6JkaedZkq1rcSuF/hf0HvPJ7chwkj79w6z 8UXQ== 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=Hg3+9uA2o75brJVv8ImTnM2XP71Dnb1sX48npnh9pbc=; fh=cUXH7wwc7tGpQuRldbXF8dKlMDzL87zD2FSETGyPB4E=; b=v0k5Ta479jWvFp8tPvQ6RP9C/F8vMvAkbc9DBZ1Sc0SUjbGCMwa/Sdfom03wgFrU88 XlbIPNd5rBjKn2O9ovHZBYlj1jq6uiYLkNAVlVy/IsIDVhDbiR0DzFBpYgVdT1yHesQv f8FIlplhyD1qgVgDxnXYlhjAUGEgzaCAi1xaVpovM8chXBnHamaN8Kv9jwPaFXkgnhuq bgFSrkl2HAH1NqbIoK12okNC7LZca2YgU2x/0q2/kmPN63FZDILQgjHqF8xX3mGVRGxJ bGeC0ifLNKFO4NPP42Fjwq3AIesPtPr6inyF2lUbMWuqotpdyTfEv00W5f3hZgCW8loH e6DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=LCBRuKbX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id s16-20020a17090302d000b001c9fe071f2bsi2530268plk.8.2023.11.17.11.37.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 11:37:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=LCBRuKbX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 55D3B804E822; Fri, 17 Nov 2023 11:37:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346130AbjKQThN (ORCPT + 99 others); Fri, 17 Nov 2023 14:37:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232010AbjKQThM (ORCPT ); Fri, 17 Nov 2023 14:37:12 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D145AD4F for ; Fri, 17 Nov 2023 11:37:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Hg3+9uA2o75brJVv8ImTnM2XP71Dnb1sX48npnh9pbc=; b=LCBRuKbX3R/y7j0INeyp4apKAB gBEvjp8kRp3eRbYo9PZuPrOtKQsJ+cLc1F/SxtXiVGoEZA6qboo3ydYREqGIFx1bqdfSPleLVOR2E R/8Y4lG6OIFKqc5CXb/1Myx+tRb1MMOXivJ9HTXx0nxmX4VxYhcVFqT+klcjBzF2btIlkonztl/fc mDXKeruHlW8b0EI9V7e+OVi6OjmPn8SGYIwqJnT0h/DBTZlD/tHXiMC3JCfKfYWwvkz9EjWncJDUE 8hWcxWuZffJsvX/H0wQiGVZG0Cu+xaUsOSpVJIJZKK29vulFQBc314IGGMIs99N7gGxRtnfIN24VA NLbZUjig==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1r44e9-00BEGO-NL; Fri, 17 Nov 2023 19:36:57 +0000 Date: Fri, 17 Nov 2023 19:36:57 +0000 From: Matthew Wilcox To: Barry Song <21cnbao@gmail.com> Cc: David Hildenbrand , steven.price@arm.com, akpm@linux-foundation.org, ryan.roberts@arm.com, catalin.marinas@arm.com, will@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mhocko@suse.com, shy828301@gmail.com, v-songbaohua@oppo.com, wangkefeng.wang@huawei.com, xiang@kernel.org, ying.huang@intel.com, yuzhao@google.com Subject: Re: [RFC V3 PATCH] arm64: mm: swap: save and restore mte tags for large folios Message-ID: References: <20231114014313.67232-1-v-songbaohua@oppo.com> <864489b3-5d85-4145-b5bb-5d8a74b9b92d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 17 Nov 2023 11:37:13 -0800 (PST) On Fri, Nov 17, 2023 at 07:47:00AM +0800, Barry Song wrote: > This has been discussed. Steven, Ryan and I all don't think this is a good > option. in case we have a large folio with 16 basepages, as do_swap_page > can only map one base page for each page fault, that means we have > to restore 16(tags we restore in each page fault) * 16(the times of page faults) > for this large folio. That doesn't seem all that hard to fix? Call set_ptes() instead of set_pte_at(). The biggest thing, I guess, is making sure that all the PTEs you're going to set up are still pte_none().