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 14B1FEED616 for ; Fri, 15 Sep 2023 15:35:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 67E626B0363; Fri, 15 Sep 2023 11:35:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 62EB76B0364; Fri, 15 Sep 2023 11:35:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F72A6B036F; Fri, 15 Sep 2023 11:35:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 3C6856B0363 for ; Fri, 15 Sep 2023 11:35:08 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 02CD01CACBE for ; Fri, 15 Sep 2023 15:35:07 +0000 (UTC) X-FDA: 81239230296.18.762B58C Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf05.hostedemail.com (Postfix) with ESMTP id F0ADB100021 for ; Fri, 15 Sep 2023 15:35:05 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=WnqCDQbw; spf=none (imf05.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694792106; 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=BiPqqbuCoCJwT7cml3FIg1dZt/5325CvLgUU6B8VZPI=; b=wgUs4u3xv14x3+0zELCN1QtqRKh7chzFgwc7XOPd4onNgIdkFtLYBcwpwGNQ+NM8UJSj5y sv1Pi5nuxuUrYWJDSZI0t7vWYrVODabraZsHebkqKdsQcYXWIdDBiwRgK6DMNR71x+iLCy 4nr5MQuToxMN6joQxP8m/k7xqm7zGeM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694792106; a=rsa-sha256; cv=none; b=H4NZzCo8O8vcUj2aWTW/zT8kp3T1TeKuHbRGFBgLReGB3niHedbyhbhCrq0LyUbG10CNTS QHJTz+7hlyer8l8Ly4QPAQb3+sEN25fBuSiYMWFDeNB7ZRJnjnbaesz6pGWtDsfdRHqL6i 2UirAky8OqriE9Fo8R0P6vlB6AItNtY= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=WnqCDQbw; spf=none (imf05.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none 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=BiPqqbuCoCJwT7cml3FIg1dZt/5325CvLgUU6B8VZPI=; b=WnqCDQbwPSmkZQOH3XpBhxlOB4 Hf8TM/ShP+TANJO0GVAK3VYfdj33ab9xx/LVhg422oglIHaMJlu//v5xlqpc5FidCjldVxm5F5HCt RsMIx7xUQHGI8xA1mvs2nvLOiVryITICXLBFkakSxO9YiJHTheLXp2chiBFvPbbY/lS4/TMqwdLC0 V6eY01zys5j9cSxLIyTFOei2USk/mipe17dMsrFjr0JvKVPRnc/SVxUBIL4TtoGVARdhern+1WRxa oHksp7hZoCLOB+UK4mg0+oUkJl5cvKo++ELseTENIW9FXic6yq21wesS02/L5b/yY1t1UtuFC+aFs JlRbGrcQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qhAqM-00AWs4-Oi; Fri, 15 Sep 2023 15:34:54 +0000 Date: Fri, 15 Sep 2023 16:34:54 +0100 From: Matthew Wilcox To: David Hildenbrand Cc: Daniel Gomez , "minchan@kernel.org" , "senozhatsky@chromium.org" , "axboe@kernel.dk" , "djwong@kernel.org" , "hughd@google.com" , "akpm@linux-foundation.org" , "mcgrof@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , "gost.dev@samsung.com" , Pankaj Raghav Subject: Re: [PATCH 0/6] shmem: high order folios support in write path Message-ID: References: <20230915095042.1320180-1-da.gomez@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: F0ADB100021 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: bjyj93eoj31oj89uskiew3u9i9gapy3d X-HE-Tag: 1694792105-803077 X-HE-Meta: U2FsdGVkX18iGVqZ1WUHeOBH6jN0jDVTclNmw846/3bE2eNhNibzCtPjYZQV2uxODxwxxa3f8VJyYUL2M2Vh0p9Zh3IapHq8wYhYd5oJMUpfMtHfgN2DAR3N3lW77msQgPLFEVKOx3F0/gRHHaZFhNpqE0+ZN30NTH8pCf4mpVdpJ+/8RSZGuEBzt8bXKD3jHYpMBk9APCxj88rDvmCvYgM4xD7CJQAdC6IgZkzxCz9SaSRTHOmIM7cuHMcRoevOzl/XOR5/k9+fIKIK98X7sVWsl1tv9Fma6TKbzZKqfaraS0bSVp2mghLaQ9KC/0JOcTfjGyqB9n/wXrremZpgXGHXnFGTWMR6EnzZ0aX9er+JDjbbgxWfehyknik+yuxO1ArHGAZScFuzT27EUJ6UzEjD6Qbofe0xdN5D9Z5WtBlc4SanhL9G9e9FNDx9rRs2TUpcC9pEM8+b1jGHHOoaRX55xTWuHl8woqbTcuPxf6xE4qqYouujbagP7MNyOxKLhN/wE45zunOmiY9wf9ovGCCNhOPcSpCnPwFYR7gjvm+EzQgbgo2RTpFhl2sGbJU+r4qwMpBs4+JGyq/oEXFZUmhpUgJdWT5rccjRNY4b4ba/+Sx26yVh2jruy49yDHyioMykZI6pGxYoiOnJnVajm5vAWEs/T62QISoX25G4SVgTj13gEoOJ2DvZrwAiLkAUmy+aoBUkyRCJE4tAxH66jTlrtkrM5su/TZUdChzua0DT9nwj9rnyeQyeCHMeGyFg14iO/3tmpidtNAElPYx8cBoB23ubp/56hx/rXdiHvLklyt6bnH97q12/oowwu0HlZ+GgSGyeQyP+zC/df9jYFSETpBtBSTO9qd70Sm9xtBXMj7AnTuVrF0Dpesc2BWSFohUPJFZb7Cu5pAUSGrAKEeaJk3wNoeKVCDiljHnXbL7GU4s4lPVyIVtII6LNepghUwnUIQ7mzPznXlc0tO/ Kt+OAMAz kxz24mZW4atevkXSBVhOP9kWlQcoHn6kufsGjk+4vhAv6sA/qLfrSE5sMyN/LajO4r7ZvyCaZXxCwPSktuyW0dyRtI9GIPcOt2/wBy+WRZdr3xACF8PVuKaCnY8W0GAhwyG00o42ufy6rge1M88hmbfFCyoDcu0FRY39Q7tdhE2QUcFZLnvxevUqJkQ== 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: On Fri, Sep 15, 2023 at 05:29:51PM +0200, David Hildenbrand wrote: > On 15.09.23 11:51, Daniel Gomez wrote: > > This series add support for high order folios in shmem write > > path. > > There are at least 2 cases/topics to handle that I'd appreciate > > feedback. > > 1. With the new strategy, you might end up with a folio order matching > > HPAGE_PMD_ORDER. However, we won't respect the 'huge' flag anymore if > > THP is enabled. > > 2. When the above (1.) occurs, the code skips the huge path, so > > xa_find with hindex is skipped. > > Similar to large anon folios (but different to large non-shmem folios in the > pagecache), this can result in memory waste. No, it can't. This patchset triggers only on write, not on read or page fault, and it's conservative, so it will only allocate folios which are entirely covered by the write. IOW this is memory we must allocate in order to satisfy the write; we're just allocating it in larger chunks when we can.