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 47B23C433F5 for ; Mon, 17 Jan 2022 16:10:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8D77D6B0071; Mon, 17 Jan 2022 11:10:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8870F6B0073; Mon, 17 Jan 2022 11:10:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74F826B0074; Mon, 17 Jan 2022 11:10:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0102.hostedemail.com [216.40.44.102]) by kanga.kvack.org (Postfix) with ESMTP id 66EA16B0071 for ; Mon, 17 Jan 2022 11:10:53 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 1FA891813BCDC for ; Mon, 17 Jan 2022 16:10:53 +0000 (UTC) X-FDA: 79040267586.14.174C787 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf31.hostedemail.com (Postfix) with ESMTP id 61AF720005 for ; Mon, 17 Jan 2022 16:10:50 +0000 (UTC) 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=QgdfAvNkIxpa6lPCvlC647cLv8L2qmMu1/dpfaEB93w=; b=Fjhxxp7lxySoKYa9cyiWJG7FVs WaEuNqpzk19HPcYLCHkevL229dA7u9e+JX1T0WA85c9fOLhvhb2kOc4CFsq2QzryBBmyC0RVej8Lh FsA43/etrlHVf8yNdWTsNsjNXwTAFV4YVfbh+GhHXHkQllsCEzm3oRW2q+Cb/DvfB+EnVFJHQxOWv /XxwnN5zRXslv8kc/D/Y8De6gYle1MEvaiGwB5QcSqHKivV4ZHVnX0L/wDvnj6d5MsQxuAwyDEKNE Ydi56Oc216JZHOGO24A9uW+oym3fXQJp+/3rjd5Q+gpvEOb2NOUETI4W+XNLP0gSTs+FueAGoi1z/ sCra3q6g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n9Uak-008MgI-8c; Mon, 17 Jan 2022 16:10:46 +0000 Date: Mon, 17 Jan 2022 16:10:46 +0000 From: Matthew Wilcox To: "Kirill A. Shutemov" Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 04/12] mm/vmscan: Free non-shmem folios without splitting them Message-ID: References: <20220116121822.1727633-1-willy@infradead.org> <20220116121822.1727633-5-willy@infradead.org> <20220117160625.oofpzl7tqm5udwaj@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220117160625.oofpzl7tqm5udwaj@box.shutemov.name> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 61AF720005 X-Stat-Signature: s5hcp3ikji81tq6yygxr6ms4agfek1u4 Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Fjhxxp7l; spf=none (imf31.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-HE-Tag: 1642435850-27851 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 Mon, Jan 17, 2022 at 07:06:25PM +0300, Kirill A. Shutemov wrote: > On Sun, Jan 16, 2022 at 12:18:14PM +0000, Matthew Wilcox (Oracle) wrote: > > We have to allocate memory in order to split a file-backed folio, so > > it's not a good idea to split them in the memory freeing path. > > Could elaborate on why split a file-backed folio requires memory > allocation? In the commit message or explain it to you now? We need to allocate xarray nodes to store all the newly-independent pages. With a folio that's more than 64 entries in size (current implementation), we elide the lowest layer of the radix tree. But with any data structure that tracks folios, we'll need to create space in it to track N folios instead of 1. > > It also > > doesn't work for XFS because pages have an extra reference count from > > page_has_private() and split_huge_page() expects that reference to have > > already been removed. > > Need to adjust can_split_huge_page()? no? > > Unfortunately, we still have to split shmem THPs > > because we can't handle swapping out an entire THP yet. > > ... especially if the system doesn't have swap :P Not sure what correction to the commit message you want here.