Messages in this thread |  | | | Date | Fri, 28 Oct 2011 14:33:47 -0400 | | From | Don Zickus <> | | Subject | Re: [RFC][PATCH v2 -next 2/2] Adding lock operations to kmsg_dump()/pstore_dump() |
| |
On Fri, Oct 21, 2011 at 05:21:35PM -0400, Seiji Aguchi wrote: > pstore_dump()/kmsg_dump() may be called everywhere in kernel. > So we have to care about following cases. > > - Panic path > In this case, Logging message process is serialized via smp_send_stop(). > So, we can bust spin_locks. > > Currently, kmsg_dump() may be called twice (KMSG_DUMP_PANIC and KMSG_DUMP_EMERGY) > So, for avoiding deadlock, I suggest to bust locks rather than skipping them. > > - NMI context > While a cpu is in NMI handler, other cpus may be running. > So, trylock should be called so that lockdep cheking works. > > - Process context > In this case, we can simply take locks.
It ain't pretty but it moves things towards a more reliable message dump. The odds of us needing to bust the spinlocks are really small. Most of the time no one reads the pstore filesystem.
I would love to figure out a prettier solution for this locking mess, but I can't think of anything. We have customers who want to utilize this technology, so I am trying to make sure it is stable and robust for now. A little selfish I suppose. But we are open to ideas?
Acked-by: Don Zickus <dzickus@redhat.com>
|  |