Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8274602rwp; Wed, 19 Jul 2023 07:40:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlFOxMyk5qTYJmtrDCZvycuSL8MeZiWYe+zJGefqmx6GeQDTl1DhHQHtd9LN+YC+iW6POtWo X-Received: by 2002:a05:6a00:2ea7:b0:67b:d2e4:6bd2 with SMTP id fd39-20020a056a002ea700b0067bd2e46bd2mr3429881pfb.17.1689777633997; Wed, 19 Jul 2023 07:40:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689777633; cv=none; d=google.com; s=arc-20160816; b=0JhyqGH0vqpuNheH3Qp7vwD4XI006EaC08T6Je7TQVZTJmoQHWLeDRTMgiSwMeC/0m TV0sfeUF9DjsmD+4mw+yGsBtygCjZPlN0ThDON+XitFnW5VzEGgRR7WFAU8xPd5c4mP+ nRVahB1GQ7351wobeEPBOGaaiLCrLXCvebmQEp2TrX3v7sl7BlHtUTilZ0LX6fZiwW7z /eyrM88P7xOYicZGRx1KsnJdl8qZlJ6/L3elrWkyAVwQVR5k/K9IB+4Wepul4MbrZc/F uOc8fSWMOH4OoV7G1IlZMiu6a93cVtpaW/YAtdnPbSytfHfg9X+ghMBJEIopgVdzp7C/ 1EYA== 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=JC/eCR674tDcgmpCVJw/UxLXLL972fZka0yLGt+KBbk=; fh=cZ9b6rf9pnLGvPhbNn+CrtdOy++g45MkEFjF4qIGprQ=; b=Z3vznhqPCE4QqmOEC1YdYKzXO8+seqfNm9zEOGM3LDvW5+3TjJSDHwwzbVJVS3qGIk D7SrMEXTcnkgfRvgQVZ3pgEpPAsBYXHNRdUmTgtamEG5JxZcWOClOzhvpeYV3nMNjceA 6ON2m8/eUHat2VoFAM5oRfkMzGF8/a698JJPE/cNLrSoZbR+2LYVzV3OqK7tz/UOhBUS l2kMsSj5tavYu5/zdHvT9P80ixcKvIXn0PrYNdbPHvKMcgFB0RpvI1i919r66yp9owAP RjZKFgVBfOsvkFphgdUng93DizrKxAuJKBuhUfIt4vkNj92bXADF+AaDTbOqCq+oEHTO AR0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Zbo7rd5M; 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 cj22-20020a056a00299600b006819405e9d9si3457063pfb.145.2023.07.19.07.40.21; Wed, 19 Jul 2023 07:40:33 -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=Zbo7rd5M; 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 S231560AbjGSOYq (ORCPT + 99 others); Wed, 19 Jul 2023 10:24:46 -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> 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,URIBL_BLOCKED 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 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.