From mboxrd@z Thu Jan 1 00:00:00 1970 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 A57D0C10F16 for ; Fri, 3 May 2024 14:32:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D44F36B008C; Fri, 3 May 2024 10:32:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CF4CC6B0093; Fri, 3 May 2024 10:32:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BBCC16B0095; Fri, 3 May 2024 10:32:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 9DECA6B008C for ; Fri, 3 May 2024 10:32:50 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 617F7410E0 for ; Fri, 3 May 2024 14:32:43 +0000 (UTC) X-FDA: 82077325806.26.CA5EEE5 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by imf30.hostedemail.com (Postfix) with ESMTP id E4C5D80014 for ; Fri, 3 May 2024 14:32:39 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Z5HSLYLM; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=XJtk3Jgv; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Z5HSLYLM; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=XJtk3Jgv; spf=pass (imf30.hostedemail.com: domain of hare@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=hare@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714746760; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BHlVZ1sU7qEW1KllZBA7cvducPvlkRE8JqumePYarAA=; b=LaFWfDGkRtLUnbgZ5SRclWjgPgiZ7RQkKbFLSDAUxDbZNB3Gc0JYlKqdwKjF5VsVC2Yyto TfgOWzHeiYPuzz5RAGNOdfJFe+DWnJi++3of9v0g28ah9hFxkv89ftILU+StUTSJxFNPpq Epxop7OOuiXrWDphBPmlfb5SL3/S2r8= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Z5HSLYLM; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=XJtk3Jgv; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Z5HSLYLM; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=XJtk3Jgv; spf=pass (imf30.hostedemail.com: domain of hare@suse.de designates 195.135.223.130 as permitted sender) smtp.mailfrom=hare@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714746760; a=rsa-sha256; cv=none; b=dP+7BLcCQLlwzce32OwlV8J1ZyjSzTfEBWv//oeFR8xVBzuDBFWG8tUf5i9dPmRjHEBlLw b83wwQiBNeUAUzpcJ75K/j4bWf7IBuzi8f0mHfpGQUoXkZPXtd17oKvPnlhkmi5H1mAOiU BHaWcjz2kmZDcANiRJSxWzh+T/SYXpo= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 2B87F33B31; Fri, 3 May 2024 14:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1714746757; h=from:from:reply-to: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=BHlVZ1sU7qEW1KllZBA7cvducPvlkRE8JqumePYarAA=; b=Z5HSLYLMaU1EOzzvffEscP1GFJBAC0FhsHKDu09yMdObMgiy0PtIYbG/7HvQk8oG1j0hDt vjEyYPkTx/56uXOcO8nbUhzh+0DbpnI9J0h9EVrOF7MXmnpYUiwmdNXiAwYRYBErY8SdiQ yBoXQzTmeTuSXJ+DGvLAqViFUCcQHYM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1714746757; h=from:from:reply-to: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=BHlVZ1sU7qEW1KllZBA7cvducPvlkRE8JqumePYarAA=; b=XJtk3JgvXliqyQz5Yn7QDlmZKLzFlJj2dbgVb3Gr6LZwCd5lVfq20Zqn+EGSGPYlXWwgfc QKVUqk8dnQQAIMAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1714746757; h=from:from:reply-to: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=BHlVZ1sU7qEW1KllZBA7cvducPvlkRE8JqumePYarAA=; b=Z5HSLYLMaU1EOzzvffEscP1GFJBAC0FhsHKDu09yMdObMgiy0PtIYbG/7HvQk8oG1j0hDt vjEyYPkTx/56uXOcO8nbUhzh+0DbpnI9J0h9EVrOF7MXmnpYUiwmdNXiAwYRYBErY8SdiQ yBoXQzTmeTuSXJ+DGvLAqViFUCcQHYM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1714746757; h=from:from:reply-to: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=BHlVZ1sU7qEW1KllZBA7cvducPvlkRE8JqumePYarAA=; b=XJtk3JgvXliqyQz5Yn7QDlmZKLzFlJj2dbgVb3Gr6LZwCd5lVfq20Zqn+EGSGPYlXWwgfc QKVUqk8dnQQAIMAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8EE5213991; Fri, 3 May 2024 14:32:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 2+PwIIT1NGaDGgAAD6G6ig (envelope-from ); Fri, 03 May 2024 14:32:36 +0000 Message-ID: <51642048-ddb1-4f21-96ad-c6970f9c71dc@suse.de> Date: Fri, 3 May 2024 16:32:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 04/11] readahead: allocate folios with mapping_min_order in readahead To: Luis Chamberlain , akpm@linux-foundation.org, willy@infradead.org, djwong@kernel.org, brauner@kernel.org, david@fromorbit.com, chandan.babu@oracle.com Cc: ritesh.list@gmail.com, john.g.garry@oracle.com, ziy@nvidia.com, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, gost.dev@samsung.com, p.raghav@samsung.com, kernel@pankajraghav.com References: <20240503095353.3798063-1-mcgrof@kernel.org> <20240503095353.3798063-5-mcgrof@kernel.org> Content-Language: en-US From: Hannes Reinecke In-Reply-To: <20240503095353.3798063-5-mcgrof@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Action: no action X-Stat-Signature: wwrncy4draazdajxqw1d6g11wntdb5gx X-Rspamd-Queue-Id: E4C5D80014 X-Rspamd-Server: rspam10 X-Rspam-User: X-HE-Tag: 1714746759-775755 X-HE-Meta: U2FsdGVkX1/wsiqg9Wl0f/MgzZdR2ygySADPBv9CPiZWzCZnbgFULFFyupxRrjywste3NXo2Vw8SHQAkuqmGsl3vDM6RzP8c2zous7QW5wITIuAYUpjZoteI61BW6vM9bBQ/X4IYQv2l0eT99MoLA8xkLin98bu7ooLI+irF7gj6yyny2MTDyJOPdaGyu0dCS7Fp7wFRMqCBu0dfFJMQMgSkVPzzUKE2q6FSautxKeZFF35zDe0jXBGUVsjCKX4bon4ZL5zA25Z9aZun4dmeA1pDMBeJWwimAOocR8YBYOUlY3TBx34fDSyrivEy/2OZ+7EhBIM1rwYEwbpeJnAgduLeRlutWsMWAEPeF+F4/XQyEZyCbhwUZdJxg9YGn5Olw0DvpoQMlKXpgh09hVNmtV/tMjIMimV+upLWT7CJXdMyWLvvN1mMVbUJzXjujhACdunynTYhZyY+igWvChuhfV59e2I7qdpwJvOsfOefyzViXmK6cIBS9BhJbjxB+CUC0oezNRWeMTvCmTU5VGcK85r03BGIQ3iWPX3hJEPQnuhoBe8UYSLBc+KbkETRw6mMe+4aX8RFwKu0enOzINWId+1M/VOrq8PFGNz1sbZ07NOQ3bQ0HFUGxIjWIctufam8L3zujfYzL0AxLslUn634Pf63P07ftfgmr11cqin6Im9SShWi4WwXMYKmp1src6MvfKXkpHsW4yPxenPIhlqLNg79nI+GC9wAT76/1jNmSPJ2PSFs9THPtl+V40AZq7RrrZYHdyaDn7V8Z8O/A1Wx3gdBQZhJ/Fbl8tV+u5fgFXM1sAK7nxVSUVdol5nJvdHpchVtMPKHbwvCVKf0nUR4D6Id7eoyglZehTTnbwNZgNV1HV54KaAN1qywid025hS9YbKJtDAZRLZd9Z/7E3+1d7139C0tva5NamBDKRvHAzLmL1bqikJZS2CarkHnoBLqU39mh0baYe0xcx18qEn 3uzy7oE+ SyTNzu/nzIVVlBjZVLue8BYqJTsOzrPjgHNnGuf7qRCFr7fL5Np5XsBN1XtFUHFejekPxj/VWsbxl2yiKl5mJplGefmowPTujP09+hGHxelTkhl7w5HMOc7+df6uIedSsDqfpi/EVi6JMSZnMX6MKBGttYwsfMnRqjenfurptgBSn0fWoulGh2HKTpHvZQ0WWM3vThbRy57tnV+Q/QJzjOUwkwUIkEmbgOLh7/ktR6THlC1f9vYjqXE0cMniGsg5d/s+fa1Ys/xfHRbRsfvCJe9T6G7XStVR15TXZ9VTuGWZSie004yOQilJqAgR9ZpdOIux0Z1M+vosHyaCDFylY8S2Q+cqIdonygH61Kl0LmQ+qaPflUwHzI6PmDYOHmiTc0AxUo3Qm3PrJIPZXOqdYO/r9eerg0PZItBAY3WtUBC/mBN2E5BNZ+48t/o+43mYqNKog 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: List-Subscribe: List-Unsubscribe: On 5/3/24 11:53, Luis Chamberlain wrote: > From: Pankaj Raghav > > page_cache_ra_unbounded() was allocating single pages (0 order folios) > if there was no folio found in an index. Allocate mapping_min_order folios > as we need to guarantee the minimum order if it is set. > When read_pages() is triggered and if a page is already present, check > for truncation and move the ractl->_index by mapping_min_nrpages if that > folio was truncated. This is done to ensure we keep the alignment > requirement while adding a folio to the page cache. > > page_cache_ra_order() tries to allocate folio to the page cache with a > higher order if the index aligns with that order. Modify it so that the > order does not go below the mapping_min_order requirement of the page > cache. This function will do the right thing even if the new_order passed > is less than the mapping_min_order. > When adding new folios to the page cache we must also ensure the index > used is aligned to the mapping_min_order as the page cache requires the > index to be aligned to the order of the folio. > > readahead_expand() is called from readahead aops to extend the range of > the readahead so this function can assume ractl->_index to be aligned with > min_order. > > Signed-off-by: Pankaj Raghav > --- > mm/readahead.c | 85 +++++++++++++++++++++++++++++++++++++++++--------- > 1 file changed, 71 insertions(+), 14 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Ivo Totev, Andrew McDonald, Werner Knoblich