Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp503441rdf; Fri, 3 Nov 2023 07:04:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH96NNK00BZhudpkdn0cuyx9otwVgvWbSYYMkYuxYEU3iEP1pbl5BrlUnCVn3OfMldl2ELB X-Received: by 2002:a05:6a20:938d:b0:171:c88a:890c with SMTP id x13-20020a056a20938d00b00171c88a890cmr22878652pzh.25.1699020287892; Fri, 03 Nov 2023 07:04:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699020287; cv=none; d=google.com; s=arc-20160816; b=BbeSyaCQP3f/xUwbgY+6Wv6D1UQucOzMvMxvPMSA+YLH6K0XeZ8fI7I8uUj/3yHY6u aDu21wQBUT1XmzrHwKqlvNfMNciQS/ZLLwC+yuZMoe5m0e3Iflkb2HH2MmZnyVc6bkSm IyUi3Kxq3GVF4x4sUFsoG1SNvledQeOrJkpKy0GetRoSL5ASmJbhsXgfDX9QaAEZ/y6E XoJK7YXIycS/wRaEpiV7oy78aQg31RN4+ZzzYOQUoeLbAlmEjoj0B9XwvJeDUJ9M3w2s 5If9/5H41/YFjklOrGg0OqmYVNzFCjxYXx30gqG+9aJCkshXrJDdLKXVH5uoCPwNKYfy N2EQ== 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=J/rSriB3aflAPXuP/oLdhUT4o9qoZ0PrxLn1lca2smA=; fh=kUj/5waaepfljbNx30rj2BALdV0u/mUCTaFWThlgquQ=; b=vg1lE05+snjjSI9Inldip8w77pWFW70BAQlJ36XQEzfl6TIWMdAAvSYLyxj0+mkQ5N uJPlPDXlRHGLfJXvJgUMNt1xYQRkNtgs7M4BIY+Y3cOZRYlDnbeQm0YDXpeS+Ak7yqUC htRAaA+9Rv20G6qjsR9u2833VPH/P21DIAU5ck96qw6YRAC7S4ZXGk5h/K9H7f1oKusC 9vxkfTgJlDdmP6/aUR/JOuTis5VEs14GxH3SNZ6zWvzPhGrKsitpnjJk69mceyP5eIR/ h8uUN586+e5edXHouX3EcWID26SyE0LnB2BNpRPPFg9tb8e9BnqCDSgO9T94q7ywD33y ekrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id l1-20020a656801000000b005b82de74216si1519687pgt.901.2023.11.03.07.04.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 07:04:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 08AC9829C987; Fri, 3 Nov 2023 07:04:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377885AbjKCOEH (ORCPT + 99 others); Fri, 3 Nov 2023 10:04:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377777AbjKCOD6 (ORCPT ); Fri, 3 Nov 2023 10:03:58 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54965D48; Fri, 3 Nov 2023 07:03:55 -0700 (PDT) Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4SMMpQ0R1Xz1P7pS; Fri, 3 Nov 2023 22:00:46 +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:47 +0800 From: Kefeng Wang To: Andrew Morton CC: , , Matthew Wilcox , David Hildenbrand , , Kefeng Wang Subject: [PATCH 11/18] mm: memory: use mm_counter_file_folio() in wp_page_copy() Date: Fri, 3 Nov 2023 22:01:12 +0800 Message-ID: <20231103140119.2306578-12-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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 03 Nov 2023 07:04:39 -0700 (PDT) Use mm_counter_file_folio() to save one compound_head() call. Signed-off-by: Kefeng Wang --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index d35ca499bf1c..661c649afc22 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3158,7 +3158,7 @@ static vm_fault_t wp_page_copy(struct vm_fault *vmf) if (likely(vmf->pte && pte_same(ptep_get(vmf->pte), vmf->orig_pte))) { if (old_folio) { if (!folio_test_anon(old_folio)) { - dec_mm_counter(mm, mm_counter_file(&old_folio->page)); + dec_mm_counter(mm, mm_counter_file_folio(old_folio)); inc_mm_counter(mm, MM_ANONPAGES); } } else { -- 2.27.0