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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2819BC001B5 for ; Fri, 2 Sep 2022 16:30:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=j6fyiu1Jrpx1Fnm9R7Lz2QFLxLcVZBBc5lT7N2JrnMY=; b=SZG6rerwai8Ko2 PYr4L2j/0nqHsaxJpNupIc0ep42wN15/VHurf/HrVY+CLzbfU4QU2hOo6fVswB8MYAB34iG5oSTRA 6J/3Iuhr69KA991c6HUEnY4CMmGNYe0dywwe/JkViGM8VGwr/4ZhTUga+mdmhGJeOc0kUq7mPT1Kr 7Qthw2Mhiy2/2fJkz/63sQ7BI8ShsQUwel2XcG+bLMbychspuMHm812i3vEOVibPAy7FJsKScCQYD CU4pAAxTKzaudLnxMnwLPrJbWWx5xYjrIxxkilxzvMByJy8+KFkiZdYYQTCJQvOlRA6sAFiitbXdO W9Ymn+/7SCqdx9BfApEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oU9Xi-0071Lg-TM; Fri, 02 Sep 2022 16:29:18 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oU9Xf-00714Q-JZ for linux-arm-kernel@lists.infradead.org; Fri, 02 Sep 2022 16:29:17 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 550D8CE3028; Fri, 2 Sep 2022 16:28:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3E34C433D6; Fri, 2 Sep 2022 16:28:50 +0000 (UTC) Date: Fri, 2 Sep 2022 17:28:47 +0100 From: Catalin Marinas To: Steven Price Cc: Peter Collingbourne , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, Cornelia Huck , Will Deacon , Marc Zyngier , Evgenii Stepanov , kvm@vger.kernel.org, Vincenzo Frascino Subject: Re: [PATCH v3 4/7] arm64: mte: Lock a page for MTE tag initialisation Message-ID: References: <20220810193033.1090251-1-pcc@google.com> <20220810193033.1090251-5-pcc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220902_092915_849103_A4B9CAE8 X-CRM114-Status: GOOD ( 16.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Sep 02, 2022 at 03:47:33PM +0100, Steven Price wrote: > On 10/08/2022 20:30, Peter Collingbourne wrote: > > diff --git a/arch/arm64/mm/mteswap.c b/arch/arm64/mm/mteswap.c > > index a78c1db23c68..cd5ad0936e16 100644 > > --- a/arch/arm64/mm/mteswap.c > > +++ b/arch/arm64/mm/mteswap.c > > @@ -53,6 +53,9 @@ bool mte_restore_tags(swp_entry_t entry, struct page *page) > > if (!tags) > > return false; > > > > + /* racing tag restoring? */ > > + if (!try_page_mte_tagging(page)) > > + return false; > > mte_restore_page_tags(page_address(page), tags); > > I feel like adding a "set_page_mte_tagged(page);" in here would avoid > the need for the comments about mte_restore_tags() taking the lock. Good point. I think I blindly followed the set_bit() places but it makes sense to move the bit setting to mte_restore_tags(). Thanks for the review. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel