public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
From: Alexandre Ghiti <alex@ghiti.fr>
To: Paul Walmsley <pjw@kernel.org>, Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] riscv: Use an atomic xchg in pudp_huge_get_and_clear()
Date: Mon, 22 Sep 2025 08:19:55 +0200	[thread overview]
Message-ID: <bfffde06-5d4c-4e2c-adfe-e48590bf2f3d@ghiti.fr> (raw)
In-Reply-To: <c8afb3b4-e5d5-628b-6bce-0b1b3137a667@kernel.org>

On 9/20/25 03:39, Paul Walmsley wrote:
> Hi Alex,
>
> On Thu, 14 Aug 2025, Alexandre Ghiti wrote:
>
>> Make sure we return the right pud value and not a value that could
>> have been overwritten in between by a different core.
>>
>> Fixes: c3cc2a4a3a23 ("riscv: Add support for PUD THP")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
>> ---
>> Note that this will conflict with
>> https://lore.kernel.org/linux-riscv/20250625063753.77511-1-ajd@linux.ibm.com/
>> if applied after 6.17.
> Two quick questions on this one:
>
> - I see that you're using atomic_long_xchg() here and in some similar
> functions in pgtable.h, rather than xchg().  Was curious about the
> rationale for that?


Both functions amount to the same, I just used the same function as for 
existing similar functions.


>
> - x86 avoids the xchg() for !CONFIG_SMP.  Should we do the same?


Sounds like micro optimization to me, but up to you.


>
> thanks,
>
> - Paul
>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

      reply	other threads:[~2025-09-22  6:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14 12:06 [PATCH] riscv: Use an atomic xchg in pudp_huge_get_and_clear() Alexandre Ghiti
2025-09-20  1:39 ` Paul Walmsley
2025-09-22  6:19   ` Alexandre Ghiti [this message]

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=bfffde06-5d4c-4e2c-adfe-e48590bf2f3d@ghiti.fr \
    --to=alex@ghiti.fr \
    --cc=alexghiti@rivosinc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=pjw@kernel.org \
    --cc=stable@vger.kernel.org \
    /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