From patchwork Tue Sep 1 16:28:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 11749107 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A47B109A for ; Tue, 1 Sep 2020 16:29:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 17332206EF for ; Tue, 1 Sep 2020 16:29:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ERPDUKbi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 17332206EF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 394616B00A5; Tue, 1 Sep 2020 12:29:06 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 31FB4900002; Tue, 1 Sep 2020 12:29:06 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E7DD6B00A8; Tue, 1 Sep 2020 12:29:06 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id 032966B00A5 for ; Tue, 1 Sep 2020 12:29:05 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id BBED71EF2 for ; Tue, 1 Sep 2020 16:29:05 +0000 (UTC) X-FDA: 77215027050.02.cord71_2e15dca27099 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id 9011210097AA0 for ; Tue, 1 Sep 2020 16:29:05 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,dhowells@redhat.com,,RULES_HIT:30036:30051:30054:30070,0,RBL:207.211.31.81:@redhat.com:.lbl8.mailshell.net-62.18.0.100 66.10.201.10;04yfq8mutc5soxncqedzwt4oezq8qypueoyf41zcsmwo174dhm3kuokpq8zm6qi.3nnwafzh4w8wyfi7caj44nfmxofbhbtmqq57jkzpm5zut8saue8xpprmxeim3ht.q-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: cord71_2e15dca27099 X-Filterd-Recvd-Size: 4193 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Tue, 1 Sep 2020 16:29:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598977744; h=from:from: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=FL08+vWWj3quE65ajNi5b46OkqhFrRGb41bV5AnZLQw=; b=ERPDUKbiPR5FVuNiuVEzVVqisPVM1AXybDncVMqJZcK0eAkuvYXuiHeYK7TtlVDfwbIfI1 IKZgET3CbKO89G2i/oxOZhtFd5MbwurD3t8auJJwMVRtTiCVm5c3X1CJfccGfyfSlzHQTJ gUsggv7cURyLLI6fO6GUL7fBxzh077M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-405-dCtNfjpfN_W8gxPWXNEBUg-1; Tue, 01 Sep 2020 12:29:02 -0400 X-MC-Unique: dCtNfjpfN_W8gxPWXNEBUg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9EABB8014D9; Tue, 1 Sep 2020 16:29:01 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-113-231.rdu2.redhat.com [10.10.113.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E1D11002D6F; Tue, 1 Sep 2020 16:29:00 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [RFC PATCH 6/7] mm: Fold ra_submit() into do_sync_mmap_readahead() From: David Howells To: willy@infradead.org Cc: dhowells@redhat.com, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Tue, 01 Sep 2020 17:28:59 +0100 Message-ID: <159897773980.405783.13680099265521545037.stgit@warthog.procyon.org.uk> In-Reply-To: <159897769535.405783.17587409235571100774.stgit@warthog.procyon.org.uk> References: <159897769535.405783.17587409235571100774.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.23 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Rspamd-Queue-Id: 9011210097AA0 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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: Fold ra_submit() into its last remaining user and pass the previously added readahead_control struct down into __do_page_cache_readahead(). Signed-off-by: David Howells --- mm/filemap.c | 6 +++--- mm/internal.h | 11 ----------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 9f2f99db7318..c22bb01e8ba6 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2502,10 +2502,10 @@ static struct file *do_sync_mmap_readahead(struct vm_fault *vmf) * mmap read-around */ fpin = maybe_unlock_mmap_for_io(vmf, fpin); - ra->start = max_t(long, 0, offset - ra->ra_pages / 2); - ra->size = ra->ra_pages; + ra->start = rac._index = max_t(long, 0, offset - ra->ra_pages / 2); + ra->size = rac._nr_pages = ra->ra_pages; ra->async_size = ra->ra_pages / 4; - ra_submit(ra, mapping, file); + __do_page_cache_readahead(&rac, ra->async_size); return fpin; } diff --git a/mm/internal.h b/mm/internal.h index e1d296e76fb0..de3b2ce2743a 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -52,17 +52,6 @@ void unmap_page_range(struct mmu_gather *tlb, void force_page_cache_readahead(struct readahead_control *); void __do_page_cache_readahead(struct readahead_control *, unsigned long); -/* - * Submit IO for the read-ahead request in file_ra_state. - */ -static inline void ra_submit(struct file_ra_state *ra, - struct address_space *mapping, struct file *file) -{ - DEFINE_READAHEAD(rac, file, mapping, ra->start); - rac._nr_pages = ra->size; - __do_page_cache_readahead(&rac, ra->async_size); -} - /** * page_evictable - test whether a page is evictable * @page: the page to test