From patchwork Tue Sep 10 10:10:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 13798256 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 AFC59ECE564 for ; Tue, 10 Sep 2024 10:10:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 317648D0054; Tue, 10 Sep 2024 06:10:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C8158D002B; Tue, 10 Sep 2024 06:10:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B6138D0054; Tue, 10 Sep 2024 06:10:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id F02438D002B for ; Tue, 10 Sep 2024 06:10:47 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 713201614CC for ; Tue, 10 Sep 2024 10:10:47 +0000 (UTC) X-FDA: 82548409734.03.AE56462 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf23.hostedemail.com (Postfix) with ESMTP id 693A5140008 for ; Tue, 10 Sep 2024 10:10:44 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf23.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725962943; h=from:from:sender: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:references; bh=XhO/T4q+EDgUcZdcWlULbsRZXZbTQPjhHCjDT5+nsOE=; b=GyyCECKQcPRqctRT0ZZPkSAJd4TcrgRFWz4SOX4mF2IIUuofg943TOMFVOhZzpQJH9Zd02 ccNMcTVvSDdXxil/r/u/HAk53JmTa7fhSjnl3wZgQtjDjOEbwdAJVLAbIIfJPw+U0JRNlU n14z/yy0lkwn3Tsk6JsHWi6cxfB4VVg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725962943; a=rsa-sha256; cv=none; b=qk5iKutIMVEdBewUGWwtQlmr//pd0oQYs2DovLN0roIv7HB3FqqwHy1rvWv4e2DiVVRa0C U2BjPtLSphsvf/fNWy9IMymMy4rwFPoDVG1/Mp3/FGKq33P97xp6S46ppvA1sFSkRhvIFb W5hOkXf0B5hZZlNCYJrLNFZupK6io5s= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf23.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7AF9D106F; Tue, 10 Sep 2024 03:11:12 -0700 (PDT) Received: from a077893.arm.com (unknown [10.163.63.106]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 50E4A3F66E; Tue, 10 Sep 2024 03:10:40 -0700 (PDT) From: Anshuman Khandual To: linux-mm@kvack.org Cc: Anshuman Khandual , Andrew Morton , David Hildenbrand , Ryan Roberts , "Mike Rapoport (IBM)" , linux-kernel@vger.kernel.org Subject: [PATCH V2] mm: Drop unused set_pte_safe() Date: Tue, 10 Sep 2024 15:40:26 +0530 Message-Id: <20240910101026.428808-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: 693A5140008 X-Stat-Signature: akjfd4pt5nreqy641psmxkzf9e4ag9pg X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1725963044-344981 X-HE-Meta: U2FsdGVkX19JJYsTlFlPI/ryzDJUYTHlpzl+N7HFrtFi9eKjmMfH3Kat03QNwNtu8lPluNlS6xNk51drSvF6dIRUsHmYhrPovNZ5tQ76Rd8+BlT9nioqz0H1etNcyhKuZ8ZHzQ5ZYbTbuh3KNgMvhXUccjEYeZ0oo3BVTpKGDKdc1OP5bvO3sTmFyV5ltMg3jD5f0n3wpildrxgpCWBMmkX/6oK674rKhkaAKTQykw9P5Q/Qg0BauJnwF8KEBLAjtTQbXajtzhzqyc4b/8vDuI5zeVxVvpjeM89iVf9Hx3/4KvSQvgSjZJYT6vFukw0r+wMbWylR5rf61QNZYX19/ZXlAonh/7DeKol1sTIEL8zBiQ39yQ6xWDfFB1KiioUQBiKUSFKKwOOzTnp0XYG3N4caAa1en7ZqztEmiSAxUpCs0k1nplN+8S5zuBNYM+u0thLZm3dG1avgH2HLUvi9wp3iKzzawRCLHEHJormj9kKzd/xfDGs0jFIIsMTdEk3fnQnzJR3qMqDTQRCdHfg7/qh4Y21d3u7J3iSgAHQulI+26HqBuQRyTbEEpy906HsHUQ74LEp9dLiHu0zl7xMMEWezX/21uQDnhX3h5KTXS5SgyINTFSdpithpH0gAd5TFIobcqOGB0qB409N6Qf4XBaxH70VERIqv3TOG8hU/cMDaJ2J1c+F/SKUAn4+G2u5t7ZOKapqRURtWEGydoh0QArm9wL30vH2Oy0YSR5JmvBhzL/5GLATyUyEd0trKwggHWwG4hKuajNRRYQBI7oSy08T83JNWjM3HjbK10Tyneo7LQ2iRm3LSHPNRByqOtH3ggpq7X0GvbNZm+5oFqTzRQYrJIlK+qUGdDM4uYusjLYzPPoUpLW6JFzXiF1lY/9bRV5kz4Gq+Jzpl/ZPkMs4NoFhi/0cm3Yn6DFbSfCLNvAHQ3ryg6C8uNbPSu0vjAj6xm9RvcrjeT7q9d42ryoo dS1yWf2z qbwbxOG9o8KoO5Oojn/VKnBQB6H8efguRO9dpZsEgzXWI+xWhsPWSpw6yMqVCLh+cEZoROZNECi7bh3qNKuP4/S0mgszlO0sGDow14TojjJ95RVdLzvezlzYhser8cHNuq2KxbWtethA/rug1Oqa7s7UaOtTUzrAUI6SuBfKGm8WPuSiklUwHofg4FmG2n7ntPY3k8ENutbEzbjJFIOxOTNcxZTEUsFTjgwFUo7PbvmnZyOCPu4yx+/92Dkd8a1udNflrJSxWzwI7qhQzRpXtWpgNNj8wvxo7dJUC1pnaw0BlsgHD/45mo+/N5v8GD3JFa+ejws7zHNdO8sASEM8g5MO8cg/uIpxFL/xmKnDNkvVooYk= 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: List-Subscribe: List-Unsubscribe: All set_pte_safe() usage have been dropped after the commit eccd906484d1 ("x86/mm: Do not use set_{pud, pmd}_safe() when splitting a large page") This just drops now unused helper set_pte_safe(). Besides this macro was buggy due to doing direct dereferencing of the pte, and if it were to be kept, it should have been updated to use a single call to ptep_get(). Cc: Andrew Morton Cc: David Hildenbrand Cc: Ryan Roberts Cc: "Mike Rapoport (IBM)" Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Ryan Roberts Reviewed-by: David Hildenbrand Signed-off-by: Anshuman Khandual --- Changes in V2: - Updated the commit message per Ryan Changes in V1: https://lore.kernel.org/all/20240910090409.374424-1-anshuman.khandual@arm.com/ include/linux/pgtable.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 2a6a3cccfc36..aeabbf0db7c8 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -1058,12 +1058,6 @@ static inline int pgd_same(pgd_t pgd_a, pgd_t pgd_b) * same value. Otherwise, use the typical "set" helpers and flush the * TLB. */ -#define set_pte_safe(ptep, pte) \ -({ \ - WARN_ON_ONCE(pte_present(*ptep) && !pte_same(*ptep, pte)); \ - set_pte(ptep, pte); \ -}) - #define set_pmd_safe(pmdp, pmd) \ ({ \ WARN_ON_ONCE(pmd_present(*pmdp) && !pmd_same(*pmdp, pmd)); \