lkml.org 
[lkml]   [2012]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectefi_pstore: question about how to remove spinlock from a whole process of open/read/close of efi_pstore
Date
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


\
 
 \ /
  Last update: 2012-08-24 22:01    [W:0.029 / U:0.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site