Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp503876rdf; Fri, 3 Nov 2023 07:05:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFotz38BcMlHH8B938HcXHS0CU4OzegLry4t6wqhQaM98DDAT25mjQfg4tOHmsTzfBqk9xv X-Received: by 2002:a17:90b:947:b0:27c:efe3:89dc with SMTP id dw7-20020a17090b094700b0027cefe389dcmr18049328pjb.14.1699020312869; Fri, 03 Nov 2023 07:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699020312; cv=none; d=google.com; s=arc-20160816; b=ldXPXq1uhLjoRMrCZHZEq4KtXXjXv6yF8Zk8VX1h8YmERw3RSrYo7LqkgbuhVDyikG 07teAs9M6VQcagNp7fv7OI4I+28ZASABHmr3B8GOniecxBB8FwLQq5GzI7/w14FdWLvu IwAzdasf3TtJIXLxfgmIhu3rcJGT8rBLPieVU7Uorbe/rK6dcDMwMyb502CswAYMtkAc DsHhiO1ErIZJj9BykYkR8sk5Rk/JKtk870rylqmaZWM3nPU4AcsN4VnZTJmyNVB6YOgW q/hVF+MEhVmClkfEbOffrbQPfoJjfboluL6xckjPOgo5jn6QOXWiSdM+pnMKWezSf5FF 2A7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=KcfQLTNeQLYbZjj3Vfq0pzF4qAjIfyux433LLT/5H3c=; fh=kUj/5waaepfljbNx30rj2BALdV0u/mUCTaFWThlgquQ=; b=PxVcZpCv+XAc04MEs0lkmqwFu/8F1/LohE1rs93zt+h0tKgohL0LIZQDAHURG5SfuY Yr5M6z7Aq+H8z3n3Req3qKITaRvJjv5BExkSWdZR96fIWriMS1HGXmWQQ+G9IuENVP7O 3PbikLKyCk1kefJI0yx7RXLHEiTJTpvwS77NtSWw7qgCE5Rn7KO886m1Pnu+MG7C6bTy bEVgTdYhQOVFoUd7Ewn33fLgk9wzSwK+RoT31UGXiNT3unPOS3HDJN+X9+Ry7hVD0wTI reUbsrZn8BqrGIN3zhjrfbX69TqQC+NzNhTS+uRyM1JMt9l7rpLRPCDcRNJH3NFyBQPd Disg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id nv7-20020a17090b1b4700b00278f81e54cdsi1776518pjb.19.2023.11.03.07.05.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 07:05:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id E83588290996; Fri, 3 Nov 2023 07:05:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377789AbjKCODy (ORCPT + 99 others); Fri, 3 Nov 2023 10:03:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233470AbjKCODt (ORCPT ); Fri, 3 Nov 2023 10:03:49 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48355D56; Fri, 3 Nov 2023 07:03:46 -0700 (PDT) Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4SMMmm5jbnzMmKq; Fri, 3 Nov 2023 21:59:20 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Fri, 3 Nov 2023 22:03:43 +0800 From: Kefeng Wang To: Andrew Morton CC: , , Matthew Wilcox , David Hildenbrand , , Kefeng Wang Subject: [PATCH 02/18] uprobes: use mm_counter_file_folio() Date: Fri, 3 Nov 2023 22:01:03 +0800 Message-ID: <20231103140119.2306578-3-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20231103140119.2306578-1-wangkefeng.wang@huawei.com> References: <20231103140119.2306578-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 03 Nov 2023 07:05:05 -0700 (PDT) Use mm_counter_file_folio() to save one compound_head() call. Signed-off-by: Kefeng Wang --- kernel/events/uprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index 435aac1d8c27..e2d3c89cc524 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -188,7 +188,7 @@ static int __replace_page(struct vm_area_struct *vma, unsigned long addr, dec_mm_counter(mm, MM_ANONPAGES); if (!folio_test_anon(old_folio)) { - dec_mm_counter(mm, mm_counter_file(old_page)); + dec_mm_counter(mm, mm_counter_file_folio(old_folio)); inc_mm_counter(mm, MM_ANONPAGES); } -- 2.27.0