Message ID | 20241114152743.2381672-7-axboe@kernel.dk (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 A2D0FD68B30 for <linux-mm@archiver.kernel.org>; Thu, 14 Nov 2024 15:28:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A63E6B0098; Thu, 14 Nov 2024 10:28:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 655E76B0099; Thu, 14 Nov 2024 10:28:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 459616B009A; Thu, 14 Nov 2024 10:28:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 25C276B0098 for <linux-mm@kvack.org>; Thu, 14 Nov 2024 10:28:13 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id BCF2FC0BB8 for <linux-mm@kvack.org>; Thu, 14 Nov 2024 15:28:12 +0000 (UTC) X-FDA: 82785080280.26.A601836 Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) by imf30.hostedemail.com (Postfix) with ESMTP id 6AA7580010 for <linux-mm@kvack.org>; Thu, 14 Nov 2024 15:26:46 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b="UHisqi3/"; spf=pass (imf30.hostedemail.com: domain of axboe@kernel.dk designates 209.85.160.41 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731598001; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=573A7VIJaN7Phef7EPro6/84rHuXaF2Ar2GUBUbETSc=; b=41RY9a9Karu9Ll8QTAvyVcKPbD+peFqfPmbw9uYa2vROvgYOCGisuq8U3AVINnshDLdDUG +TASqz3Pw5b5de02POduuTrsOHmLK2RQb6MzCd/fawfsnbFs0Aa8AkqfJLzbCEmFGwNX4X CSCeCR0d6ozbsScRokDuw9ThGPws504= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731598001; a=rsa-sha256; cv=none; b=oeyhVJDWJet0u/A09fQS1ppMD7rfZ75plIyOAz3P0rp5/kNVzFXKHjm/nzSK4HAqX5BZIH lzoxzvll4MwnHt5tTWu39Gs4canVZYHtIdQZarfFx0K7YLraioCMB+K3psUP1nRzo7/6kI cXlcJpsEUGpDRDJqffimpqYcg7Rty0Q= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b="UHisqi3/"; spf=pass (imf30.hostedemail.com: domain of axboe@kernel.dk designates 209.85.160.41 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-290c69be014so365765fac.3 for <linux-mm@kvack.org>; Thu, 14 Nov 2024 07:28:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1731598088; x=1732202888; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=573A7VIJaN7Phef7EPro6/84rHuXaF2Ar2GUBUbETSc=; b=UHisqi3/86P0kWuZ775aqVECMg/0lyhI41BTRVzzmfLxnZthIdrnbvgZPPC5v0GZdU v+0lu2RuQjUGb+dOjP3CvmykByyUT8UO94QwJEE8TVnYzzDbWw9XgNlP55TIeyiP6DE1 UAHLcRgi6wPxaQy5Ym2kTUJb6AavuwiQBZNQbQRaJ0llm6mvOkNOyfTT7+gIHK+U4kPO OctN9SNr816y9Gdi4wUMUmelpeoNcerkjePK6f1KikVumk/bGpZoyEpygQ7mGzT+N5UA +uGIxMcITjCcZToMi9xKrZb6UOgguOv/Kc5JuRIIJy/rVCtNjci8lS8K9ZldoNpj5ssb sH2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731598088; x=1732202888; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=573A7VIJaN7Phef7EPro6/84rHuXaF2Ar2GUBUbETSc=; b=hHOGLYlTDuiCW3HySVRNIxGQOtBNKRc4LOXQo3r9s4W+rJK1puSXCASCf7fX+eRqSW MyajwlRK2C8OPn1U8DNNSRC5xn6IUsiVV/LpW+7jYoiMO1szDg+SroFn8WyhI1/3Tmcj emMqhvaS7bwEXBli7+VDZXv/Lkryz19i/AlWKl5uIM9ipD6CDCV9QwdpXhLJVhmwpFJ9 N5oFtPu9ODxhfiDh4mqGp8ebpHIHqRD5kHGmwtyTHjYtrZ7Jw3JAOx1y65nm5OFnZdQP R0CwxxwobSOwY88iZKuhDEyFxMiyHTuYKfKs9hDgUkNALqWT0GGeSw3or5rtbg9boKaH bMTg== X-Gm-Message-State: AOJu0YxPpgxtVI8PdYNnGHJMxkA4nrhrBGpmTKUJMdd1U7JCpEiSml0x yvL4joJYQYbJM7rPUzH2yledA/V4trh4BIAphA6SxhCI9YjR1NjiywMbDsYyixbprDEZDkLp8td PEYU= X-Google-Smtp-Source: AGHT+IGRJhbG3Iz8YyLsc6/0RWtRhZhYbcSZVTwigVtxhi/CGcrJEwq+4Kef8lO3NDoSjpzlANfJNQ== X-Received: by 2002:a05:6870:5312:b0:286:f24f:c232 with SMTP id 586e51a60fabf-29610696786mr2665053fac.42.1731598088623; Thu, 14 Nov 2024 07:28:08 -0800 (PST) Received: from localhost.localdomain ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5eea026eb41sm368250eaf.39.2024.11.14.07.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 07:28:08 -0800 (PST) From: Jens Axboe <axboe@kernel.dk> To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Cc: hannes@cmpxchg.org, clm@meta.com, linux-kernel@vger.kernel.org, willy@infradead.org, kirill@shutemov.name, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, bfoster@redhat.com, Jens Axboe <axboe@kernel.dk> Subject: [PATCH 05/17] mm/filemap: use page_cache_sync_ra() to kick off read-ahead Date: Thu, 14 Nov 2024 08:25:09 -0700 Message-ID: <20241114152743.2381672-7-axboe@kernel.dk> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241114152743.2381672-2-axboe@kernel.dk> References: <20241114152743.2381672-2-axboe@kernel.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam10 X-Stat-Signature: iuznfdqhcf8h9qbk1gz4aaeam8th8te9 X-Rspamd-Queue-Id: 6AA7580010 X-Rspam-User: X-HE-Tag: 1731598006-673982 X-HE-Meta: U2FsdGVkX1/ZwXvJEbN32GeqiQkwiFYeU0yWdwgkvULAP6u9v1JB6rYKL6ghyHztATNtoYgB3Jqridp5bb42fJnyLkwkUCPVgO1jTANMdBuM02WUPrEaQ7KvjkrwFAUQZf4HiAESNJEFjsISgPBg/ICQKSIKdKPOYvxjQodrpwnN4c0t6kMmRLZahj+39HtX1toEhJOANtJwbpSakGIzXQPC6F243LWtYOErkYbyTS4hb9gIzTq3ShtcT1G6PqbokDTDeMXzTLt9cRYnl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2gN/rWet6lvQ5P+ysanWsnPuCsUraD4TInSJFaWC2gZOp21QjTqyO+9G/ZfZ5mYuHK8y5vT0o3qTwAm+WixpjeycaxoiYUmFgVrCFWggTf9cW+o002YBqedt3CacxXtSxHQ== 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Uncached buffered IO
|
expand
|
diff --git a/mm/filemap.c b/mm/filemap.c index 91974308e9bf..02d9cb585195 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2528,7 +2528,6 @@ static int filemap_get_pages(struct kiocb *iocb, size_t count, { struct file *filp = iocb->ki_filp; struct address_space *mapping = filp->f_mapping; - struct file_ra_state *ra = &filp->f_ra; pgoff_t index = iocb->ki_pos >> PAGE_SHIFT; pgoff_t last_index; struct folio *folio; @@ -2543,12 +2542,13 @@ static int filemap_get_pages(struct kiocb *iocb, size_t count, filemap_get_read_batch(mapping, index, last_index - 1, fbatch); if (!folio_batch_count(fbatch)) { + DEFINE_READAHEAD(ractl, filp, &filp->f_ra, mapping, index); + if (iocb->ki_flags & IOCB_NOIO) return -EAGAIN; if (iocb->ki_flags & IOCB_NOWAIT) flags = memalloc_noio_save(); - page_cache_sync_readahead(mapping, ra, filp, index, - last_index - index); + page_cache_sync_ra(&ractl, last_index - index); if (iocb->ki_flags & IOCB_NOWAIT) memalloc_noio_restore(flags); filemap_get_read_batch(mapping, index, last_index - 1, fbatch);
Rather than use the page_cache_sync_readahead() helper, define our own ractl and use page_cache_sync_ra() directly. In preparation for needing to modify ractl inside filemap_get_pages(). No functional changes in this patch. Signed-off-by: Jens Axboe <axboe@kernel.dk> --- mm/filemap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)