From patchwork Sat Dec 17 18:55:34 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: 34246 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp1636375wrn; Sat, 17 Dec 2022 10:58:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf5CsD/T3u/ZwQFkOZS9TximjKVQn42bzz6Sxgspi92B5fqb6ApiC7jxxCgpeEOoogTmU2O0 X-Received: by 2002:a17:906:1d47:b0:7ad:9f03:b330 with SMTP id o7-20020a1709061d4700b007ad9f03b330mr19014139ejh.62.1671303516072; Sat, 17 Dec 2022 10:58:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671303516; cv=none; d=google.com; s=arc-20160816; b=UMrXbtM0UKGev/OoXGy/Su1U8DCJNAsTeyPfPaC281jCis9w91rVSffWInBDWuXNMd NfHLFV8q9+nTbozGK4IgKeZQQZCu2kx3zb8qaLEhk2yrY7fV0yXjw6lRhQjBON4C9COj BFWbYC8Y394YR+8OBvVnZTKYREqrAt7wwKWzewI8JIaV3gdcyinVXIpdMH0lnRbvccQC 5B9I3kpdWAsTljMhJ+J/bbj8yD9ksIhoLTjo3GJJN0gdQ71TntWwc7wDyDYdzrM0P4aG vogX/IqDG0Ke2J3BLdkoBWKs/b5EVA/WLKu1mZYoFJgTBPL/CsKbLzaXm4j/R2nxMeUG tbZg== 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=d0+esdgO6T9UxQJKcyAonNefuPC0/JggTFaq3f3GHfE=; b=pp9iO6X4L0WYJB2k2TzTGSol5TUgz/jECM967pWnxnItiSAwJRD44qNeaVUNuzP4X/ j1ps7RLQCBm9aXcwW5i+zgiS+gCJfr2lat620JDNhRV6cmh+xZ0VnWRBSOAPwWJbQtYt MJL4nIsrArAnK5UNPEizWK9lei4FofhjUU8n8xfp2kdGembI4vY6qcS3KvvXD9066owB l2j5ADeuSxPgjy39jksy0uUQzu1GTNHj59jKxBYEXyVUeF7dWUpDwJFYMPr+qmbUhwJW iN2ahpIKNUfWsWdjpZK8c7XerXIOgXumlyIndZW7OaPST/yrJWNeq7Y1WR9w4FyaBIqw h7Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WhCSEDXz; dkim=neutral (no key) header.i=@linutronix.de; 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 f4-20020a1709063f4400b0078b88453306si4616065ejj.285.2022.12.17.10.58.13; Sat, 17 Dec 2022 10:58:36 -0800 (PST) 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=WhCSEDXz; dkim=neutral (no key) header.i=@linutronix.de; 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 S230261AbiLQS52 (ORCPT + 99 others); Sat, 17 Dec 2022 13:57:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230080AbiLQSzk (ORCPT ); Sat, 17 Dec 2022 13:55:40 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A24B38E; Sat, 17 Dec 2022 10:55:38 -0800 (PST) Date: Sat, 17 Dec 2022 18:55:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1671303334; 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=d0+esdgO6T9UxQJKcyAonNefuPC0/JggTFaq3f3GHfE=; b=WhCSEDXz6NxyYUo3JvDlqcf5s6RWEY3P2K+5RnSJJ4WR5ihW7+QzuNe12mMCoGpXxgPZ6Y lGiOHJ/XsKvff3DfYWEYKt1pz2fuFv5dxv4vDcFsYEcFd1caNP0IsvwRf31zdpY9rhVl7Q 8fB3Ei9y+JRYXrD2bXP+ZPGJ90DG1kJmyiWKOAXgzoha10jo5lV3FI/+ZJqVw8KsUQu7yH ypxwNm3IPQv4p83xUxAx6QjII6pqKhGS8P1aMLpK2KI+H0qDpfvMq2XGivt/14bD27xZ0g o7Ew6hnS8Vw4vt/tW91QAD6Pu/qrZFQrK1DvjPAVbzewxBc78HeTHS7q59d1ew== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1671303334; 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=d0+esdgO6T9UxQJKcyAonNefuPC0/JggTFaq3f3GHfE=; b=DUlvk8sWlOPt/1SGEZ/iqcKCNlIcjcyWYlsTuCPPbj7OIZr+qR27eev2PUeL+wnvjYm/2e e3acgxqCabgAnUBw== 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: <167130333420.4906.9822372007953321398.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?1752488755465876262?= X-GMAIL-MSGID: =?utf-8?q?1752488755465876262?= The following commit has been merged into the x86/mm branch of tip: Commit-ID: 93b3037a1482758349f3b0431406bcc457ca1cbc Gitweb: https://git.kernel.org/tip/93b3037a1482758349f3b0431406bcc457ca1cbc Author: Peter Zijlstra AuthorDate: Thu, 26 Nov 2020 14:04:46 +01:00 Committer: Dave Hansen CommitterDate: Thu, 15 Dec 2022 10:37:27 -08: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: *