From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABC7139FFB for ; Mon, 15 Jul 2024 11:31:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721043103; cv=none; b=g10T2QP0MlxTkb8qrsaFCocO9AMuuyf7LFh9/vkFkAcVRb7TyB2er6M7KUXEUNKMncy0fjC22XQ+vQHzgwEk5XfsFBqOaiIEbo7ab5wqIpZMIQmZzjRD2iFZSwT0j6rVXid+m0hvjAFOPjw0ZLUrkddgwUfsv4tLm+rjONSXc10= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721043103; c=relaxed/simple; bh=CVE7/98NxVircNrRN8CkH7mKXDhlW81hVhqoisjdEeo=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=SyBrlbaQ2QtbJ9FWTY/g8ibLcqtattyXbYpu2Eg9O1DCWbZejwwou9b3e9njxveYsMMmhDqUrwmthBWChmlYURMwcnYTKAuj2VpoHXVDQboa5NvLWevzWpWhYxyLTlh31axpyz9OMh9+vKNyhvMnzoq8iWS03k6LjNX/WkNZoTg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AEn6DK+1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="AEn6DK+1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0EF9C32782; Mon, 15 Jul 2024 11:31:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1721043103; bh=CVE7/98NxVircNrRN8CkH7mKXDhlW81hVhqoisjdEeo=; h=Subject:To:Cc:From:Date:From; b=AEn6DK+1rAOqA9esqbQBE0KTqpFlJwIFWnsPFh8+2uQ+ptAC3gCkVbKIhOvrBUOxx 11SdDS2z7klPErRqTphH+EfLGQLr6pEF4kYPzYqg2cmWfjJAbrnAOTIK7vAs4I9B8i DHvcJCoMVpZhSJgezgaoXT1nt/oICGuBMzlZ58Qk= Subject: FAILED: patch "[PATCH] mm/readahead: limit page cache size in page_cache_ra_order()" failed to apply to 6.1-stable tree To: gshan@redhat.com,akpm@linux-foundation.org,david@redhat.com,ddutile@redhat.com,djwong@kernel.org,hughd@google.com,ryan.roberts@arm.com,stable@vger.kernel.org,torvalds@linux-foundation.org,william.kucharski@oracle.com,willy@infradead.org,zhenyzha@redhat.com Cc: From: Date: Mon, 15 Jul 2024 13:31:32 +0200 Message-ID: <2024071532-alabaster-overstate-3512@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y git checkout FETCH_HEAD git cherry-pick -x 1f789a45c3f1aa77531db21768fca70b66c0eeb1 # git commit -s git send-email --to '' --in-reply-to '2024071532-alabaster-overstate-3512@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^.. Possible dependencies: 1f789a45c3f1 ("mm/readahead: limit page cache size in page_cache_ra_order()") e03c16fb4af1 ("readahead: use ilog2 instead of a while loop in page_cache_ra_order()") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 1f789a45c3f1aa77531db21768fca70b66c0eeb1 Mon Sep 17 00:00:00 2001 From: Gavin Shan Date: Thu, 27 Jun 2024 10:39:50 +1000 Subject: [PATCH] mm/readahead: limit page cache size in page_cache_ra_order() In page_cache_ra_order(), the maximal order of the page cache to be allocated shouldn't be larger than MAX_PAGECACHE_ORDER. Otherwise, it's possible the large page cache can't be supported by xarray when the corresponding xarray entry is split. For example, HPAGE_PMD_ORDER is 13 on ARM64 when the base page size is 64KB. The PMD-sized page cache can't be supported by xarray. Link: https://lkml.kernel.org/r/20240627003953.1262512-3-gshan@redhat.com Fixes: 793917d997df ("mm/readahead: Add large folio readahead") Signed-off-by: Gavin Shan Acked-by: David Hildenbrand Cc: Darrick J. Wong Cc: Don Dutile Cc: Hugh Dickins Cc: Linus Torvalds Cc: Matthew Wilcox (Oracle) Cc: Ryan Roberts Cc: William Kucharski Cc: Zhenyu Zhang Cc: [5.18+] Signed-off-by: Andrew Morton diff --git a/mm/readahead.c b/mm/readahead.c index c1b23989d9ca..817b2a352d78 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -503,11 +503,11 @@ void page_cache_ra_order(struct readahead_control *ractl, limit = min(limit, index + ra->size - 1); - if (new_order < MAX_PAGECACHE_ORDER) { + if (new_order < MAX_PAGECACHE_ORDER) new_order += 2; - new_order = min_t(unsigned int, MAX_PAGECACHE_ORDER, new_order); - new_order = min_t(unsigned int, new_order, ilog2(ra->size)); - } + + new_order = min_t(unsigned int, MAX_PAGECACHE_ORDER, new_order); + new_order = min_t(unsigned int, new_order, ilog2(ra->size)); /* See comment in page_cache_ra_unbounded() */ nofs = memalloc_nofs_save();