Hi,

I'm sending an email to discuss how to remove spinlock from a whole process of 
open/read/close of efi_pstore.

[Problem]

Current efi_pstore calls kmalloc() in a read callback while holding a spinlock, 
efivar->lock, in an open callback.
This means efi_pstore may deadlock if it sleeps in kmalloc().

Also, there is a comment that an efivar->lock shouldn't be held when calling 
kmalloc().

[Idea]

In a process of open/read/close, pstore creates some files in the directory of 
/dev/pstore.
So, memory allocations like kmalloc() are not avoidable.
 
My idea fixing this issue is removing spinlock from a whole process of 
open/read/close of efi_pstore.

Currently, efivar->lock protects two things, efivar->list and 
ops.[gs]et_variable().
But if we can revise locks of efivar as follows, we can fix this issue.

  - Introduce a new efivar->list_lock to protect efivar->list and RCU is used 
while searching it.

  - An existing efivar>lock protects just ops.[gs]et_variable() calls.

Any comments are welcome.

Seiji
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to