On Tue, 17 Oct 2023 at 11:44, Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> wrote: > > On Tue, Oct 17, 2023 at 09:42:13AM +0200, Ard Biesheuvel wrote: > > On Mon, 16 Oct 2023 at 23:39, Kirill A. Shutemov > > <kirill.shutemov@xxxxxxxxxxxxxxx> wrote: > > > > > > On Mon, Oct 16, 2023 at 06:55:41PM +0100, Matthew Wilcox wrote: > > > > On Mon, Oct 16, 2023 at 07:31:22PM +0300, Kirill A. Shutemov wrote: > > > > > v2: > > > > > - Fix deadlock (Vlastimil); > > > > > - Fix comments (Vlastimil); > > > > > - s/cond_resched()/cpu_relax()/ -- cond_resched() cannot be called > > > > > from atomic context; > > > > > > > > Isn't there an implicit cpu_relax() while we're spinning? Does this > > > > really accomplish anything? > > > > > > You are right. It is useless. I will drop it in v3. > > > > > > > I can drop that bit when applying the patch. > > > > One question I have is whether the sequence > > > > spin_lock_irqsave(&unaccepted_memory_lock, flags); > > ... > > spin_unlock(&unaccepted_memory_lock); > > arch_accept_memory(phys_start, phys_end); > > spin_lock(&unaccepted_memory_lock); > > ... > > spin_unlock_irqrestore(&unaccepted_memory_lock, flags); > > > > is considered sound and is supported by all architectures? > > I am not an locking expert and only tested it on x86. But what potential > issue do you see? > Not sure. It just looks slightly out of place, and I am curious whether all architectures tolerate this asymmetric use.