Message ID | 20201220050340.849754-3-npiggin@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=Dsun=FY=kvack.org=owner-linux-mm@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6239C4361B for <linux-mm@archiver.kernel.org>; Sun, 20 Dec 2020 05:03:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 55A10233E2 for <linux-mm@archiver.kernel.org>; Sun, 20 Dec 2020 05:03:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55A10233E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EB0276B0070; Sun, 20 Dec 2020 00:03:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E357B6B0071; Sun, 20 Dec 2020 00:03:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D28F86B0072; Sun, 20 Dec 2020 00:03:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0004.hostedemail.com [216.40.44.4]) by kanga.kvack.org (Postfix) with ESMTP id B644B6B0070 for <linux-mm@kvack.org>; Sun, 20 Dec 2020 00:03:53 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 6EC3B824999B for <linux-mm@kvack.org>; Sun, 20 Dec 2020 05:03:53 +0000 (UTC) X-FDA: 77612468346.30.shade95_4904d692744c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 5590D180B3AA7 for <linux-mm@kvack.org>; Sun, 20 Dec 2020 05:03:53 +0000 (UTC) X-HE-Tag: shade95_4904d692744c X-Filterd-Recvd-Size: 3714 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by imf14.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Sun, 20 Dec 2020 05:03:52 +0000 (UTC) Received: by mail-pj1-f42.google.com with SMTP id l23so4518667pjg.1 for <linux-mm@kvack.org>; Sat, 19 Dec 2020 21:03:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eTtGfwmtISRbmkA52dcEacoFKDkkBe8Yu/+QuY7wSPw=; b=p0d0KQy6HqFzlhSUzQFABMGvp1vl6Jc+xuhwDiawwmrsc2dTtnXfiNAVkkAa4w1iRN ZdNaDm6OFbEAlOkU3rPhR7ViJgGNt2SDAO3Rj/nia1ajbWBJuVWwAUbEN37lZ/MXIUr7 gZ/cBamedNQ+Ek01WR9GK9zsDz6bFkVY9KEzeHV2UmcnBj8YxeEkiH8F3TJVtOQPWUPo wN0I6bZLtP+hkbpj8/17K6YF5a8BQcdv1VTfeD7rEJQgEVVTrIPzLdPqoNhCtWf7iLia G6W3VOLwmajp5GjQTEgtQwVE7955Rhwb1DNoIlgTpc20vUvSrGp4c8gyWhUsn7zBqcF9 nc3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eTtGfwmtISRbmkA52dcEacoFKDkkBe8Yu/+QuY7wSPw=; b=KsC3gbzJ668DM+sqER4JT2uwmawLO18vL6t4QFmaeQ+uHBI4Efy9Ecdhdjb9q7j2Tg Uaph9Ecq860CECt8vQPYHBj1JkvRKN0vawhC+cj3W/tIv/IyjjrIdz+Yb6ez7JYccJrD d+YrYLxiovM/IPFiUDWRh29xhNVzzX8cPmdbsBK2hcsScn7Sn2FF8zeE09B/+RnxwA6M ppp0WEOarkJOfuZhJi3a/uWBIzc7DuWyIqoFw1TvMnTakE18NA6Nh4PTQKk1ZdSYe8g+ zz6Wsgj16EObR7lsLq5fHqPIxe3avRWUxoj5iCgOmjgyKy14rf/Amuokz5NrXgWfE8b7 tnPA== X-Gm-Message-State: AOAM5336IkS9z/hlezyownXm4qyyAdwpaRILW+hFvVCZK1WxwhyQQ+3D zdLrOedDnvDGJ1gl0QrVLbsI6d6fz/U= X-Google-Smtp-Source: ABdhPJzrDV7x52odBKdmlD+s3BKDPflwaZDSp9uClYZTKuLZDjvj1+PHLmp47gRgSTUO18Lc5hpLIQ== X-Received: by 2002:a17:902:6b45:b029:d6:c43e:ad13 with SMTP id g5-20020a1709026b45b02900d6c43ead13mr11092879plt.77.1608440632098; Sat, 19 Dec 2020 21:03:52 -0800 (PST) Received: from bobo.ibm.com (193-116-97-30.tpgi.com.au. [193.116.97.30]) by smtp.gmail.com with ESMTPSA id a23sm11625185pjh.19.2020.12.19.21.03.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 21:03:51 -0800 (PST) From: Nicholas Piggin <npiggin@gmail.com> To: linux-mm@kvack.org Cc: Nicholas Piggin <npiggin@gmail.com>, Peter Zijlstra <peterz@infradead.org> Subject: [PATCH 3/3] mm: skip page_cpupid_reset_last atomic update if the value is already reset Date: Sun, 20 Dec 2020 15:03:40 +1000 Message-Id: <20201220050340.849754-3-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201220050340.849754-1-npiggin@gmail.com> References: <20201220050340.849754-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
[1/3] mm: prefix page_cpupid_reset_last as non-atomic
|
expand
|
diff --git a/include/linux/mm.h b/include/linux/mm.h index 6ece500464e0..c0a9e8de0738 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1382,6 +1382,9 @@ static inline void __page_cpupid_reset_last(struct page *page) static inline void page_cpupid_reset_last(struct page *page) { + if (page_cpupid_last(page) == (-1 & LAST_CPUPID_MASK)) + return; + page_cpupid_xchg_last(page, (1 << LAST_CPUPID_SHIFT) - 1); }
Improves performance of a PROT_READ -> PROT_READ|PROT_WRITE -> store microbenchmark (which goes via the wp_page_reuse fault path) by about 10% on a POWER9. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> --- include/linux/mm.h | 3 +++ 1 file changed, 3 insertions(+)