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 E5533C61DA4 for ; Wed, 15 Mar 2023 09:27:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 422046B0072; Wed, 15 Mar 2023 05:27:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D0FD6B0074; Wed, 15 Mar 2023 05:27:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2721B6B0075; Wed, 15 Mar 2023 05:27:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 13D126B0072 for ; Wed, 15 Mar 2023 05:27:26 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id D955F1A019C for ; Wed, 15 Mar 2023 09:27:25 +0000 (UTC) X-FDA: 80570604450.30.ACD43DF Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf07.hostedemail.com (Postfix) with ESMTP id 0FD6340007 for ; Wed, 15 Mar 2023 09:27:23 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=D18IvsKQ; spf=pass (imf07.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678872444; a=rsa-sha256; cv=none; b=fdpKin73mQIiV+KJ8kFxR89Xo3mQVpw4SO9MMEF8mlun5RQ/3BHKoOA6yGsfo8XbZh8xhV mbt1cIaZRcFUxsBec5iMagupUIIC1fF5WRjoAaxtwlzcjbCLYk0vwzM5YwZi+3WVCEaas0 Sk2pJkheXj5IxhpKWWV0esC189HvS60= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=D18IvsKQ; spf=pass (imf07.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678872444; 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=8/PTue+7UXLf+HbdJAnxGpXn6XqchmsOjSxVCYiwZ1k=; b=P8AIPgbc7ZHAvqoZM4dDua07dG3fY2gtmfrGUGYSzc1kBB3AKSebAZdo9nLzSb7ANQWxD5 Er1uj5NMb2ica4zdfxteXwUF8PlnDZle//BkTrt1FT0sPXpDOh6D1kj8RKkExKMnFDddwK ebslkaDhnsSM+lcFPG4gb1juoctxXwY= 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 67A8EB81CA1; Wed, 15 Mar 2023 09:27:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B76AC433D2; Wed, 15 Mar 2023 09:27:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678872441; bh=w+J8gucSlfSu3xi4ruapy/hNtDvk5NYHt9AxAbkHP2Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D18IvsKQQ9L5V4uTkOLzo7MrZqxnmEgzsXlep3LHdUJh+J07Tpiv8BkZUf/NZ99G2 RppyUvZKVA773EwBQT1DchLMTboYO/75iEoxXenBf1n64UZBzxJXQ+iF+Yf5OnALwy n4Cz1QNywLpftpwOghTcDxmArWpaLoP44WvKPG+zmt8mFMNjXWW+jJROzwlr3yAmJr l4DDII8x2NlaDlIqL1TC2fijEJNksy9lrYYhtJcyWjFSuRObeKSyYW3gRKhtj41IDZ /gLtH0JaOqgHMx2CIlaNhtF9B925CBeWVFsha0VHVk6TlTsiv8xBftlNFsi8mKMtkB z67Z53tc/o6Hw== Date: Wed, 15 Mar 2023 11:27:08 +0200 From: Mike Rapoport To: "Matthew Wilcox (Oracle)" Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 02/34] mm: Add generic flush_icache_pages() and documentation Message-ID: References: <20230228213738.272178-1-willy@infradead.org> <20230228213738.272178-3-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230228213738.272178-3-willy@infradead.org> X-Rspam-User: X-Rspamd-Queue-Id: 0FD6340007 X-Rspamd-Server: rspam01 X-Stat-Signature: 5a134whnthx6pp9p1mo8dy1ibz35my5k X-HE-Tag: 1678872443-975273 X-HE-Meta: U2FsdGVkX1/kWkPguy9wibiuMPL5seuZFisdZHnvzyp58SLBgn+2j4LYkXoZb7JJ+FSLYqoXwGl9ddXt2taTIwph2S3gwAwmQ39BM6KfWgOYi1tOu5y6/zAGuk+04gPBo4N7+CqOkscDOK1N+qvgMUgefo5BDZH4V6F4wCX8J0zgajAOWszj/cVvHTgPSJARc7AFbNeBbnGoQuVBGuL25YmrKWJRgfcGTZnJo64YuuKtRlGUzQR7l/rroY0UZv1QRH7p/iQI65rEi3DkWhoCsytSXPKSgb6HJQSPHeEFMxVEymAqNCKVO7bbLL4qtWiWWrxlwopEZoC3fREH00tThBpZL2xn/SXfzHgcIiKWelnwbghBVFx5nLxPyopPXlw1MX6d6zWEakDU2Wsl3NOljFpV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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 Tue, Feb 28, 2023 at 09:37:05PM +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.1 > > -- Sincerely yours, Mike.