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 50F13C4707C for ; Wed, 10 Jan 2024 15:35:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DF1D36B009F; Wed, 10 Jan 2024 10:35:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DA2C56B00A0; Wed, 10 Jan 2024 10:35:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C91A96B00A1; Wed, 10 Jan 2024 10:35:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B233D6B009F for ; Wed, 10 Jan 2024 10:35:01 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 7E47FA04B4 for ; Wed, 10 Jan 2024 15:35:01 +0000 (UTC) X-FDA: 81663799602.13.D0CEDB1 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf11.hostedemail.com (Postfix) with ESMTP id 459C44001C for ; Wed, 10 Jan 2024 15:34:59 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Fe04VqEj; dmarc=none; spf=none (imf11.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704900900; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=39NamAoxPWMrCZaJEOF8WH1zyLewDTeBBeunTxnTycY=; b=km12IfhssVWVKKm94gtDRc6j2fOyJUdBrhvlaIWkswrmShX/K6yQck3QineB4/N5f21FJJ cjUk7Umj3vATAOVDQCbprZfu1UE0P245nlKNjLgEENrzi8C4BtHTfxGYMTQwB+JcAcS/86 BWfdeUhczmC+ruu5deUbksMrJSxbPrE= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Fe04VqEj; dmarc=none; spf=none (imf11.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704900900; a=rsa-sha256; cv=none; b=5jxJz2Zi43WvqWb7C11oYTCqTIqcW3BrviRiUNQobGclW6lkrUBhg1P073U+29detM4OFa 4IV1Te2IAlIKW32hQ+Q/KjCYVWsGf0EEx8valVD640TjrIaGR0My2LyHg9NP12qlnao/Lz x3PKOqNt6wHdMnoa9vcfUSxk8/M3qv0= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=39NamAoxPWMrCZaJEOF8WH1zyLewDTeBBeunTxnTycY=; b=Fe04VqEjetu6tDXLZhxHNA4HKy VJycpIBjiVmVELkZ97TvGjWx3WlWJkM9LjthNGeXZu1eQB00JzR+Mr8DPWSLutF2Ja7yvCikoXpwP znm58+XJoLj7R0uD7Hx45tuQ7OTT9LAfkSJZ5K7Io5Y70+/NrgDwKIb7T/qHWATzIF61w7jVsdCHD wbc1oFr9DT07rRTNm6qmIaLNIbc0eCkZbU0NTxz4X2Di+W6u9RQ9iHT3ftKO6E0Ny3QEy4eFnbtni x/rjcAclsaEEZ796tcOTmiG3Izzzqvou+CMphB5MlYfmbrJPLBISQVnCl/A9NSim5B8e/iwIuDV2F aXTMD4bg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rNaay-00BfcE-JQ; Wed, 10 Jan 2024 15:34:20 +0000 Date: Wed, 10 Jan 2024 15:34:20 +0000 From: Matthew Wilcox To: Joonas Lahtinen Cc: Christoph Hellwig , 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 Message-ID: References: <20240110092109.1950011-1-hch@lst.de> <170490002493.164187.5401160425746227111@jlahtine-mobl.ger.corp.intel.com> <170490050245.164862.16261803493864298341@jlahtine-mobl.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <170490050245.164862.16261803493864298341@jlahtine-mobl.ger.corp.intel.com> X-Rspamd-Queue-Id: 459C44001C X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 8jiddxix8jhchruy3f8p4d4xiiguz5mn X-HE-Tag: 1704900899-542630 X-HE-Meta: U2FsdGVkX18b9BED+otsyOlKDcjReFd3lJJoQSUFS/t5Ugvi0k6IUjrdZ76AE9rQQ27PH9Q/d8hg2WYPQ4X83kKrd6tONZpm7AuAc+eocPk6DXi6078G57GAEsKaSdpqru2B/BIxjqrCCuDyX23ULGRnzZhEaDcPg+dEoyaSUB9cmZ9AZMT0S9N7ES3IvLUbyGrqWBRHdBSL3WIZSMul0RLfN0fx/cIurDwCNBLxXSmRxwS49Iay2fZmRBR1QnB4hJHdwnpVebVD3hY6slNAUnDbwLdtcQQa/GMDQlmyX9W2u9yihoDE77IlNfRn2le8Cndsjvxm4pd1mJOx+er7qgFPkymZ0we6X5eL0t8HG/RMWmDhmFqWm2IJNlW+Tr/+wkH3lyv9HQdoqOv9n2e2YO4E9kazvxsAiXRBF+jdbwzedpC01fmiR24TmRZ2kp+qEQFJoAQ34VykBqvexXqA1eCqYkGuKKPDvNcMJuPFSU6nnJ0cSljxNnbFtSfXw8HkBxwhvG2gwAShLxBkYDfqn76+8F9lPiIIdcdpTqub9AOevOwoQHsUoGkm2J3ZVFHgDeeAdPqyKlOb3Bpc3vMInIhoY4/15Wi6AsqI19kG5kqWIndP30yvMlx9/Dwp29G3ECBdwK8qiF74u/FFLWnoHkGSZZQ6STY4wBIf3lJrUgmFBUR6iPJlMdJzYyyW2y6a+7uxM94kEs444at6SD4E6vTRri3ISrozM5a0teqMKXGNqHB90Bdvpm2bNHOvlTWxqd0/Zr17LzRou69crZCuq4SzsOYo5a1IPQyMJZ4RKSEj7nENfkFPbnO6JPnkGik9op4nJH/s8VQzmp/HhHc6QEzOKtNKz94IhZUhaq5i6KyrgyJ8i49uz6jNmqEQBUoqVW6SgfG2lguKlrZ7FLfuQEJhlF9MPPM1OewdbUg1E5eGwtyWSSz3cr5ebKeGtuowTOXH7bdiJpGQXspq8v0 1H58V90r iJoplgDKoPzztAsH95QsXCEzoMXXVGGjfJHdTkXnCGNyMNpFin65Ex/R7gfshfegBBQtw3glp1t92JTZhQB8tgORvCLWYNO2zUZSc4PjDRWL/2bNl+ZVg6xI0SocXKaZ0Ewpus1Sl6aV51B0= 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 Wed, Jan 10, 2024 at 05:28:22PM +0200, Joonas Lahtinen wrote: > Quoting Joonas Lahtinen (2024-01-10 17:20:24) > > However we specifically pass "huge=within_size" to vfs_kern_mount when > > creating a private mount of tmpfs for the purpose of i915 created > > allocations. > > > > 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. > > > > You can see drivers/gpu/drm/i915/gem/i915_gemfs.c function > > i915_gemfs_init for details and references. > > > > 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? Not in the next kernel release, but eventually the plan is to allow arbitrary order folios to be used in shmem. So you could ask it to create a 256kB folio for you, if that's the right size to manage memory in. How shmem and its various users go about choosing the right size is not quite clear to me yet. Perhaps somebody else will do it before I get to it; I have a lot of different sub-projects to work on at the moment, and shmem isn't blocking any of them. And I have a sneaking suspicion that more work is needed in the swap code to deal with arbitrary order folios, so that's another reason for me to delay looking at this ;-)