From patchwork Thu Jul 28 20:45:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 12931712 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08269C19F2A for ; Thu, 28 Jul 2022 20:45:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 97BC76B0078; Thu, 28 Jul 2022 16:45:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B77D6B007B; Thu, 28 Jul 2022 16:45:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BBDB6B007D; Thu, 28 Jul 2022 16:45:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 538A46B0078 for ; Thu, 28 Jul 2022 16:45:31 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 256F8120F91 for ; Thu, 28 Jul 2022 20:45:31 +0000 (UTC) X-FDA: 79737689262.13.A641651 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by imf29.hostedemail.com (Postfix) with ESMTP id C1C4212009A for ; Thu, 28 Jul 2022 20:45:30 +0000 (UTC) Received: by mail-pg1-f175.google.com with SMTP id bh13so2439660pgb.4 for ; Thu, 28 Jul 2022 13:45:30 -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=OQT725Dsba8bP1X8waqhq7M95kmgIB65Umvg7bxMYKdZ2A55gOSF7JKOO7VDAEWb03 te1tUI1AHjAjiMejggQvyT1ynwUtu1DA0YE02XNyJZokDCT3fMrewndp0jg0t2xTuHVV Jrw66/Z/2RPPfTkr9mLjhZYWd3Ppqmucc7lXY7dV9yzEwzUtojxkZ3N44+H/d2lYzOXt cvOzwyy+8RTnlhov4Qu+/VAjNNde0003EMwhRCsS8hrz6bhfeGlG7mmnQQPBRqvWRaJw OVlujEb8qI/y5IiLQglWY0fJnlaAK/X9dkOXQW++CmOUW7yl7gcPdtt/DAuBKqiXeGE/ PR4Q== X-Gm-Message-State: AJIora863PvI3+w06Ndt7vzAgP/UFUbKwgbcFx5kbxVt32rtU+iEaxlQ fYYxHWTrVZcv41cR00mHvrHTFEVE/rMJoRpwgKo= X-Google-Smtp-Source: AGRyM1tXOVFNxoBFYbFBHG8eOFa0LJHrKzg+SUCMnYmaLeI2rBEw1bFu/iUgd6WGY5hnPF0K96m9AQ== 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659041130; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=PxrkjbDitHfD1d97Y8UhQKa79eOpeGRQUks9O/4b63c=; b=C9Z1eCFr3mdoq6vjOvvcKojluzekadG1nSxXvKLqPnrfMP6zoFYyF5XESUrZ7aqZ+IrXKG IXAznbdCYvjBVMKvuYnow8JNG/osUVhN4n2S/IAppII7YXR7QM+WLifPzjqWAIQfYwSNNP RmP3xGvRwU2oyjKC/AxiiQM6br7MAEc= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=n16KoPlv; spf=pass (imf29.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.215.175 as permitted sender) smtp.mailfrom=ryncsn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659041130; a=rsa-sha256; cv=none; b=pweuE+jPAmG9Q4f5nshFdNoT+zabvuURwWPDANEqSG2NF8330v+5E5TA7kvR6sTI4O6t1S NfZkixLcMdxN4tJQ1afsahUEpUL9oOAKZe+yeOiwcj4FRCrBBf09KV6xfDjZ20fxD4gVrc scdWLOe6HJoeM/EW8a3MbOi9XRs/qjE= X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: C1C4212009A X-Rspam-User: Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=n16KoPlv; spf=pass (imf29.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.215.175 as permitted sender) smtp.mailfrom=ryncsn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: 61hnjwi8i8r6rpmiu9ay6ui95zrkf63i X-HE-Tag: 1659041130-772527 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000091, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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); /*