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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D364C61DA4 for ; Wed, 15 Mar 2023 09:28:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 13A586B0074; Wed, 15 Mar 2023 05:28:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0EAC76B0075; Wed, 15 Mar 2023 05:28:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF4B86B0078; Wed, 15 Mar 2023 05:28:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id DC5436B0074 for ; Wed, 15 Mar 2023 05:28:11 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 99B408070D for ; Wed, 15 Mar 2023 09:28:11 +0000 (UTC) X-FDA: 80570606382.23.627EA37 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf15.hostedemail.com (Postfix) with ESMTP id C0245A0003 for ; Wed, 15 Mar 2023 09:28:09 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=NkIGZPSC; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678872490; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=QYVGy5vpAQSZUGU+QFWktBSImf3W8XZRvZUg0DjGTxI=; b=fsbeZ3KrHkE1e7JHqWgVfxBiuChvO4adkFVUfpGXhZvFRzSbjb5rRtfjPJAuKoqlTYbM1R 42eB0uAehF+gDcLilaPuE4Uddcdfp0i5mWHTPwogqlbnaSZKgxNK9gplkX6Q7Mym9A7+QQ fiNE30Q2Nz6UxNuYhWm7YCWVJA6CJWA= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=NkIGZPSC; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678872490; a=rsa-sha256; cv=none; b=aLwOrYqVbm2iwR6XbJcjAVxbMcVNyVP1uVUhpxCKo5VAAALQ7sTSh2pGadgG2JORkv9wuY 3CLCcj+5Iziwnviiat6X14nQrRQxN5P5EI9RTgK8mOhztJLyHKwE/JZ0DIey/xdd8LppMl snx0S3mEz8/q/2F4ggIK6qXJl5AjEek= 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 ams.source.kernel.org (Postfix) with ESMTPS id 5F283B81CA1; Wed, 15 Mar 2023 09:28:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E654C433D2; Wed, 15 Mar 2023 09:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678872487; bh=hQlDaYYZ9JaiC4+1J4jss5nVwEEiNfh99jIwoGnYlK8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NkIGZPSCuGKgCQXvfnUUuNEOcyqt7OR8gYUcmyClJsQim67utdP6Wn6T6tw0MYIMk QEA9q66qoC1nIeyquWUyutIYS7EZmSIxV0rdTRM2AqJ3TWp2Q+9cWqDNa90yUTxeFn kGZEwo+PVDmqNmLHtIuHrARSfNywjZWVh5ih6XiTSo1EGieR0jwhGWZbuQxWvOsn7a fcW21beU3ZKcvq2FeboqNEoOmZfOYPp2EXFAIBIG1+vBC8bwNAAdJIeX2Ic7Upfy9B qc8OD7RwzMRZPanX8+EDrTgTKgWbUTh1ErQ+gToP4RuUIrgEJ07AWXG1sjDkcyygtW JpHmh5eCO6tAw== Date: Wed, 15 Mar 2023 11:27:54 +0200 From: Mike Rapoport To: "Matthew Wilcox (Oracle)" Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 02/36] mm: Add generic flush_icache_pages() and documentation Message-ID: References: <20230315051444.3229621-1-willy@infradead.org> <20230315051444.3229621-3-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230315051444.3229621-3-willy@infradead.org> X-Rspamd-Queue-Id: C0245A0003 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: stgwesijn7mh45tq1wnw8zzcjsndtnst X-HE-Tag: 1678872489-944370 X-HE-Meta: U2FsdGVkX19upbHFsCf5VHN3VPz4TyNvtOPQajEbFWhAepxSAFwCG8uCL4Xeln70zhe8AypH1zQrOd+JkvxRYDaFdZmym7N99+iHyWT49bTRZ7Cr3Gupn2unfz6gs5I4pTbdoQQXa12+O+/FCvmL8uR9vXf932kXgIFl2EDB+FRUCSaTZwpF9g/XBHV+q8gzrzQiUgES5c9/9i6jR2v04ZL8RislaM9bHJFEBiYSyKw29RCY1vPa6S90G0pJoC3gaPmAcqd2B0tcV/awjMz7DqrCnw/FMWf+y4NbEbdMruJUV+qMUSetOn9U/DjDIursNlg//xQExUwF8KOh4En6wZuLZ4/snM7sD5m0sa/dcDeVMhU5BTXrOw83PweFisMx8TcTbx33W8ybp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, 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, Mar 15, 2023 at 05:14:10AM +0000, Matthew Wilcox (Oracle) wrote: > flush_icache_page() is deprecated but not yet removed, so add > a range version of it. Change the documentation to refer to > update_mmu_cache_range() instead of update_mmu_cache(). > > Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Mike Rapoport (IBM) > --- > Documentation/core-api/cachetlb.rst | 35 +++++++++++++++-------------- > include/asm-generic/cacheflush.h | 5 +++++ > 2 files changed, 23 insertions(+), 17 deletions(-) > > diff --git a/Documentation/core-api/cachetlb.rst b/Documentation/core-api/cachetlb.rst > index 5c0552e78c58..d4c9e2a28d36 100644 > --- a/Documentation/core-api/cachetlb.rst > +++ b/Documentation/core-api/cachetlb.rst > @@ -88,13 +88,13 @@ changes occur: > > This is used primarily during fault processing. > > -5) ``void update_mmu_cache(struct vm_area_struct *vma, > - unsigned long address, pte_t *ptep)`` > +5) ``void update_mmu_cache_range(struct vm_area_struct *vma, > + unsigned long address, pte_t *ptep, unsigned int nr)`` > > - At the end of every page fault, this routine is invoked to > - tell the architecture specific code that a translation > - now exists at virtual address "address" for address space > - "vma->vm_mm", in the software page tables. > + At the end of every page fault, this routine is invoked to tell > + the architecture specific code that translations now exists > + in the software page tables for address space "vma->vm_mm" > + at virtual address "address" for "nr" consecutive pages. > > A port may use this information in any way it so chooses. > For example, it could use this event to pre-load TLB > @@ -306,17 +306,18 @@ maps this page at its virtual address. > private". The kernel guarantees that, for pagecache pages, it will > clear this bit when such a page first enters the pagecache. > > - This allows these interfaces to be implemented much more efficiently. > - It allows one to "defer" (perhaps indefinitely) the actual flush if > - there are currently no user processes mapping this page. See sparc64's > - flush_dcache_page and update_mmu_cache implementations for an example > - of how to go about doing this. > + This allows these interfaces to be implemented much more > + efficiently. It allows one to "defer" (perhaps indefinitely) the > + actual flush if there are currently no user processes mapping this > + page. See sparc64's flush_dcache_page and update_mmu_cache_range > + implementations for an example of how to go about doing this. > > - The idea is, first at flush_dcache_page() time, if page_file_mapping() > - returns a mapping, and mapping_mapped on that mapping returns %false, > - just mark the architecture private page flag bit. Later, in > - update_mmu_cache(), a check is made of this flag bit, and if set the > - flush is done and the flag bit is cleared. > + The idea is, first at flush_dcache_page() time, if > + page_file_mapping() returns a mapping, and mapping_mapped on that > + mapping returns %false, just mark the architecture private page > + flag bit. Later, in update_mmu_cache_range(), a check is made > + of this flag bit, and if set the flush is done and the flag bit > + is cleared. > > .. important:: > > @@ -369,7 +370,7 @@ maps this page at its virtual address. > ``void flush_icache_page(struct vm_area_struct *vma, struct page *page)`` > > All the functionality of flush_icache_page can be implemented in > - flush_dcache_page and update_mmu_cache. In the future, the hope > + flush_dcache_page and update_mmu_cache_range. In the future, the hope > is to remove this interface completely. > > The final category of APIs is for I/O to deliberately aliased address > diff --git a/include/asm-generic/cacheflush.h b/include/asm-generic/cacheflush.h > index f46258d1a080..09d51a680765 100644 > --- a/include/asm-generic/cacheflush.h > +++ b/include/asm-generic/cacheflush.h > @@ -78,6 +78,11 @@ static inline void flush_icache_range(unsigned long start, unsigned long end) > #endif > > #ifndef flush_icache_page > +static inline void flush_icache_pages(struct vm_area_struct *vma, > + struct page *page, unsigned int nr) > +{ > +} > + > static inline void flush_icache_page(struct vm_area_struct *vma, > struct page *page) > { > -- > 2.39.2 > > -- Sincerely yours, Mike.