Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2378233iof; Wed, 8 Jun 2022 03:49:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJ7Xt8MxaxkP/nXjW9OUIjHAzSX9zX5P45zu2I8lu9p83GpuYLDsn/MvOIl8BvZ2UB3q+U X-Received: by 2002:a17:90a:c202:b0:1e2:e772:5f0a with SMTP id e2-20020a17090ac20200b001e2e7725f0amr37061282pjt.109.1654685341551; Wed, 08 Jun 2022 03:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654685341; cv=none; d=google.com; s=arc-20160816; b=OKAoYmuf63Y3UluvyhRRrJMk3cH1xSw/0M5bQJrKMFXQ7NToYfnBX7/MwffenHYD6o fupViyY2tU4leCjS4TrnQ/105Kj583qoL+iq3Ezge3wcFCA8ZHGGcM+lTIq5JRQveXeC HKQa93KtANfS0k6JP9EBiHDDFlUY47adC/NAcREP8wWDtnRPXsWIYRer+fyziI4RhbYp 5EPAG/pdkHal+JskrPizIVTx3j+U5IlNhbb+sVsXZdKXJAzJHvCZyPfwfkENYMfl8kZt +tjFfBV0qeX5t4S9KRLIp2lc6qKiAOOcxFqyKAPl3NMpMWUL+mTry47UMw8iVSTYaOlz zY2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :organization:from:references:cc:to:content-language:user-agent :mime-version:date:message-id:dkim-signature; bh=X7ko0a61KQIEYlZE2OolrSj5KPboqylHtHlNY2Rk0xk=; b=O2yVNODAyKxMfxWceKmK8XIzJE742DFJ1l+ENFu0ndOQYQWT3a1tqrbPs7ffxcE228 GVSkgwB8sWCHNEO08I4ooUc8iR9Oj36V0m5bikZDGkf6gBzVg24RS2dnErdhCNPamrP5 G1jfqhWeZ++8qRy0UKdckxwVeLdM3SPJXmc5lyQ6wn+3CLXkGIht+V3vlS5rNWwi65eh 4mGRYvdqAU/3h+zR7pnZZBBCn5rEnMbPkd3t+hmmVs37E05AD0t+PpCiKvSbcWtS/3Uz i7vecLo0UAcD/gdfRr5dsCzOttKi5hQEwB6LERkdPe8tweivg1O1J+/XVR4xLP/ua3hG lznw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HTgr1iTc; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 127-20020a630185000000b003fd5af778f5si1833219pgb.194.2022.06.08.03.49.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 03:49:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HTgr1iTc; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 980B2247040; Wed, 8 Jun 2022 03:15:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236464AbiFHKOz (ORCPT + 99 others); Wed, 8 Jun 2022 06:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236421AbiFHKNM (ORCPT ); Wed, 8 Jun 2022 06:13:12 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A0AFE101E7 for ; Wed, 8 Jun 2022 02:59:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654682376; h=from:from: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; bh=X7ko0a61KQIEYlZE2OolrSj5KPboqylHtHlNY2Rk0xk=; b=HTgr1iTc2yNBJ1TMG1abAXJSSpfxGYB6q8DDg6rnb5L77rqSUjLmyMcw5MKS9W8Bqf+0lQ ibC36RSLfFLbCsI4FDLUl0aYLyQa6T26wEi9aO21DVIT3Gz7UrtMwowP+cKEuztqrX1UQe 1eaWq5xsDk+ZtqJ0xrl8XsuNvnaiHOY= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-193-3bQHCBeyMlObZkJe4tOvjg-1; Wed, 08 Jun 2022 05:59:35 -0400 X-MC-Unique: 3bQHCBeyMlObZkJe4tOvjg-1 Received: by mail-wm1-f70.google.com with SMTP id bg40-20020a05600c3ca800b00394779649b1so14175496wmb.3 for ; Wed, 08 Jun 2022 02:59:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:organization:subject :in-reply-to:content-transfer-encoding; bh=X7ko0a61KQIEYlZE2OolrSj5KPboqylHtHlNY2Rk0xk=; b=WczGM5hfO8cf4yjq54J7CJ2l8896xyxrkEBuEbh1SNthoYY6OAPR/BlUyKFVcU2IsQ gNKFHoSUvE6H6HNw9/T+sc4g2CCtE6KtBThSAd+1a+Q0DGY6KU1sqkuH2U6DWtx+VkwF O7sPfjHpr3abhgG74xrwuvBBJy1Y6Sdxbhy744X19EibbLoIIQ7Jp9XWr9CvM85cbULW qWhKt1RTte2WYlKi3LGIumSxRN3W1knN9oyf24a9zAoCBEIvAr9XlGwf46PFAx8enXpr vRMkcmBKg2AdMIxKWHOXHgz95i11LGR9u+xeaULDgMFyV2BSYYCBRg3NXuldqWhQSXYk eFSA== X-Gm-Message-State: AOAM530k5DORu3ZHCANnTXjvpBDFyKfxUlYVDJxXqPCWCddsj4Cqn4LI vd0YjRHOAvmqfeky2BY0edFRItU/mVaCMD2Ja4U+YXPij+1dlZCacDhpfxsIYEQw5FPCu7QtvPg ppB0A6Rfr1yz++hU1RjGEHg== X-Received: by 2002:a05:600c:154d:b0:394:8d64:9166 with SMTP id f13-20020a05600c154d00b003948d649166mr33665186wmg.102.1654682374065; Wed, 08 Jun 2022 02:59:34 -0700 (PDT) X-Received: by 2002:a05:600c:154d:b0:394:8d64:9166 with SMTP id f13-20020a05600c154d00b003948d649166mr33665171wmg.102.1654682373804; Wed, 08 Jun 2022 02:59:33 -0700 (PDT) Received: from ?IPV6:2003:cb:c705:ad00:db2:4c6:8f3a:2ec4? (p200300cbc705ad000db204c68f3a2ec4.dip0.t-ipconnect.de. [2003:cb:c705:ad00:db2:4c6:8f3a:2ec4]) by smtp.gmail.com with ESMTPSA id p19-20020a05600c1d9300b003942a244f39sm2898272wms.18.2022.06.08.02.59.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jun 2022 02:59:33 -0700 (PDT) Message-ID: <36cc5e2b-b768-ce1c-fa30-72a932587289@redhat.com> Date: Wed, 8 Jun 2022 11:59:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Content-Language: en-US To: Matthew Wilcox Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-aio@kvack.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, ocfs2-devel@oss.oracle.com, linux-mtd@lists.infradead.org, virtualization@lists.linux-foundation.org, Minchan Kim , Rafael Aquini References: <20220606204050.2625949-1-willy@infradead.org> <20220606204050.2625949-16-willy@infradead.org> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH 15/20] balloon: Convert to migrate_folio In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 07.06.22 21:21, Matthew Wilcox wrote: > On Tue, Jun 07, 2022 at 03:24:15PM +0100, Matthew Wilcox wrote: >> On Tue, Jun 07, 2022 at 09:36:21AM +0200, David Hildenbrand wrote: >>> On 06.06.22 22:40, Matthew Wilcox (Oracle) wrote: >>>> const struct address_space_operations balloon_aops = { >>>> - .migratepage = balloon_page_migrate, >>>> + .migrate_folio = balloon_migrate_folio, >>>> .isolate_page = balloon_page_isolate, >>>> .putback_page = balloon_page_putback, >>>> }; >>> >>> I assume you're working on conversion of the other callbacks as well, >>> because otherwise, this ends up looking a bit inconsistent and confusing :) >> >> My intention was to finish converting aops for the next merge window. >> >> However, it seems to me that we goofed back in 2016 by merging >> commit bda807d44454. isolate_page() and putback_page() should >> never have been part of address_space_operations. >> >> I'm about to embark on creating a new migrate_operations struct >> for drivers to use that contains only isolate/putback/migrate. >> No filesystem uses isolate/putback, so those can just be deleted. >> Both migrate_operations & address_space_operations will contain a >> migrate callback. That makes sense to me. I wonder if there was a design decision/discussion behind that. CCing Rafael. @Rafael, full mail at https://lkml.kernel.org/r/Yp+lU55H4igaV3pB@casper.infradead.org > > Well, that went more smoothly than I thought it would. > > I can't see a nice way to split this patch up (other than making secretmem > its own patch). We just don't have enough bits in struct page to support > both ways of handling PageMovable at the same time, so we can't convert > one driver at a time. The diffstat is pretty compelling. Yes, splitting rather overcomplicates stuff. > > The patch is on top of this patch series; I think it probably makes > sense to shuffle it to be first, to avoid changing these drivers to > folios, then changing them back. Absolutely. > > Questions: > > Is what I've done with zsmalloc acceptable? The locking in that > file is rather complex. > > Can we now eliminate balloon_mnt / balloon_fs from cmm.c? I haven't even > compiled thatfile , but it seems like the filesystem serves no use now. > > Similar question for vmw_balloon.c, although I have compiled that. IIRC, virtio-balloon, cmm and vmw_balloon all have the mnt/fs just for page migration purposes. So if one can get rid of them, all should be able to get rid of them. Essentially everything that uses the balloon compaction framework. That should go into separate patches then. > > --- > > I just spotted a bug with zs_unregister_migration(); it won't compile > without CONFIG_MIGRATION. I'll fix that up if the general approach is > acceptable. > > arch/powerpc/platforms/pseries/cmm.c | 13 -------- > drivers/misc/vmw_balloon.c | 10 ------ > include/linux/balloon_compaction.h | 6 +--- > include/linux/fs.h | 2 - > include/linux/migrate.h | 27 ++++++++++++++---- > include/linux/page-flags.h | 2 - > mm/balloon_compaction.c | 18 ++++++------ > mm/compaction.c | 29 ++++++++----------- > mm/migrate.c | 23 ++++++++------- > mm/secretmem.c | 6 ---- > mm/util.c | 4 +- > mm/z3fold.c | 45 ++++++------------------------ > mm/zsmalloc.c | 52 +++++++++-------------------------- > 13 files changed, 83 insertions(+), 154 deletions(-) > > diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c > index 15ed8206c463..2ecbab3db723 100644 > --- a/arch/powerpc/platforms/pseries/cmm.c > +++ b/arch/powerpc/platforms/pseries/cmm.c > @@ -578,23 +578,10 @@ static int cmm_balloon_compaction_init(void) > return rc; > } > > - b_dev_info.inode = alloc_anon_inode(balloon_mnt->mnt_sb); > - if (IS_ERR(b_dev_info.inode)) { > - rc = PTR_ERR(b_dev_info.inode); > - b_dev_info.inode = NULL; > - kern_unmount(balloon_mnt); > - balloon_mnt = NULL; > - return rc; > - } > - > - b_dev_info.inode->i_mapping->a_ops = &balloon_aops; Are you missing similar updates to drivers/virtio/virtio_balloon.c ? At least, there we're also using balloon_aops, so this patch shouldn't compile. Skimming over it, nothing else jumped at me. -- Thanks, David / dhildenb