lkml.org 
[lkml]   [2023]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv2] efi/unaccepted: Fix soft lockups caused by parallel memory acceptance
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?

> +retry:
> spin_lock_irqsave(&unaccepted_memory_lock, flags);
[...]
> + spin_unlock_irqrestore(&unaccepted_memory_lock, flags);
> +
> + /*
> + * The code is reachable from atomic context.
> + * cond_resched() cannot be used.
> + */
> + cpu_relax();
> +
> + goto retry;

\
 
 \ /
  Last update: 2023-10-16 19:57    [W:0.154 / U:1.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site