From patchwork Wed Jan 10 09:21:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13515845 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 42C37C3DA6E for ; Wed, 10 Jan 2024 09:21:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 46ECD6B0078; Wed, 10 Jan 2024 04:21:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3FA206B0092; Wed, 10 Jan 2024 04:21:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 162656B0093; Wed, 10 Jan 2024 04:21:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0431B6B0078 for ; Wed, 10 Jan 2024 04:21:40 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id D38661C14EF for ; Wed, 10 Jan 2024 09:21:39 +0000 (UTC) X-FDA: 81662858718.08.C7F16DA Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf27.hostedemail.com (Postfix) with ESMTP id 3E1B640006 for ; Wed, 10 Jan 2024 09:21:37 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Dg3kbq00; dmarc=none; spf=none (imf27.hostedemail.com: domain of BATV+17e9c08914743a4dbb9f+7444+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+17e9c08914743a4dbb9f+7444+infradead.org+hch@bombadil.srs.infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704878497; 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=SRlTQ4JibYJcOmgh50kWG725LphAqsA74nKJKgMAVp4=; b=U7K3xe800zlYlTNIx6+nGjh/NSgD/yB78Fi1I6lr3P/Ck/9wnhc/i1g9EaLuqQWl3en6A7 EP/pk6EnKoQvt71rX8nj/zOsel0SBVc1K8qjmMnHPDCcmkiQc4z/LMtQq0Rn6a7w8cc49W iDuBWp86kgL9bzD9x2ZNCLJBSiu3iN4= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Dg3kbq00; dmarc=none; spf=none (imf27.hostedemail.com: domain of BATV+17e9c08914743a4dbb9f+7444+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+17e9c08914743a4dbb9f+7444+infradead.org+hch@bombadil.srs.infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704878497; a=rsa-sha256; cv=none; b=p0UeUGRYrgZRIfoIAz5yzN7THhMkDqYplYJE4D9lbrwX5jf831aXRwUj0g8kUBxn9Qq1AP NC8ekaYy8OON6CYDbVu1eCTKiGpiMKcryC8/JHiBJJqAefICJaNfmGebKlproQ5hOR7LRE YDtsyoaXvExKxkwfw9P9GKvIQeepWXM= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=SRlTQ4JibYJcOmgh50kWG725LphAqsA74nKJKgMAVp4=; b=Dg3kbq00hAKG9Jac9pBCT8H0hY gQ8Pe7mzKNIEig0gdVS8L1YQm0lhILIpgErWpRQQhhUxLv9H0RVqQ3mwJIZgCK71qmej5Pzo80Gdc esoiR5D75fIZEZkE2YGIQ0nRjdBJgj5NgoZ0u6hyM5l308ERxwn5zQS37wJOuDp3WVhw9DmbPux0P jbkJFK7k3ROEFnFSjfok+rePV67Oo3t8DURPYH89imUH1WfUTjQEQmy1GSAcXWYC8OlDc8YzNDXUE PvxJ1Yxm5WtS8mPmLMaHV4I181FWwxPbMxc4CbckfiLDECitlWA61LzaC24kAJ/8WbYHany1t520v wVR5xXoQ==; Received: from [2001:4bb8:191:2f6b:27f:45ef:e74a:3466] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rNUly-00AsAw-0n; Wed, 10 Jan 2024 09:21:18 +0000 From: Christoph Hellwig To: Matthew Wilcox , Hugh Dickins , Chandan Babu R Cc: "Darrick J . Wong" , Andrew Morton , David Howells , Jarkko Sakkinen , Dave Hansen , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Christian Koenig , Huang Rui , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, x86@kernel.org, linux-sgx@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, keyrings@vger.kernel.org Subject: [PATCH 2/2] xfs: disable large folio support in xfile_create Date: Wed, 10 Jan 2024 10:21:09 +0100 Message-Id: <20240110092109.1950011-3-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240110092109.1950011-1-hch@lst.de> References: <20240110092109.1950011-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 3E1B640006 X-Stat-Signature: whz1c57h5hnw8otff55x4mkqj86ciij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oVpCGwJqQr8NXCqhVcgBwPMtAe3S00R9LOyvPBsslFDr4T0fKIRKvhqSVdfi8ScoiqjynHc9p4SNjtr/4hLAo7qQuf/jbvJpOXeVRSpz911Tiq0q0usC3/vNxUsTubAEsvNujq1D8kGWaTtg9AEqrR1yGgV/H+UgOfzMGYUml/bifbJU2rPxGB2+/QTn3eyNqw/UVflrJI5e6z+K+gE4gAVgIxIos306Pzh/BsT07KH9U9YGCH1ijnr/h4ziUlSqCCNdRqu9zQZnBRsdym6JA7Z/Cd7zoAFtnwH7ijvFFRueUl3mrMAX1/IW5cg8qJhkA3Pz5sB16TGTJ8pnQzUtR5Py7VM5IZ/OIkMfZ5nR2MwfCtZb1KAsdE9vNjXXi0MkJydNNQ5mmSFx7yErDZofZDecb2agjfm619an2usNqH7xvAza6kGmHNrE4QTj9w//JcZQjtqKFE/7qoxwtIFo4= 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: The xfarray code will crash if large folios are force enabled using: echo force > /sys/kernel/mm/transparent_hugepage/shmem_enabled Fixing this will require a bit of an API change, and prefeably sorting out the hwpoison story for pages vs folio and where it is placed in the shmem API. For now use this one liner to disable large folios. Reported-by: Darrick J. Wong Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- fs/xfs/scrub/xfile.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/xfs/scrub/xfile.c b/fs/xfs/scrub/xfile.c index 090c3ead43fdf1..1a8d1bedd0b0dc 100644 --- a/fs/xfs/scrub/xfile.c +++ b/fs/xfs/scrub/xfile.c @@ -94,6 +94,11 @@ xfile_create( lockdep_set_class(&inode->i_rwsem, &xfile_i_mutex_key); + /* + * We're not quite ready for large folios yet. + */ + mapping_clear_large_folios(inode->i_mapping); + trace_xfile_create(xf); *xfilep = xf;