From patchwork Sun Jan 2 21:57:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 12702379 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 E698BC433EF for ; Sun, 2 Jan 2022 21:58:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 758386B008C; Sun, 2 Jan 2022 16:58:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6E0BE6B0092; Sun, 2 Jan 2022 16:58:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2736E6B0092; Sun, 2 Jan 2022 16:58:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0076.hostedemail.com [216.40.44.76]) by kanga.kvack.org (Postfix) with ESMTP id E2BF16B0089 for ; Sun, 2 Jan 2022 16:58:04 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 9F0AB8F6D5 for ; Sun, 2 Jan 2022 21:58:04 +0000 (UTC) X-FDA: 78986710488.21.E7697EF Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf31.hostedemail.com (Postfix) with ESMTP id 1872920002 for ; Sun, 2 Jan 2022 21:57:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=dbjnXTvxC0I7nSJmZFs63I8OXQqB2y71bpU/hQGQvv8=; b=Ci1N2s7g/KV/ONjPsgPm1V99an Q8JqwFdFtI0brk5gatwcVGq+lgHlpsKR9WhgnLlWTSI7j+SjQGY/mXGwf2HdPv1GzCCU8DfQ1OBhs 6R3z14iJJQ2a6vCnuFAV4cS9v8YhrrkUUbdiAji4stK8nplGF4yyZ7ZmvASpNy5TGQucvcOTpzvQD 4dSvtwZwAm9YuHpY0jQGGSCuEDATNbi9w5OvWh3HpwtNAQtUxBS5P67MKRdWWRGcCH9KdD4lAIkQ2 8CGPxbExl0CXTsm8QAmSL20Ro1orfH1KZhPiMXacGt2BOmPdSurwNYKdjy/Pxk0uafn56QhCJ7PR9 5nQUc8hA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n48r6-00CLoA-9h; Sun, 02 Jan 2022 21:57:32 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , John Hubbard , Andrew Morton Subject: [PATCH 06/17] mm: Remove page_cache_add_speculative() and page_cache_get_speculative() Date: Sun, 2 Jan 2022 21:57:18 +0000 Message-Id: <20220102215729.2943705-7-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220102215729.2943705-1-willy@infradead.org> References: <20220102215729.2943705-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 1872920002 X-Stat-Signature: 8ab6te5ee9hiagwtrsnmur8yaycm3ixg Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Ci1N2s7g; dmarc=none; spf=none (imf31.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam11 X-HE-Tag: 1641160660-85957 X-Bogosity: 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: These wrappers have no more callers, so delete them. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard --- include/linux/mm.h | 7 +++---- include/linux/pagemap.h | 11 ----------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 00dcea53bb96..602de23482ef 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1298,10 +1298,9 @@ static inline void put_page(struct page *page) * applications that don't have huge page reference counts, this won't be an * issue. * - * Locking: the lockless algorithm described in page_cache_get_speculative() - * and page_cache_gup_pin_speculative() provides safe operation for - * get_user_pages and page_mkclean and other calls that race to set up page - * table entries. + * Locking: the lockless algorithm described in folio_try_get_rcu() + * provides safe operation for get_user_pages(), page_mkclean() and + * other calls that race to set up page table entries. */ #define GUP_PIN_COUNTING_BIAS (1U << 10) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 704cb1b4b15d..4a63176b6417 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -283,17 +283,6 @@ static inline struct inode *folio_inode(struct folio *folio) return folio->mapping->host; } -static inline bool page_cache_add_speculative(struct page *page, int count) -{ - VM_BUG_ON_PAGE(PageTail(page), page); - return folio_ref_try_add_rcu((struct folio *)page, count); -} - -static inline bool page_cache_get_speculative(struct page *page) -{ - return page_cache_add_speculative(page, 1); -} - /** * folio_attach_private - Attach private data to a folio. * @folio: Folio to attach data to.