Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp725319imn; Thu, 28 Jul 2022 13:58:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vqSEksz48aAnEA3a6H2BkcWdHd9c/IBMEj0/24jh11IRAtiGxww/QwzCp0pRYhfj0SaHwP X-Received: by 2002:a17:906:9b93:b0:72b:8fad:6cf8 with SMTP id dd19-20020a1709069b9300b0072b8fad6cf8mr508223ejc.415.1659041921391; Thu, 28 Jul 2022 13:58:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659041921; cv=none; d=google.com; s=arc-20160816; b=I33aHjLShfuCt+eee5JSYTAal3dyeyQnnrVtwr++RRbkCvzws7mZvl4hlxe8yHVEWx ZWnL06AohsSR6oK44rWidVeozbRvY5t9T3Rs4sQEmsfxZYSo85tfksRdEd4wi/NOE/aV WJG5ZwGDhJXYtlIzpA1xHgPXLqV5IxAfhgJ20ifBAXjhM8lzQBYCUmneZC7Hh4bUYZZZ JzluV8e/2byMx0dcGouY3nMxnFZqvU1upnaSohZyRoARAs8fA/LXZIRaL/M8F7LgL5Y2 r5ZHt0Bgf0gSpYamrxMcFWydiThoEDoEUNnoizDoeCQROS13GFei4xEN3GfN6t55EojO gZaA== 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:reply-to :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PxrkjbDitHfD1d97Y8UhQKa79eOpeGRQUks9O/4b63c=; b=MGvbdA0VlU3bfSRwDD9vjIBEBbrnZ1+3tqzLSxR8BX6ur5Ra/0rQTRx8Oig9hfvRoF DUuHQWnN3XZ5djh3FVCvp40TH5H4S67m2dZr50JEtUNLy50VsIPTYw80iSW3nt5Fp5qx LTj3VgGdW9vWM53sx5Pt8adzEBsdKvJ0SdgE6G4ZYuXZrr5ONcmktNnPcYItahlxZN7j x9533HxtmzJFRZKJZcOX0NiOvnpXPBYOpiYtWU8xQRs7SbjAL3w4fVB1Ie7Wwf+8127z jWwKOHFbPE72Xj25AbWDZRWYKtojsb6N6zUxpljOgu/BL5mhwstQm12wpBZQbq+i3w1E uqQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=n16KoPlv; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y21-20020a056402441500b0043cfed4d661si1508440eda.358.2022.07.28.13.58.09; Thu, 28 Jul 2022 13:58:41 -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=@gmail.com header.s=20210112 header.b=n16KoPlv; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233090AbiG1Upp (ORCPT + 99 others); Thu, 28 Jul 2022 16:45:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232760AbiG1Upe (ORCPT ); Thu, 28 Jul 2022 16:45:34 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39BCD6B248 for ; Thu, 28 Jul 2022 13:45:30 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id 72so2469930pge.0 for ; Thu, 28 Jul 2022 13:45:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=PxrkjbDitHfD1d97Y8UhQKa79eOpeGRQUks9O/4b63c=; b=n16KoPlvBzd95MUn2w14Fg7+fI/TRVKK4xnSvA1Ck0fepbOeZl/M1zr2wzFKrwzRoq hgiUJNCFAhbYqljsgcuOFgUMTqg2+GGDVdxORVxkRtRM5ukuktVVziFfmfOiI1dDDILQ n308kWjnEH/SwP73po2piDXPGtObpbKY0zQLIu0bNzlHTs+TIt4545L7oDmfDKOmsb0C XTM7XFMODx5xPDR18Ao7XwDiOQ51/ooNyCvekRdjy0WNutaBFsNfvk+XVar9aHhoib09 FfYr3yRD0X8UgeNpPGScXUD9sMNcjHqLVvRQ4o3MhqABKodGl6F3wZKKcJ8vytC4mWjU LGDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=PxrkjbDitHfD1d97Y8UhQKa79eOpeGRQUks9O/4b63c=; b=rQjgAk1+S7EKmt1/Df3muvdtzuOTBr4b65z350Sn7VIoDwRYfTr43bcDO1AfRb85wY px5i8moZ8BgTdc/c47Q1A6a0lxZq1k7cqZbHVrOkTw1bqIUOsJDsDytyec2OirIfZvc7 kBrYj5YFo2RK8hIlx1uzqY6j8ZrriUz5g//bGXuMq5quwqSOIC2lAmyodUEKHN5hG6aU zvQUDwe+rMVbIoY4LBEuJjXzrpgair+C9hRzhmA5JMR6jODGCuUKbLbML7eYFUO1RBtC B0aU8L4pr2pU1QzXcDlXs3gFGkK4oTmz0ARwOBMTdSUolFUD4HnN1j1cI84hBQshg+iz eokw== X-Gm-Message-State: AJIora+/I3lpTPsdkF2i7NhSStqtlZ/iJ8qsCwAcEaAbBDiRnITx5Es8 45p2YJs2N4iPQ+i7IKIjbZw= X-Received: by 2002:a63:4004:0:b0:41b:64ff:7fe2 with SMTP id n4-20020a634004000000b0041b64ff7fe2mr419118pga.172.1659041129567; Thu, 28 Jul 2022 13:45:29 -0700 (PDT) Received: from KASONG-MB0.tencent.com ([114.254.3.190]) by smtp.gmail.com with ESMTPSA id 21-20020a170902c11500b0016c40f8cb58sm1787304pli.81.2022.07.28.13.45.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 28 Jul 2022 13:45:29 -0700 (PDT) From: Kairui Song To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Andrew Morton , Kairui Song Subject: [RFC PATCH 5/7] mm: try use fast path for pmd setting as well Date: Fri, 29 Jul 2022 04:45:09 +0800 Message-Id: <20220728204511.56348-6-ryncsn@gmail.com> X-Mailer: git-send-email 2.35.2 In-Reply-To: <20220728204511.56348-1-ryncsn@gmail.com> References: <20220728204511.56348-1-ryncsn@gmail.com> Reply-To: Kairui Song MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 From: Kairui Song Use the per-CPU RSS cache helper as much as possible. Signed-off-by: Kairui Song --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index f00f302143b6..09d7d193da51 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4419,7 +4419,7 @@ vm_fault_t do_set_pmd(struct vm_fault *vmf, struct page *page) if (write) entry = maybe_pmd_mkwrite(pmd_mkdirty(entry), vma); - add_mm_counter(vma->vm_mm, mm_counter_file(page), HPAGE_PMD_NR); + add_mm_counter_fast(vma->vm_mm, mm_counter_file(page), HPAGE_PMD_NR); page_add_file_rmap(page, vma, true); /* -- 2.35.2