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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 22682C2BA19 for ; Thu, 23 Apr 2020 09:09:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C34972075A for ; Thu, 23 Apr 2020 09:09:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C34972075A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2F6DE8E0005; Thu, 23 Apr 2020 05:09:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2A6DA8E0003; Thu, 23 Apr 2020 05:09:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1BD158E0005; Thu, 23 Apr 2020 05:09:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0051.hostedemail.com [216.40.44.51]) by kanga.kvack.org (Postfix) with ESMTP id 06A738E0003 for ; Thu, 23 Apr 2020 05:09:30 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B59F1824805A for ; Thu, 23 Apr 2020 09:09:29 +0000 (UTC) X-FDA: 76738546458.04.test59_8d0f64d9a8b15 X-HE-Tag: test59_8d0f64d9a8b15 X-Filterd-Recvd-Size: 2335 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Thu, 23 Apr 2020 09:09:29 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5716D31B; Thu, 23 Apr 2020 02:09:28 -0700 (PDT) Received: from gaia (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E58E43F73D; Thu, 23 Apr 2020 02:09:26 -0700 (PDT) Date: Thu, 23 Apr 2020 10:09:20 +0100 From: Catalin Marinas To: Dave Hansen Cc: Steven Price , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, Andrew Morton , Arnd Bergmann , Hugh Dickins , Vincenzo Frascino , Will Deacon Subject: Re: [PATCH 2/4] mm: Add arch hooks for saving/restoring tags Message-ID: <20200423090919.GA4963@gaia> References: <20200422142530.32619-1-steven.price@arm.com> <20200422142530.32619-3-steven.price@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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 Wed, Apr 22, 2020 at 11:08:10AM -0700, Dave Hansen wrote: > On 4/22/20 7:25 AM, Steven Price wrote: > > Three new hooks are added to the swap code: > > * arch_prepare_to_swap() and > > * arch_swap_invalidate_page() / arch_swap_invalidate_area(). > > One new hook is added to shmem: > > * arch_swap_restore_tags() > > How do the tags get restored outside of the shmem path? I was expecting > to see more arch_swap_restore_tags() sites. The restoring is done via set_pte_at() -> mte_sync_tags() -> mte_restore_tags() in the arch code (see patch 3). arch_swap_restore_tags() just calls mte_restore_tags() directly. shmem is slightly problematic as it moves the page from the swap cache to the shmem one and I think arch_swap_invalidate_page() would have already been called by the time we get to set_pte_at() (Steven can correct me if I got this wrong). -- Catalin