From patchwork Thu May 5 23:43:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12840336 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 71D81C433EF for ; Thu, 5 May 2022 23:43:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7EB4F6B0071; Thu, 5 May 2022 19:43:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 799556B0073; Thu, 5 May 2022 19:43:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 662226B0074; Thu, 5 May 2022 19:43:39 -0400 (EDT) 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 52FC26B0071 for ; Thu, 5 May 2022 19:43:39 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 4DB0B2D19C for ; Thu, 5 May 2022 23:43:28 +0000 (UTC) X-FDA: 79433318496.12.C2306DE Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf06.hostedemail.com (Postfix) with ESMTP id 7F44618009F for ; Thu, 5 May 2022 23:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=qAb22uIhpCH8ILir3+ikE/8BOp9F07i0dHC7d945NL4=; b=LuMxZlQ+G6TwddhCM85yWQZFwB qfbmGMGs5MB7XX9WbXARI6fuUgg3zI0HmvhGSu3gUmkmvzPmehG9K2l3QgOZ8dU37Ue0BCsnVY0N5 NrnPEOdZyczOWqmECZz8PF2SOrtfM1tPpKCxZ6Q2IORN5NeqwVRksX/tElouL3Pk6uSIgdaHjeAQr aSfEzwT8Rl2IOEcu3anXUQVFeBN+pjWgkoZfW2UkY3+VvV5XHAJ8zUpf9WKmpNCgQ3ggtASo8GTkY AGJATSy8luhySo+HutKvjQ5kuUXXapgJ3iSBG88/gRBXC4jpUkft2+Osd6PE0WQ7hbOpnAv3Bu+0N PEmN24zw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nml7u-000RDh-7A; Thu, 05 May 2022 23:43:18 +0000 Date: Fri, 6 May 2022 00:43:18 +0100 From: Matthew Wilcox To: Linus Torvalds Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [GIT PULL] Two folio fixes for 5.18 Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Stat-Signature: um4741663buxoy9thrractfhizfo6deb Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=LuMxZlQ+; spf=none (imf06.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 7F44618009F X-HE-Tag: 1651794205-446135 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: Darrick and Brian have done amazing work debugging the race I created in the folio BIO iterator. The readahead problem was deterministic, so easy to fix. The following changes since commit a7391ad3572431a354c927cf8896e86e50d7d0bf: Merge tag 'iomm-fixes-v5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu (2022-05-04 11:04:52 -0700) are available in the Git repository at: git://git.infradead.org/users/willy/pagecache.git tags/folio-5.18f for you to fetch changes up to b9ff43dd27434dbd850b908e2e0e1f6e794efd9b: mm/readahead: Fix readahead with large folios (2022-05-05 00:47:29 -0400) ---------------------------------------------------------------- Two folio fixes for 5.18: - Fix a race when we were calling folio_next() in the BIO folio iter without holding a reference, meaning the folio could be split or freed, and we'd jump to the next page instead of the intended next folio. - Fix readahead creating single-page folios instead of the intended large folios when doing reads that are not a power of two in size. ---------------------------------------------------------------- Matthew Wilcox (Oracle) (2): block: Do not call folio_next() on an unreferenced folio mm/readahead: Fix readahead with large folios include/linux/bio.h | 5 ++++- mm/readahead.c | 15 +++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-)