Re: [PATCH] mm/page_alloc: Use write_seqlock_irqsave() instead write_seqlock() + local_irq_save().

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2023-06-23 19:36:55 [+0900], Tetsuo Handa wrote:
> /*
>  * Zonelists may change due to hotplug during allocation. Detect when zonelists
>  * have been rebuilt so allocation retries. Reader side does not lock and
>  * retries the allocation if zonelist changes. Writer side is protected by the
>  * embedded spin_lock.
>  */
> 
> is not accurate. Something like below?
> 
>   If !RT, reader side does not lock and retries the allocation if zonelist changes.
>   If RT, reader side grabs and releases the embedded spin_lock in order to wait
>   for zonelist change operations to complete.

I wouldn't sprinkle it around the code. It is implementation specific
for PREEMPT_RT and documentation wise it would belong to
	Documentation/locking/seqlock.rst

I don't think extra knowledge benefits the code. If this piece if
information is needed I would suggest to include it to the original
documentation for seqlock. 

> Hmm, I feel worried that kmalloc(GFP_ATOMIC) from hard IRQ context
> might sleep if RT...

Relax and don't worry. PREEMPT_RT does not allow (or has afaik) memory
allocations from hard IRQ context (or preempt-disable sections).

Sebastian




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux