From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD4C13EAC88 for ; Wed, 25 Mar 2026 15:06:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774451193; cv=none; b=NcOBhHFMNOER5cA+sYcn/3GOuxQTEYHMX9ysbSm84HRO+/G6/NHr2EWxB8+ETKjJwUsmpBc+HEQlFi7HG4SP0AbZBAuZAyNJuOsMCNVJBHhMd7h84Ovv1+ky/xoIWV97uiWnHOeApM9NU9KqpZk/nynUJXFTXHqYN2bXl4Q/dOQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774451193; c=relaxed/simple; bh=lnnlSk5FC62h+SQFH8Nxu8sIUC1RcsZVRgl9S0CLkWY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ic8ZRMtul2lW5RGHYnOyS0HboaZd8ImjKv6LzPd0mN8rDimg4ko1yUnx4IXDgf2bZdjvH16NKMdV0vVWo3o/wwseEIRaN6uU/Oy42MDisKyhaY/vAX7gm+jdcfW5o7eaIsZLx4YlluEVpavMVa4dBU+y9MuvVNBkw/HKcntCyiA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BnD9gwi0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BnD9gwi0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBD1FC4CEF7; Wed, 25 Mar 2026 15:06:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774451193; bh=lnnlSk5FC62h+SQFH8Nxu8sIUC1RcsZVRgl9S0CLkWY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BnD9gwi0VQwGVJZwxlZQSOLmSOral2e3j++2mIQTX80noalI4x2J+rOnTVVsPd5ua bijGBS4S+PN15GS2dwJyCXUcUl1+I4PSqcUyBG4KMCANZt9ucF/XE1bBdhJZFUXPrB pmR3QfTDBIoNgVHkDUSxRCCuwFFvYbo0ARFItqVTCM999NZ04o69nLKszndiNSCW/o TGVS2SyH8n2FSXZNGDFHnW9gJal76Pf4kPiku88kYtICDUCIpfRbQJnZ1nNG+WqI7L 2xKtn/qdYmPNFLV6GbRerLsyg16lm2w2zUDlrMOn94GiYGx3bPLRGnrwyMZZpk5ata jBo6ZVd/Hp3iw== Date: Wed, 25 Mar 2026 15:06:26 +0000 From: "Lorenzo Stoakes (Oracle)" To: "David Hildenbrand (Arm)" Cc: Baolin Wang , Barry Song <21cnbao@gmail.com>, akpm@linux-foundation.org, catalin.marinas@arm.com, will@kernel.org, lorenzo.stoakes@oracle.com, ryan.roberts@arm.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, riel@surriel.com, harry.yoo@oracle.com, jannh@google.com, willy@infradead.org, dev.jain@arm.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 1/5] mm: rmap: support batched checks of the references for large folios Message-ID: References: <12132694536834262062d1fb304f8f8a064b6750.1770645603.git.baolin.wang@linux.alibaba.com> <43831628-a00f-4292-9797-cb96a029bb00@kernel.org> <86f611cb-1292-44e4-b629-6503135d33ca@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Mar 25, 2026 at 03:58:36PM +0100, David Hildenbrand (Arm) wrote: > On 3/25/26 15:36, Lorenzo Stoakes (Oracle) wrote: > > On Mon, Mar 16, 2026 at 03:15:18PM +0100, David Hildenbrand (Arm) wrote: > >> On 3/16/26 07:25, Baolin Wang wrote: > >>> > >>> > >>> > >>> Sure. However, after investigating RISC‑V and x86, I found that > >>> ptep_clear_flush_young() does not flush the TLB on these architectures: > >>> > >>> int ptep_clear_flush_young(struct vm_area_struct *vma, > >>>                unsigned long address, pte_t *ptep) > >>> { > >>>     /* > >>>      * On x86 CPUs, clearing the accessed bit without a TLB flush > >>>      * doesn't cause data corruption. [ It could cause incorrect > >>>      * page aging and the (mistaken) reclaim of hot pages, but the > >>>      * chance of that should be relatively low. ] > >>>      * > >>>      * So as a performance optimization don't flush the TLB when > >>>      * clearing the accessed bit, it will eventually be flushed by > >>>      * a context switch or a VM operation anyway. [ In the rare > >>>      * event of it not getting flushed for a long time the delay > >>>      * shouldn't really matter because there's no real memory > >>>      * pressure for swapout to react to. ] > >>>      */ > >>>     return ptep_test_and_clear_young(vma, address, ptep); > >>> } > >> > >> You'd probably want an arch helper then, that tells you whether > >> a flush_tlb_range() after ptep_test_and_clear_young() is required. > >> > >> Or some special flush_tlb_range() helper. > >> > >> I agree that it requires more work. > > > > Sorry unclear here - does the series need more work or does a follow up patch > > need more work? > > Follow up! Ok good as in mm-stable now. Sadly means I don't get to review it but there we go. > > -- > Cheers, > > David Thanks, Lorenzo