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 2F4F8C433EF for ; Mon, 17 Jan 2022 21:00:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5E50D6B0072; Mon, 17 Jan 2022 16:00:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 592E36B0073; Mon, 17 Jan 2022 16:00:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 481CC6B0074; Mon, 17 Jan 2022 16:00:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0243.hostedemail.com [216.40.44.243]) by kanga.kvack.org (Postfix) with ESMTP id 3A3A06B0072 for ; Mon, 17 Jan 2022 16:00:32 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id ECEBB951AD for ; Mon, 17 Jan 2022 21:00:31 +0000 (UTC) X-FDA: 79040997462.18.9B3EC4E Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by imf21.hostedemail.com (Postfix) with ESMTP id 76E571C0002 for ; Mon, 17 Jan 2022 21:00:31 +0000 (UTC) Received: by mail-lf1-f54.google.com with SMTP id br17so62389584lfb.6 for ; Mon, 17 Jan 2022 13:00:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=QdXHGenv3tZIOnYPfCA1iCRPfis03+iHQr5vhZDRmzE=; b=LHCrYpBn/smiTJofppxDrX+ObncdoQHEUbtlu7Uv8G9dvP69Qbsxn1Zd8Npqatpqgn V/+c1uEyFCqjxVX8KFt4LnZvrRJ9IpXUHupdXbi4Y4EtgbS0hk95vFQWV1xYNHzk0eDz cifHShq1ecjEPg/13qDD/r3F6WOXCCGJtXcmJX41XoCwt0atbYn9NZeIyJLtjpNaUGFZ jYHi+5tF/8g+r697NSHleOOlNMAPrhK+CNlU6yXI21P+N3wYvwuJc5udF519uNScPBIp VcG5hLejYUs/hq2PnxOVpiwqwUoh4fWBfzAsNzrgrefvDSxxVjPYn0NQXkszk587E9DI a26Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QdXHGenv3tZIOnYPfCA1iCRPfis03+iHQr5vhZDRmzE=; b=du2PgOufyPBg7Z3SWdTN/zzbHOTuIAxxZqZZ4V5EUkGcF8qV40+M0EDj4mSgSLOBDI R6Baw9hyg6jOTsaWydpUSECpIMg6JEjD44lfPU9rY+8dC4wINwbliJXEjj315BiqFKzy eg6oc/OKurSs/254wL0EGtGhGz2Ot/sHghkhVwAU9/SkJLvyswyOsD/fq+Mmft+e1GcK zzq9vwqakC+Pfp0YJrAk4kD5JqFFOQkSGMt0m3iNedFQuPHFgUmZkv97XBKFtl4AMZMY BPoErItiTwjITum4hKM95jVlq3BovukD008zDgu2Joj/PXyyo4xwXBGT3g15eSm5Ks36 5iIA== X-Gm-Message-State: AOAM530Vlu1KaCSAjQAcgeV4DLxmBfCCvQ+zGrzdFL19gjKqyDPbuTRV O2oJyZKu0VLcLLFM/5c3jXRvmg== X-Google-Smtp-Source: ABdhPJwo88Lo7R6WVD9bXds5DI6nWc0dJtRADfIjRocxWhl6taT1Sq4djYHIrDbA3yWrii1W/rWEKA== X-Received: by 2002:a2e:b70a:: with SMTP id j10mr13657179ljo.376.1642453229685; Mon, 17 Jan 2022 13:00:29 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id k9sm1037129lfg.121.2022.01.17.13.00.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jan 2022 13:00:28 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id 49E4D10387E; Tue, 18 Jan 2022 00:00:57 +0300 (+03) Date: Tue, 18 Jan 2022 00:00:57 +0300 From: "Kirill A. Shutemov" To: Matthew Wilcox 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: <20220117210057.o2aug2unmovufrdz@box.shutemov.name> 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: X-Rspamd-Queue-Id: 76E571C0002 X-Stat-Signature: 85qt6xa8yadkq8awkujzbdbazid1kr8d Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=shutemov-name.20210112.gappssmtp.com header.s=20210112 header.b=LHCrYpBn; dmarc=none; spf=none (imf21.hostedemail.com: domain of kirill@shutemov.name has no SPF policy when checking 209.85.167.54) smtp.mailfrom=kirill@shutemov.name X-Rspamd-Server: rspam08 X-HE-Tag: 1642453231-555358 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 04:10:46PM +0000, Matthew Wilcox wrote: > 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. Looks good. > > > 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? I meant we can make can_split_huge_page() expect extra pin if page_has_private() is true. If it is the only thing that stops split_huge_page() from handling XFS pages. -- Kirill A. Shutemov