Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6786468rwp; Tue, 18 Jul 2023 06:02:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlFm0+oX3wTJudq5UN5Zc6EubW5mfDUnLS1TudFSktcmYHzaP6GoTmstuYoBHE5oR9fDTj9u X-Received: by 2002:a05:6a00:1353:b0:682:537f:2cb8 with SMTP id k19-20020a056a00135300b00682537f2cb8mr18691417pfu.26.1689685351602; Tue, 18 Jul 2023 06:02:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689685351; cv=none; d=google.com; s=arc-20160816; b=TmErhx91Q1c+tYqJApmDOPGB6BARED7tBPX/OCsWPM/2EfDtAd5L7b23i3VB67goOi voyKXGjaIkKXGkIjrsiZ3SGj1EXgEhf28TPdYlTml/U7ADt//ViCx6pCSys98/Ou4gUb Ek6KSPWcNiX95S7r4uy2nyJq7uwQV7sm9wGhhogp9/a+Iz03d772cZ7byRzzR0v87zEF mTU+OhRTzBB6OiMA64qeayjT9/P2yxkrhYpBVYESdWplhSaNQfE0fzN12/KNSSIJYkoW y4ixBHV7hm5wDWlXlwcKaXtvbo+WZmLE1/zyiCIhosmanblDoorR/VSrEc1sAeu3IU6W /PFQ== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=GhkxbuBsag65Fjgl36YqOXujmk0e0I2lQgQq1LyN8Co=; fh=Jp+ytMKeMTZKR7jSteZKAGcJbZI5xYndYufcPmLPvnI=; b=qzA+Wvzb9iM+YeII0piMa3t4rdqmuPfXOJGdFXSSmyOQFWysi7kChixxCKk3i6JzIE xt3bSZhySG36xRlAMBfosnHGJCk5OqKi3H03AbqIo+gq4OTv1CVbC3FodOIlv7S2H6Hu 5yYJhpsn0XdMLxDvDhZAD+IUrCakXt2nFreOnlMqToGJ3PxWWLolTyMv9Pdl0ojr9x8g 0SrguUGNu+l7EyKyqMPJSSwfkX2+j7MW70diRG2ERY692GidMSnmI7vMsIiq36HLSCqu WYLOA5CTP7cKeQ33nyEUKcd4LGeF/qTN6glgnJrmaI/On48OlUDHecxXSukykRTY/TQC 1n+w== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fc8-20020a056a002e0800b00670ab28fac3si1584153pfb.378.2023.07.18.06.01.58; Tue, 18 Jul 2023 06:02:31 -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; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232311AbjGRM4x (ORCPT + 99 others); Tue, 18 Jul 2023 08:56:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230150AbjGRM4w (ORCPT ); Tue, 18 Jul 2023 08:56:52 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 818F4D2 for ; Tue, 18 Jul 2023 05:56:50 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R4zSr51RFzVjMD; Tue, 18 Jul 2023 20:55:24 +0800 (CST) Received: from [10.174.179.160] (10.174.179.160) by kwepemm600020.china.huawei.com (7.193.23.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 18 Jul 2023 20:56:46 +0800 Message-ID: <06241e10-e7f6-64c8-ef9a-1336d56b21b8@huawei.com> Date: Tue, 18 Jul 2023 20:56:45 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 5/6] mm/page_io: convert count_swpout_vm_event() to take in a folio Content-Language: en-US To: Matthew Wilcox CC: , , , , , References: <20230717132602.2202147-1-zhangpeng362@huawei.com> <20230717132602.2202147-6-zhangpeng362@huawei.com> From: "zhangpeng (AS)" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.160] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,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 2023/7/17 21:48, Matthew Wilcox wrote: > 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 Agreed. I'll convert PageTransHuge to folio_test_pmd_mappable. -- Best Regards, Peng