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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 041B0EB64DA for ; Wed, 19 Jul 2023 14:24:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231574AbjGSOYs (ORCPT ); Wed, 19 Jul 2023 10:24:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231593AbjGSOYg (ORCPT ); Wed, 19 Jul 2023 10:24:36 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 188A61731 for ; Wed, 19 Jul 2023 07:24:21 -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=JC/eCR674tDcgmpCVJw/UxLXLL972fZka0yLGt+KBbk=; b=Zbo7rd5McHqDmFlDZ5rQNL6/bv Jg6pY42ISXHQ1rU7Ebn2LQ4FMnOhlv9Av9yQ9sATcZk36LGrp/4e11S/hSJIqaz9V+dSmQKa66R1A KK5NGxcrT5vn7etCln+whJhXRO1TqugX6HA4XAOCWJRhpwotqGHfF418Si6BUNW1iA4kKiqciVmke eVR4wPkdcjSSFxygY2pJywn+ZjyVm9qENYjYjs8VST+Mk+RvIarCAeRlyW2jq7x/sDWBYl3WrmQyt a2AE2yHUNYTmEwaOHUNh9VMmVRO3HpRF7mVesNI/jfxNi27kPfVeWzAZvWD1TetGDx7KG2iVjkdPu QIvAH6Ag==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qM86A-0068WO-4k; Wed, 19 Jul 2023 14:24:14 +0000 Date: Wed, 19 Jul 2023 15:24:14 +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 v2 8/9] mm/page_io: convert count_swpout_vm_event() to take in a folio Message-ID: References: <20230719095848.3422629-1-zhangpeng362@huawei.com> <20230719095848.3422629-9-zhangpeng362@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230719095848.3422629-9-zhangpeng362@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 19, 2023 at 05:58:47PM +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_pmd_mappable(folio))) > count_vm_event(THP_SWPOUT); > #endif As I said in my earlier response, you don't need the ifdefs. Check the definition of folio_test_pmd_mappable.