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 9EEB3C4707B for ; Wed, 10 Jan 2024 15:28:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3185D8D0003; Wed, 10 Jan 2024 10:28:38 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C82B8D0001; Wed, 10 Jan 2024 10:28:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1DEAD8D0003; Wed, 10 Jan 2024 10:28:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 0E1A58D0001 for ; Wed, 10 Jan 2024 10:28:38 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C90FC160399 for ; Wed, 10 Jan 2024 15:28:35 +0000 (UTC) X-FDA: 81663783390.30.1FEAFFD Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by imf23.hostedemail.com (Postfix) with ESMTP id 9B14914001E for ; Wed, 10 Jan 2024 15:28:33 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="TbOsPyz/"; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf23.hostedemail.com: domain of joonas.lahtinen@linux.intel.com has no SPF policy when checking 192.55.52.93) smtp.mailfrom=joonas.lahtinen@linux.intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704900513; 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=V8oLqGqVeZ6IDUGNXSD0aA0Xl8mCLJ/YRMS31da8jUg=; b=l+vYMDNrqLqDAA03PbGVDIKObuVWLEF0ysK1KE0ZHuyjctlm1b/2snkxDWL8ft5/7nCZiZ XTsZNcz6U6uM5t+vAyx/wxc+/RbTtSN8Q5616cfWsKEo3VFzfTPYVGboEbgoGxP2iW9RFt JzgnDHbCoRbbVo5tUfE62lTfP2JGBIQ= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="TbOsPyz/"; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf23.hostedemail.com: domain of joonas.lahtinen@linux.intel.com has no SPF policy when checking 192.55.52.93) smtp.mailfrom=joonas.lahtinen@linux.intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704900513; a=rsa-sha256; cv=none; b=zynPWuasjT/iA/pCgI20n/vEpAvg02MiWNvZo+Q9OR3IK9R/vgj3osdx1JqTNMQ+VKGB8p k/dvzPnQ9ABId9C57deCAFEEcDeW+qGiXkZ9oZ4/BBJwqfU5mlsGHD+Aqsqgoc8C/WPd1K 7bkDQLgWN04oP/NMmIFER+x1QVLBrkA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704900513; x=1736436513; h=mime-version:content-transfer-encoding:in-reply-to: references:from:to:cc:subject:message-id:date; bh=fV7NAoQ0qHc6gn38m7vJBQuKu07R0duL29KMcubUULk=; b=TbOsPyz/geJaiIACnT+Ojt4t6DliSdw3s0rxiRqwMf9A2SjFC9VKF1ic tq40mmc57hA5p4oW/a2i+2OR3G8XV5r2RsR9KA8tDW8AqW1UkGh783byK Y3mW6JF63Vs2N6ZrGgwr2Xba1Otlsvm8ybgRBEbaEOmt7fpbHDf4lreaF gUupeJFcpEP+l8GW4k2rwFHpw1o7GbWcude0ZQn/Z3A+n16mOlXs0V54L ei0LE78KNd5krslYM6IpTePNAf1jzu1WAq1HSr7VM+/x8KQvvi9FgIllG TQFj3tvFubBakH7xKV0EN03vDAY4kV/oL3zk4dyeqeJhbYzvpDCOOd8Dy w==; X-IronPort-AV: E=McAfee;i="6600,9927,10948"; a="395704782" X-IronPort-AV: E=Sophos;i="6.04,184,1695711600"; d="scan'208";a="395704782" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2024 07:28:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,184,1695711600"; d="scan'208";a="30639512" Received: from nselinsk-mobl.ger.corp.intel.com (HELO localhost) ([10.246.34.242]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2024 07:28:26 -0800 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <170490002493.164187.5401160425746227111@jlahtine-mobl.ger.corp.intel.com> References: <20240110092109.1950011-1-hch@lst.de> <170490002493.164187.5401160425746227111@jlahtine-mobl.ger.corp.intel.com> From: Joonas Lahtinen To: Christoph Hellwig , Matthew Wilcox Cc: Hugh Dickins , Chandan Babu R , "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 , 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: Re: disable large folios for shmem file used by xfs xfile Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Message-ID: <170490050245.164862.16261803493864298341@jlahtine-mobl.ger.corp.intel.com> User-Agent: alot/0.8.1 Date: Wed, 10 Jan 2024 17:28:22 +0200 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 9B14914001E X-Stat-Signature: 3ai6w47o1ffhgiqi5arwsecfsogmtxcp X-Rspam-User: X-HE-Tag: 1704900513-828301 X-HE-Meta: U2FsdGVkX19/bqKPWZP9gDejX0vppQy0slRTCDDkp8/a3MQoNEzyjzGpsQRDuLMUQbBD4uWbBx6+16FtqqG6WD7/fYGqGvqn6J51J5Q7GwM+0g3H3FNM+tEerLMgXMQV/O6wU3MhI1W07odbSAphc9ch/yniD8TBsmI38375EBgyamVexOSNk3zXiu8Zqo7zp1VGPNBS9Jcas+KtPS3pYD9v1PVP8TIbBajcFK8Venj5BIh0swTJ7l063ouVUYmghEPcJSr9ZbKmCMNwgdOhKQIUHy/FPmN7tIPcTKaOJMsEtCi4OG9V3ARMdbz2Y+nJKa2SVjFTJmzReOkugTkNnLMIWqCbjaWiAmla8/61xmExGlkXCU5dTEt/Tq8rMYmVgU32jGW/wyPfelag5JHfk1ssoP8fRE5xFUcbj9SywQVEsiLH1+MqRsH+Z25bSEU+zCcgig/bj0LpUU2u93RAoVfCMygyw5GyplqKyzj1jMO4qnQyJV3mz9ro7uNxt7Tn2csbHW4oJOop0JtlarGcEYY6k9TfgX9W5+vVGQEyYjASpP9KXITkxcbhyjiz4B0osv3iRK0fkKdymPUXlauxr2ytIYjC9oDJQil/k+u6WjBEQsV9LsAtsWQrIP7uKemIZMBNkOKr7ki9qQEOAnnNss3RxDD4jjdkdxhGrAef8aKFzb7FDCsSR/3/nrZnoJ/2rqgrYKsruqSuyyhWsf2WlU35p/3iUaeYNz2NUARLuNiELVn9vn3kuxazNzLGdvYnlLnaux3mUPZD2pgdpI9K9RieXb67KbKb9slhWRVQq8blvifikNfagx9BDaXvJ3AWVOd8JLoWpFxeuvvGRhdHkUBllAM80jnA48hZlGh+KbcQXoLNvUZP424Xo4PV9esYjjG2x1BuJd5p4oji/g+6KyY0/RjHaE2qQTcL4hjuB4Z8kGYxAC8m+KIBgCd2MGHnVDVKv6xeCNiMixoqk6n RF2arK1w uOkBTLo6cA/kXno8Of22IxX7ZvK9MAUGbrYUwJMxKrjG4zUU2Ak98GM/ga5NMJ3HwAaIUf2ROG+xHDQfnb513ZeJVGlbHeMwLTaegOQ9jNLq3ZzCLov0NgH2c7XDMz6Ma1uBiKUFfsvEmVCX1Gxk/MGJSaljTTdADFM2sgdrhsakWoJw= 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: Quoting Joonas Lahtinen (2024-01-10 17:20:24) > Quoting Matthew Wilcox (2024-01-10 14:37:18) > > On Wed, Jan 10, 2024 at 10:21:07AM +0100, Christoph Hellwig wrote: > > > Hi all, > > >=20 > > > Darrick reported that the fairly new XFS xfile code blows up when for= ce > > > enabling large folio for shmem. This series fixes this quickly by di= sabling > > > large folios for this particular shmem file for now until it can be f= ixed > > > properly, which will be a lot more invasive. > > >=20 > > > I've added most of you to the CC list as I suspect most other users of > > > shmem_file_setup and friends will have similar issues. > >=20 > > The graphics users _want_ to use large folios. I'm pretty sure they've > > been tested with this. >=20 > Correct. We've done quite a bit of optimization in userspace and > enabling in kernel to take advantage of page sizes of 2M and beyond. >=20 > However we specifically pass "huge=3Dwithin_size" to vfs_kern_mount when > creating a private mount of tmpfs for the purpose of i915 created > allocations. >=20 > Older hardware also had some address hashing bugs where 2M aligned > memory caused a lot of collisions in TLB so we don't enable it always. >=20 > You can see drivers/gpu/drm/i915/gem/i915_gemfs.c function > i915_gemfs_init for details and references. >=20 > So in short, functionality wise we should be fine either default > for using 2M pages or not. If they become the default, we'd probably > want an option that would still be able to prevent them for performance > regression reasons on older hardware. To maybe write out my concern better: Is there plan to enable huge pages by default in shmem? If not I guess we should be pretty good with the way current code is, force enabling them just might bring out some performance, so we might want to add a warning for that. If there is, then we'll probably want to in sync with those default changes apply a similar call to block them on older HW. Regards, Joonas >=20 > Regards, Joonas >=20 > > It's just XFS that didn't know about this > > feature of shmem.