Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2183936rwo; Thu, 3 Aug 2023 06:04:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlFvdKEslgfrsSRf8+WFbWhMXMWgf03pEMeGQYQr4YMYmbu0E38qzklunxu/S4o51357n6/l X-Received: by 2002:a17:902:ea95:b0:1b8:63c6:84ab with SMTP id x21-20020a170902ea9500b001b863c684abmr15563088plb.61.1691067893427; Thu, 03 Aug 2023 06:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691067893; cv=none; d=google.com; s=arc-20160816; b=KZdO3BKszbsxDhkLNK28un6JF6pgRF6Rl3xHBnco+Yem1e3jcHxvdBw0s5wg4u3F2H pOxHbjXew9C3qDOI2h3+pMBwkyi+Ma4zmGCHSRYCfwSwSh8YPm378pf5QgxNDJoQNxoN MmC0yyO/N2v1ExyOrYccJZd0bASJh8rC+Un89AGf7Y/xLkN6gyssvUanKMIUewvqj+IZ pIqPnWyQ/p1q5Ag6p1+SPOA1MRpQD6JQNRMXF3phL4kbvvdhdyJMPDeIsKCaCA4J+iVq 1FCU8T4yS0lKewQL7fG5ffOmj2Tw6oRt0MeMVZRPWqfvQJJCKGVLoqZHaABARe2gNHy8 +m8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+GBZoisSMbVY7fBPLSgxdUKAz4UO3mFAPyDKEIWzr3s=; fh=qi7wCCwZxhgDF5fmSP0lvzQvCIoh4z/2RwOeLycP6nI=; b=Ghgn9HaRP8oVczsnW2OJ8OC3gEfRY+iPDUSIeNl46fSRy3CjfaJ4oFx+A48PqRSmF5 x1TNkmg//P17eKjiODpNTs7IyqD5qdbHQnvDtzuL6Urb5LWDaQXZRK/CNkVXGQ64Y2Rg xtAwfC5VKbKmQd0WNCgnizph6jIPxmQNrjJy5o7EP37fEOd/TUnRwpI3zqdR/Dt12B+O pIy2Vbp8wGlotaRIcm+uhlHzEtZbhEU6NYe6IGngoS+14PueA0w3SPpaCPqR1rxdissO zSOt82J5+NuZ+Geh9CeR1b4X//kqR1svezEHs2beJCguQtsyuDYSosa5M0JKXCe3VHHY KF8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ioOJ9uor; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x12-20020a170902ec8c00b001b9c120a39csi13320133plg.357.2023.08.03.06.04.21; Thu, 03 Aug 2023 06:04:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ioOJ9uor; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234518AbjHCMad (ORCPT + 99 others); Thu, 3 Aug 2023 08:30:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229548AbjHCMac (ORCPT ); Thu, 3 Aug 2023 08:30:32 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D594430EF for ; Thu, 3 Aug 2023 05:30:31 -0700 (PDT) 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=+GBZoisSMbVY7fBPLSgxdUKAz4UO3mFAPyDKEIWzr3s=; b=ioOJ9uorxOLEyrm9ld/C2rO8EA ATmR1hfJ2DAYYGEgzH9tdKbku/JjdGnEe2YnPoqGUSXMh3qY6P5aTE4j4muSxx35gG6i1Zwm0HYZL Y3QZ57/eUSM8tpf/0FlFkcchwFYv1nn2brYYv3gdkOfHGp/m8tJhLdICZgfxlR3TTBEjBFBV0n6EA J0U/aPTqAvWQ848zav2g/Xq6qYdj3EEDBHGaJbV/fRfastADNeBOHEDFnb9U5nVgPZDSZddPJaMB6 JL8Qt9EXzZmOlMJkO6Wm0wOPIMaTmwI/qsqA18nXA20A9Drl6e1p359IEuZOuQcSo8LBPUBex0lyC rdAqmzRw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qRXTB-003dKU-Ch; Thu, 03 Aug 2023 12:30:21 +0000 Date: Thu, 3 Aug 2023 13:30:21 +0100 From: Matthew Wilcox To: Kefeng Wang Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Huang Ying , David Hildenbrand Subject: Re: [PATCH 1/4] mm: migrate: use a folio in add_page_for_migration() Message-ID: References: <20230802095346.87449-1-wangkefeng.wang@huawei.com> <20230802095346.87449-2-wangkefeng.wang@huawei.com> <001ee9b0-ea25-a896-e3ae-9a9b05a46546@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001ee9b0-ea25-a896-e3ae-9a9b05a46546@huawei.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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-kernel@vger.kernel.org On Thu, Aug 03, 2023 at 03:13:21PM +0800, Kefeng Wang wrote: > > > On 2023/8/2 20:21, Matthew Wilcox wrote: > > On Wed, Aug 02, 2023 at 05:53:43PM +0800, Kefeng Wang wrote: > > > err = -EACCES; > > > - if (page_mapcount(page) > 1 && !migrate_all) > > > - goto out_putpage; > > > + if (folio_estimated_sharers(folio) > 1 && !migrate_all) > > > + goto out_putfolio; > > > > I do not think this is the correct change. Maybe leave this line > > alone. > > Ok, I am aware of the discussion about this in other mail, will not > change it(also the next two patch about this function), or wait the > new work of David. > > > > > - if (PageHuge(page)) { > > > - if (PageHead(page)) { > > > - isolated = isolate_hugetlb(page_folio(page), pagelist); > > > + if (folio_test_hugetlb(folio)) { > > > + if (folio_test_large(folio)) { > > > > This makes no sense when you read it. All hugetlb folios are large, > > by definition. Think about what this code used to do, and what it > > should be changed to. > > hugetlb folio is self large folio, will drop redundant check No, that's not the difference. Keep thinking about it. This is not a mechanical translation!