From patchwork Wed Nov 2 09:12:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 14134 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3504176wru; Wed, 2 Nov 2022 02:15:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5NAyWB0SMTFOzenZdTA/drpkcIwQlAEzRkCzJwb0EKJRL1kCJRQu9yBl+KNFTx9qRSf/fp X-Received: by 2002:a17:902:e1ca:b0:186:878e:3b03 with SMTP id t10-20020a170902e1ca00b00186878e3b03mr24223056pla.95.1667380503310; Wed, 02 Nov 2022 02:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667380503; cv=none; d=google.com; s=arc-20160816; b=fDYaC2oI9AG0uME2q3qhcpQdXK4VHuovt+9wHRsaUy+WieMova1HzIZ8RdMp+PX/IY c4kYiRnqz8Rqmmo2dnONQ25AfEJQmvFZNDR6upXh3g0rsaDSVUeVlwXbzzvxnNB7Fgnj GnQvPrNP7iBpr0BrdUDFFfTivUtNNSoHuFnPjbLj0Ke6daJ7tcoz7HtA4vGq4+GSZJCk adb7evYOB8l5IU7jvjmkxq0oITPeZL+hwWoRIJJQ6fElrWEChJjxTq9gjgvjIS16JGaL /Z29lMj02FSuk2OvmGmnQrcFwOvJ1Not74BsYNqsd6Zt0zHLiG+xDi7ktd5A05lIETCE h3Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=06Saxu+llcAwf1QI8k1oKeHyockoF7y2i5LjSBewS5k=; b=EWv1SonLvDEd2Y1h6W4EAB5mvGCKFDIfbaS17/gLJmygHP0InOaYKgV7INoexdMbJ8 KlaZfvBT2oXtbKb2I4S55p/Q9Ywcbc1Cc+PZwoMC5ZYOKtlQyUBpgR+bExi7QhBLrhXw iScmyHmyhyz1lnkaxNFEkAKTlQ79J/7lJJ7JHRFbqpAz+gO4vsvHcK8pGt0QY4sVmwvv wrgUMUubUm5A0f+y8Z287sAvLL8Dh46O/X+I9GpCcfBmrv64uBQmU8Fpti9GbteXQCz0 pj8t1Cz3vKlxTAKdTrdH07FkqriinsBzMwbUEHycJtAvAxEj6ek6KlXk+y2XIhVX+84l 3t1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Z+b39LgG; dkim=neutral (no key) header.i=@linutronix.de header.b=Uybz8V2h; 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=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id om8-20020a17090b3a8800b0020dcf30338fsi1996418pjb.96.2022.11.02.02.14.48; Wed, 02 Nov 2022 02:15:03 -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=@linutronix.de header.s=2020 header.b=Z+b39LgG; dkim=neutral (no key) header.i=@linutronix.de header.b=Uybz8V2h; 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=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231542AbiKBJOg (ORCPT + 99 others); Wed, 2 Nov 2022 05:14:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231129AbiKBJNI (ORCPT ); Wed, 2 Nov 2022 05:13:08 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00A0228E37; Wed, 2 Nov 2022 02:12:48 -0700 (PDT) Date: Wed, 02 Nov 2022 09:12:46 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1667380367; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=06Saxu+llcAwf1QI8k1oKeHyockoF7y2i5LjSBewS5k=; b=Z+b39LgGsSPADaUEHUKSzZfyDbOznRkHbeiZnixD4zxZ6CHTe/72brWOn7hwciVsvzzwJ7 amL1UjsgJGSwbrXWALe27SqDj1rOZoRWmTmT7TmQ5wqpXg/pa9U7wFHPRhcXypziNgTMor ppyM280hN7IWoIEdFiFP7mLeShkLZFSbDbukJZZDwXdMj8xvAeOgbcoFQP2XcxYxiIH62R PVwL8xcgfCbeNnsDUbq3T7IrTiuR+nnjemHxX0ZBn4xoYWiAZvYL6XXMXhdOu4zpB95oyC /XxicA5hEk2PwyuYWhZ6VdFejpQ4PIfc80vpRz6TNlVPSguSsblwC/gunad+7Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667380367; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=06Saxu+llcAwf1QI8k1oKeHyockoF7y2i5LjSBewS5k=; b=Uybz8V2hZuXRS5xyeTkuov9cE0xHnoTsMmU/dG6abAojEgDWQs6HTk8axzjQ3UCem0rFVz Rk1g3e9gEXXjBACA== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/mm] mm: Update ptep_get_lockless()'s comment Cc: Matthew Wilcox , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <166738036632.7716.16970239696245313783.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748375178869002775?= X-GMAIL-MSGID: =?utf-8?q?1748375178869002775?= The following commit has been merged into the x86/mm branch of tip: Commit-ID: 88993b1627f2a2205b2f3112c4d22448cd863df3 Gitweb: https://git.kernel.org/tip/88993b1627f2a2205b2f3112c4d22448cd863df3 Author: Peter Zijlstra AuthorDate: Thu, 26 Nov 2020 14:04:46 +01:00 Committer: Peter Zijlstra CommitterDate: Tue, 01 Nov 2022 13:43:59 +01:00 mm: Update ptep_get_lockless()'s comment Improve the comment. Suggested-by: Matthew Wilcox Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20221022114424.515572025%40infradead.org --- include/linux/pgtable.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index a108b60..c0b2900 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -300,15 +300,12 @@ static inline pte_t ptep_get(pte_t *ptep) #ifdef CONFIG_GUP_GET_PTE_LOW_HIGH /* - * WARNING: only to be used in the get_user_pages_fast() implementation. - * - * With get_user_pages_fast(), we walk down the pagetables without taking any - * locks. For this we would like to load the pointers atomically, but sometimes - * that is not possible (e.g. without expensive cmpxchg8b on x86_32 PAE). What - * we do have is the guarantee that a PTE will only either go from not present - * to present, or present to not present or both -- it will not switch to a - * completely different present page without a TLB flush in between; something - * that we are blocking by holding interrupts off. + * For walking the pagetables without holding any locks. Some architectures + * (eg x86-32 PAE) cannot load the entries atomically without using expensive + * instructions. We are guaranteed that a PTE will only either go from not + * present to present, or present to not present -- it will not switch to a + * completely different present page without a TLB flush inbetween; which we + * are blocking by holding interrupts off. * * Setting ptes from not present to present goes: *