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=-14.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 5D879C55179 for ; Fri, 6 Nov 2020 23:27:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 247E921D7F for ; Fri, 6 Nov 2020 23:27:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dpU3jXCl"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="4EoKrOqT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728911AbgKFX1V (ORCPT ); Fri, 6 Nov 2020 18:27:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728198AbgKFX1R (ORCPT ); Fri, 6 Nov 2020 18:27:17 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B5B5C0613D2; Fri, 6 Nov 2020 15:27:16 -0800 (PST) Date: Fri, 06 Nov 2020 23:27:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1604705234; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vs2hsNsDCu03iBrpL4x3TmHdLnwL1QeRZpMF+TExK20=; b=dpU3jXClreI+M98jH+hd1EcJZN5hZSK0eiAnG66WduCOnla1LSOLUfW3XnVCugW2oG2Nje lDC8ELYjusEeQh1HcaHHl+OKyXUtVQg6pa2YpHWQyknndJo01aSsKZYeLTGu36S7RDo08j KEl1mlJqRX/XFqvHNGtPkZuwhaqc3MLY/TJZiEzqZ6lg5jgGypxEi9zv/tfm42igIX/u5m haAGkYKXila/Ub5F+z8vbhYog7uDZ1wDwaKAz65Jjx1sKAiCSuMeonymU3Z5BoJcXeuo4B FHUBLJMrS6AqHUs/bQAeToWVRE0zmsD5HkQgsOQGfYC/UOOLa71P6IjUeYDy7w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1604705234; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vs2hsNsDCu03iBrpL4x3TmHdLnwL1QeRZpMF+TExK20=; b=4EoKrOqT0bD/3chnSSbMtSmcK55oqWZH2aF9IcUvF5Iu9rmy5H2XfEv/qDNIAIDaFRA5WE 5ntq9tY3qTORwSCA== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: core/mm] mm/highmem: Remove the old kmap_atomic cruft Cc: Thomas Gleixner , Linus Torvalds , Christoph Hellwig , Andrew Morton , Arnd Bergmann , x86 , LKML In-Reply-To: <20201103095858.516281567@linutronix.de> References: <20201103095858.516281567@linutronix.de> MIME-Version: 1.0 Message-ID: <160470523356.397.9071244869695369728.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the core/mm branch of tip: Commit-ID: 3c1016b53c311906878c703af1e2b29855a9a962 Gitweb: https://git.kernel.org/tip/3c1016b53c311906878c703af1e2b29855a9a962 Author: Thomas Gleixner AuthorDate: Tue, 03 Nov 2020 10:27:31 +01:00 Committer: Thomas Gleixner CommitterDate: Fri, 06 Nov 2020 23:14:58 +01:00 mm/highmem: Remove the old kmap_atomic cruft All users gone. Signed-off-by: Thomas Gleixner Cc: Linus Torvalds Cc: Christoph Hellwig Cc: Andrew Morton Cc: Arnd Bergmann Link: https://lore.kernel.org/r/20201103095858.516281567@linutronix.de --- include/linux/highmem.h | 63 ++-------------------------------------- mm/highmem.c | 7 +---- 2 files changed, 5 insertions(+), 65 deletions(-) diff --git a/include/linux/highmem.h b/include/linux/highmem.h index de78869..3180a8f 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -86,31 +86,16 @@ static inline void kunmap(struct page *page) * be used in IRQ contexts, so in some (very limited) cases we need * it. */ - -#ifndef CONFIG_KMAP_LOCAL -void *kmap_atomic_high_prot(struct page *page, pgprot_t prot); -void kunmap_atomic_high(void *kvaddr); - static inline void *kmap_atomic_prot(struct page *page, pgprot_t prot) { preempt_disable(); pagefault_disable(); - if (!PageHighMem(page)) - return page_address(page); - return kmap_atomic_high_prot(page, prot); -} - -static inline void __kunmap_atomic(void *vaddr) -{ - kunmap_atomic_high(vaddr); + return __kmap_local_page_prot(page, prot); } -#else /* !CONFIG_KMAP_LOCAL */ -static inline void *kmap_atomic_prot(struct page *page, pgprot_t prot) +static inline void *kmap_atomic(struct page *page) { - preempt_disable(); - pagefault_disable(); - return __kmap_local_page_prot(page, prot); + return kmap_atomic_prot(page, kmap_prot); } static inline void *kmap_atomic_pfn(unsigned long pfn) @@ -125,13 +110,6 @@ static inline void __kunmap_atomic(void *addr) kunmap_local_indexed(addr); } -#endif /* CONFIG_KMAP_LOCAL */ - -static inline void *kmap_atomic(struct page *page) -{ - return kmap_atomic_prot(page, kmap_prot); -} - /* declarations for linux/mm/highmem.c */ unsigned int nr_free_highpages(void); extern atomic_long_t _totalhigh_pages; @@ -212,41 +190,8 @@ static inline void __kunmap_atomic(void *addr) #define kmap_flush_unused() do {} while(0) -#endif /* CONFIG_HIGHMEM */ - -#if !defined(CONFIG_KMAP_LOCAL) -#if defined(CONFIG_HIGHMEM) - -DECLARE_PER_CPU(int, __kmap_atomic_idx); - -static inline int kmap_atomic_idx_push(void) -{ - int idx = __this_cpu_inc_return(__kmap_atomic_idx) - 1; - -#ifdef CONFIG_DEBUG_HIGHMEM - WARN_ON_ONCE(in_irq() && !irqs_disabled()); - BUG_ON(idx >= KM_TYPE_NR); -#endif - return idx; -} - -static inline int kmap_atomic_idx(void) -{ - return __this_cpu_read(__kmap_atomic_idx) - 1; -} -static inline void kmap_atomic_idx_pop(void) -{ -#ifdef CONFIG_DEBUG_HIGHMEM - int idx = __this_cpu_dec_return(__kmap_atomic_idx); - - BUG_ON(idx < 0); -#else - __this_cpu_dec(__kmap_atomic_idx); -#endif -} -#endif -#endif +#endif /* CONFIG_HIGHMEM */ /* * Prevent people trying to call kunmap_atomic() as if it were kunmap() diff --git a/mm/highmem.c b/mm/highmem.c index 77677c6..499dfaf 100644 --- a/mm/highmem.c +++ b/mm/highmem.c @@ -31,12 +31,6 @@ #include #include -#ifndef CONFIG_KMAP_LOCAL -#ifdef CONFIG_HIGHMEM -DEFINE_PER_CPU(int, __kmap_atomic_idx); -#endif -#endif - /* * Virtual_count is not a pure "count". * 0 means that it is not mapped, and has not been mapped @@ -410,6 +404,7 @@ static inline void kmap_local_idx_pop(void) #ifndef arch_kmap_local_post_map # define arch_kmap_local_post_map(vaddr, pteval) do { } while (0) #endif + #ifndef arch_kmap_local_pre_unmap # define arch_kmap_local_pre_unmap(vaddr) do { } while (0) #endif