Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5645956rwp; Mon, 17 Jul 2023 07:26:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlHJ95csD1+nCTt0fBGAnWA/gvOKNIVWaUsbcsg6kq9C9tpnh61NYmyhjr8PNcH0e2G4wxVj X-Received: by 2002:a17:902:ab93:b0:1b8:a3a0:d9b3 with SMTP id f19-20020a170902ab9300b001b8a3a0d9b3mr9842168plr.47.1689604013430; Mon, 17 Jul 2023 07:26:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689604013; cv=none; d=google.com; s=arc-20160816; b=MIUUEPLj4LpRKeuo582TiSwY6bga7t1xZfNilzJ9BttJIJKnz0eB3522evcZB5qwMk aBBHk1hBjGRabRFxXOPMvS3VMpZqbwCv88RGrFlOFidA4EHG1zNgyyY40JuLChEnfEzY sNk/7J4f7IjVnuk5/bVj5o3XKoIBnBVW8Y8SQ0tsB66DUuS2SN+zn8xUn11Ed0qeKvTy Ok+lx5G6z85JTzl5FpN5Kz/MiKTC0NxCEZT1tnQ5d8YYB2EuRmF/r34ylz6OOU55TPAr Z8ClMJxdqHQodKm5kkWofaQ2QNxGmeGGeYK4GwZVwWSbUqiEHy+EpcOC8V9yCO470hyz BTWA== 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=yP81tFY4pH4Uv/KB5Cd7YMQTVo773Q8/WCwZl/r6MdM=; fh=cZ9b6rf9pnLGvPhbNn+CrtdOy++g45MkEFjF4qIGprQ=; b=y5kDaG1Lxf4REhJDobfZ470uSKFzM5w3h04AYP4FiJHt9T8n82Bpeh4RtQQo2Ft8gZ 8rbvnfSmJid4zICkIiH1KDxpZe5YMy+42Im08buqTuTL2NRKvms9M6yCMrwNQhQvolVI qCBHVSnflL9g3NUwUk9z20UsSsqIx/wH/XDj79ssqrYvNBr+VarY3DyhmC1qJ5RUKa4p blMygiZo+lHfyMk5yRqAvC8T+P/zSyAbyjB7tUGjab5RMabndYV+8kyGuBQYYIijPrWA LylXOo5HJ7yRUhbT+DrgMNVRRUZRaG1HkBFbf0UkMa+NDPKACaKMOdMJ/LBBvbGn6KTb 82/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=IKnPkT2u; 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 y3-20020a170902700300b001b86492d71bsi11408711plk.562.2023.07.17.07.26.40; Mon, 17 Jul 2023 07:26: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=IKnPkT2u; 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 S231220AbjGQNsd (ORCPT + 99 others); Mon, 17 Jul 2023 09:48:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230295AbjGQNsb (ORCPT ); Mon, 17 Jul 2023 09:48:31 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D6BECC for ; Mon, 17 Jul 2023 06:48:30 -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=yP81tFY4pH4Uv/KB5Cd7YMQTVo773Q8/WCwZl/r6MdM=; b=IKnPkT2uyTAXvHREmWNsusoqR1 1CJ7o0GyzM8Z2W5DaVh1jLd7ekUkkBbcFFuQTuggUbT8j1r0Ml5IzqF2odT5yrsjn4504kdm9NqUP usSw3GNGgi/psfXxRmVeUh6s/p7V9dGHdK4fub2jsFrwIpMOwT5ZDo/r8aKVN8M/Msd7N2rWOi4zb kOmD33umFyPJtLfCNiJGDcZ+OykbQb9zhYDlXWUZ4D+5bkv1tGefBaJRO3X/6YnxeEdhM4jqa8GNR w/msxM7G6kEv9xydANsn4G/M7uZcZeGIIGrp+Jlc88iG2T/qZIw3YgbPLbHbnsfNCw3y8QmUuPvl7 EWB6xhlQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qLOaO-003xdE-Bi; Mon, 17 Jul 2023 13:48:24 +0000 Date: Mon, 17 Jul 2023 14:48:24 +0100 From: Matthew Wilcox To: Peng Zhang Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, sidhartha.kumar@oracle.com, akpm@linux-foundation.org, wangkefeng.wang@huawei.com, sunnanyong@huawei.com Subject: Re: [PATCH 5/6] mm/page_io: convert count_swpout_vm_event() to take in a folio Message-ID: References: <20230717132602.2202147-1-zhangpeng362@huawei.com> <20230717132602.2202147-6-zhangpeng362@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230717132602.2202147-6-zhangpeng362@huawei.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 Mon, Jul 17, 2023 at 09:26:01PM +0800, Peng Zhang wrote: > -static inline void count_swpout_vm_event(struct page *page) > +static inline void count_swpout_vm_event(struct folio *folio) > { > #ifdef CONFIG_TRANSPARENT_HUGEPAGE > - if (unlikely(PageTransHuge(page))) > + if (unlikely(folio_test_large(folio))) > count_vm_event(THP_SWPOUT); > #endif Since this is a THP_SWPOUT event, we should do this as: -#ifdef CONFIG_TRANSPARENT_HUGEPAGE - if (unlikely(PageTransHuge(page))) + if (folio_test_pmd_mappable(folio)) count_vm_event(THP_SWPOUT); -#endif