From patchwork Wed Sep 2 15:44:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 11751047 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 42EED14E5 for ; Wed, 2 Sep 2020 15:45:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 10337214F1 for ; Wed, 2 Sep 2020 15:45:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Qwnbh2V3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 10337214F1 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 36FA1900007; Wed, 2 Sep 2020 11:45:00 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2F7FB6B0096; Wed, 2 Sep 2020 11:45:00 -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 1E6DA900007; Wed, 2 Sep 2020 11:45:00 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0247.hostedemail.com [216.40.44.247]) by kanga.kvack.org (Postfix) with ESMTP id 053966B0095 for ; Wed, 2 Sep 2020 11:45:00 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id A4E563633 for ; Wed, 2 Sep 2020 15:44:59 +0000 (UTC) X-FDA: 77218544718.14.dolls42_3813c7d270a2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 6F0B418229835 for ; Wed, 2 Sep 2020 15:44:59 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,dhowells@redhat.com,,RULES_HIT:30036:30051:30054:30070,0,RBL:205.139.110.61:@redhat.com:.lbl8.mailshell.net-66.10.201.10 62.18.0.100;04yghb51wqhqrnqyjddkdbbg1e34rypueoyf41zcznsay1mn5ee9hcmbrhfwddp.ww4q4gq5o7c7ethp8xdbm4u3mhrisnk69mj3rq88m7r3nzqsxc6fqnxxacsp6qj.a-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:23,LUA_SUMMARY:none X-HE-Tag: dolls42_3813c7d270a2 X-Filterd-Recvd-Size: 4181 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Wed, 2 Sep 2020 15:44:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599061498; 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=w3IPCFyIVPVmMXkQUqgqDzASUCFftpliFw52FResyTI=; b=Qwnbh2V3cihCPx4dGoPP3WtN9b05kNIdFBhnW3Qqnksm+UKm8xscGE8zcyJVNAVz/QL6aO p9eN9Os/Ki2xLvAVLFjDPF4bPYNvu9PeHVHDAnc0SfPr+4tWXEG8HZt0Zx5FZABDIyfLDv zYKmn0GKfAMGHn8rbf6ZA4BGOXgQsGw= 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-278-bP1wLkRtPECuZMNwkvjG6g-1; Wed, 02 Sep 2020 11:44:56 -0400 X-MC-Unique: bP1wLkRtPECuZMNwkvjG6g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1F81418C5202; Wed, 2 Sep 2020 15:44:55 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-113-6.rdu2.redhat.com [10.10.113.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 209F05C1C4; Wed, 2 Sep 2020 15:44:53 +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 5/6] mm: Fold ra_submit() into do_sync_mmap_readahead() [ver #2] 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: Wed, 02 Sep 2020 16:44:53 +0100 Message-ID: <159906149326.663183.12774034343203621496.stgit@warthog.procyon.org.uk> In-Reply-To: <159906145700.663183.3678164182141075453.stgit@warthog.procyon.org.uk> References: <159906145700.663183.3678164182141075453.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.23 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Rspamd-Queue-Id: 6F0B418229835 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 | 10 ---------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index fdfeedd1eb71..eaa046fdc0b6 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2500,10 +2500,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 = ra->ra_pages; ra->async_size = ra->ra_pages / 4; - ra_submit(ra, mapping, file); + __do_page_cache_readahead(&rac, ra->size, ra->async_size); return fpin; } diff --git a/mm/internal.h b/mm/internal.h index c8ccf208f524..d62df5559500 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -53,16 +53,6 @@ void force_page_cache_readahead(struct readahead_control *, unsigned long); void __do_page_cache_readahead(struct readahead_control *, unsigned long nr_to_read, unsigned long lookahead_size); -/* - * 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); - __do_page_cache_readahead(&rac, ra->size, ra->async_size); -} - /** * page_evictable - test whether a page is evictable * @page: the page to test