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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5680C54FB9 for ; Fri, 17 Nov 2023 19:37:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346174AbjKQThN (ORCPT ); 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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().