mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Ryan Roberts <ryan.roberts@arm.com>, linux-mm@kvack.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@redhat.com>,
	"Mike Rapoport (IBM)" <rppt@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: Drop unused set_pte_safe()
Date: Tue, 10 Sep 2024 14:45:54 +0530	[thread overview]
Message-ID: <05c53d3b-87d7-4a25-89cb-ae349c901244@arm.com> (raw)
In-Reply-To: <cae9c32d-c96e-463e-9375-91d9a7ad196a@arm.com>



On 9/10/24 14:38, Ryan Roberts wrote:
> On 10/09/2024 10:04, Anshuman Khandual wrote:
>> 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().
> 
> It would be good to add some comment here to mention that the macro was buggy
> due to doing direct dereferencing of the pte, and that if it were to be kept, it
> should have been updated to use a single call to ptep_get().

Makes sense, will update as suggested.

> 
> With that:
> 
> Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
> 
> Thanks,
> Ryan
> 
>>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: David Hildenbrand <david@redhat.com>
>> Cc: Ryan Roberts <ryan.roberts@arm.com>
>> Cc: "Mike Rapoport (IBM)" <rppt@kernel.org>
>> Cc: linux-mm@kvack.org
>> Cc: linux-kernel@vger.kernel.org
>> Signed-off-by: Anshuman Khandual <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)); \
> 
> 

  reply	other threads:[~2024-09-10  9:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10  9:04 Anshuman Khandual
2024-09-10  9:08 ` Ryan Roberts
2024-09-10  9:15   ` Anshuman Khandual [this message]
2024-09-10 17:20   ` Matthew Wilcox
2024-09-11 14:32     ` Ryan Roberts
2024-09-10  9:21 ` David Hildenbrand
2024-09-10 13:26 ` Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=05c53d3b-87d7-4a25-89cb-ae349c901244@arm.com \
    --to=anshuman.khandual@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®