From patchwork Fri Dec 13 15:55:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 13907400 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 A280BE7717D for ; Fri, 13 Dec 2024 15:56:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CA7696B0089; Fri, 13 Dec 2024 10:56:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C2CCD6B008A; Fri, 13 Dec 2024 10:56:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A7E9A6B008C; Fri, 13 Dec 2024 10:56:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 851F16B0089 for ; Fri, 13 Dec 2024 10:56:11 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0C1C480DF6 for ; Fri, 13 Dec 2024 15:56:11 +0000 (UTC) X-FDA: 82890387090.14.93B19AD Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) by imf25.hostedemail.com (Postfix) with ESMTP id 97FBEA001C for ; Fri, 13 Dec 2024 15:55:50 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=tATpthmC; spf=pass (imf25.hostedemail.com: domain of axboe@kernel.dk designates 209.85.166.176 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734105345; a=rsa-sha256; cv=none; b=4AQ4HZqUFh2CAajsFQV3HK2A0bInSFAa0cAkNI6T1O57is8BR1TdMHKSxJyr5PhNfKJe96 me2JwvzMFf2e6QJI8jl4y4rBIecxVfwpXG9Ee1f30IKO1iJU+gXkNAUAKCChG4JfTQyRIQ h3RM6Chg34AYAOZMl1jz3eQAA9LBDNA= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=tATpthmC; spf=pass (imf25.hostedemail.com: domain of axboe@kernel.dk designates 209.85.166.176 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=1734105344; 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=BpcNvbMq6OW5fN6dnGRgZf80nNArt3mFYuYvhVaSlK4=; b=v4zNRbeaSdmCtTFoGi1RGsI0VgR56nh458TgOOSrOq8kX/uQlhfSmjaXMro59y0Pos9+Iq 4R0xgIJIOn+CwnqiuTNnIz3BYe1bVD2WZvzWqhBqzHWkFxVVHg08xeid1uPndOKyfFoqIi bGBdh+iz4QMnfBqfiQD46NwOaiNL1bk= Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-3a8165cfae8so6325355ab.0 for ; Fri, 13 Dec 2024 07:56:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1734105367; x=1734710167; 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=BpcNvbMq6OW5fN6dnGRgZf80nNArt3mFYuYvhVaSlK4=; b=tATpthmCXFnzm25wCPtZXf+CvDYUCQYY6lzvV68kqxmDDkOQX3cOUxnHUPn3s2RnE1 IUNH8CSv1NnyV0MQa3RWFK9QjgIh6D/QODFcq4q4CVCkmi/y7dQJG9CyDYrYQmERwn4k Xw5A9/a/VpdqDZnz4L53CRD1+ltpL/BWDSwb7zCQlXYg0YEDOFydu8cTU6au67AACoZV hBDwMIHHr1DR9sPgwE9JNummNeo7h9KN6jvvg5FiYZ4eyTG7bOjJKDC43fBj9qL+/ze0 CdEQVclBl4gm7+BD8tc7/NDD4symjhxnLAzf7o5pO6GZWj4IwNus2VmbD8vu8Ell0Hfa j95Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734105367; x=1734710167; 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=BpcNvbMq6OW5fN6dnGRgZf80nNArt3mFYuYvhVaSlK4=; b=G6tODy3qzmF8a/RImgDKsgCGI9QziXTb5oL90RdHjhutRJxaFnVl+Lrhr63NH2woup unzae4X0mOfznfLSm7fmZRKWCXGSfBPqsMv2YH6Mv1mMBZlpwSd/cNVyHPQl6RZ1lIXr Li+J5VK4xGmINgHIxXTgUkmVxcsjKqyBcIlTqRAPXOuWsLR70w0H7nOZA0hwCO7ed44V hSHuQrXH8snkjeHRTqMhgtVQ+7oDUVVfg7/25bkg8pUiIw0+BXCdZ5IbStCMuDrCRRx4 Wzqng+GT1W8wAttomhrY88bsH6xY0BdWtjRBNa6p+Mvg9Y4neXLpiQTN5Ek/2zYb/DMt PPlA== X-Gm-Message-State: AOJu0YyirHXdRuS//3/DddllxUCFOK7X+VzL0gvq/1HMhsHfGFRDIO7A /uRCT1i4zVAC04g0oQG99njbfeQpy66Q2sqS+dFSfMuXVoJ1vzo2w8hXEFnlVifqTjlQD7EnCUA 4 X-Gm-Gg: ASbGncsGXmE5RHg0YU8vb6KJTf1ZrsCjfKlFVPsB8B46xoCCe7zShSlfpt8jNlsVjWA qZrKwMljQWJVKcObBTJC7wtn7lNjo0tcDxKbP3z1CADU5dzKJoRxBpY9tKeefjDDfFjkURTzS/1 IQ/pODK9oTJ6gtmCDjgBpgzgWQylhBjrN2mOn7iMiJFFqpR8l6uwnqKrrBR9zfJ0rwwwYQq2tI3 VeEno2GVu5s+X0pwGIwHLnNxhA79GfqH4RlUeEMxvzPNmOVwtxsxEE3K0R+ X-Google-Smtp-Source: AGHT+IFWkhf2olmYWP9+u8WH9KgVfslThGYwEFiU2/KIyOObE8orPa/AadsJR4yt5f2xYXvlvdRoMg== X-Received: by 2002:a05:6e02:1a07:b0:3a7:e4c7:ad18 with SMTP id e9e14a558f8ab-3aff80107a2mr31899055ab.18.1734105367708; Fri, 13 Dec 2024 07:56:07 -0800 (PST) Received: from localhost.localdomain ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-3a9ca03ae11sm35258405ab.41.2024.12.13.07.56.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 07:56:07 -0800 (PST) From: Jens Axboe 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, bfoster@redhat.com, Jens Axboe Subject: [PATCH 03/11] mm/readahead: add folio allocation helper Date: Fri, 13 Dec 2024 08:55:17 -0700 Message-ID: <20241213155557.105419-4-axboe@kernel.dk> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241213155557.105419-1-axboe@kernel.dk> References: <20241213155557.105419-1-axboe@kernel.dk> MIME-Version: 1.0 X-Rspamd-Queue-Id: 97FBEA001C X-Stat-Signature: p9hxiea9ukerzpfer39gpp4s1emifiou X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1734105350-11503 X-HE-Meta: U2FsdGVkX1+eIw4A30uC0U4KLBhcxGSYpcoesiWAufGuTrn+wzQfWoY/DvXCDsZ5TmzryDxwxzFGMcnEIL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pXY2Lkg5WLONrKzG8RYcX1MD0vm/BfzKXkAbzb3X3ZZsiEkqVMKdd+FhmZCUP74L1is7CnSKAtQLZocDh7HYzYUdsJuECKzjb1iPju9LrPDCVxjvWvm/qAFrdHYgtWXUaoEPHySuW6hbPR0LQLIVQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000139, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Just a wrapper around filemap_alloc_folio() for now, but add it in preparation for modifying the folio based on the 'ractl' being passed in. No functional changes in this patch. Signed-off-by: Jens Axboe Reviewed-by: Kirill A. Shutemov --- mm/readahead.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/mm/readahead.c b/mm/readahead.c index ea650b8b02fb..8a62ad4106ff 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -188,6 +188,12 @@ static void read_pages(struct readahead_control *rac) BUG_ON(readahead_count(rac)); } +static struct folio *ractl_alloc_folio(struct readahead_control *ractl, + gfp_t gfp_mask, unsigned int order) +{ + return filemap_alloc_folio(gfp_mask, order); +} + /** * page_cache_ra_unbounded - Start unchecked readahead. * @ractl: Readahead control. @@ -265,8 +271,8 @@ void page_cache_ra_unbounded(struct readahead_control *ractl, continue; } - folio = filemap_alloc_folio(gfp_mask, - mapping_min_folio_order(mapping)); + folio = ractl_alloc_folio(ractl, gfp_mask, + mapping_min_folio_order(mapping)); if (!folio) break; @@ -436,7 +442,7 @@ static inline int ra_alloc_folio(struct readahead_control *ractl, pgoff_t index, pgoff_t mark, unsigned int order, gfp_t gfp) { int err; - struct folio *folio = filemap_alloc_folio(gfp, order); + struct folio *folio = ractl_alloc_folio(ractl, gfp, order); if (!folio) return -ENOMEM; @@ -750,7 +756,7 @@ void readahead_expand(struct readahead_control *ractl, if (folio && !xa_is_value(folio)) return; /* Folio apparently present */ - folio = filemap_alloc_folio(gfp_mask, min_order); + folio = ractl_alloc_folio(ractl, gfp_mask, min_order); if (!folio) return; @@ -779,7 +785,7 @@ void readahead_expand(struct readahead_control *ractl, if (folio && !xa_is_value(folio)) return; /* Folio apparently present */ - folio = filemap_alloc_folio(gfp_mask, min_order); + folio = ractl_alloc_folio(ractl, gfp_mask, min_order); if (!folio) return;