1. 16 Aug, 2011 2 commits
    • Don Zickus's avatar
      pstore: change mutex locking to spin_locks · abd4d558
      Don Zickus authored
      pstore was using mutex locking to protect read/write access to the
      backend plug-ins.  This causes problems when pstore is executed in
      an NMI context through panic() -> kmsg_dump().
      
      This patch changes the mutex to a spin_lock_irqsave then also checks to
      see if we are in an NMI context.  If we are in an NMI and can't get the
      lock, just print a message stating that and blow by the locking.
      
      All this is probably a hack around the bigger locking problem but it
      solves my current situation of trying to sleep in an NMI context.
      
      Tested by loading the lkdtm module and executing a HARDLOCKUP which
      will cause the machine to panic inside the nmi handler.
      Signed-off-by: default avatarDon Zickus <dzickus@redhat.com>
      Acked-by: default avatarMatthew Garrett <mjg@redhat.com>
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
      abd4d558
    • Luck, Tony's avatar
      pstore: defer inserting OOPS entries into pstore · 6dda9266
      Luck, Tony authored
      Life is simple for all the kernel terminating types of kmsg_dump
      call backs - pstore just saves the tail end of the console log. But
      for "oops" the situation is more complex - the kernel may carry on
      running (possibly for ever).  So we'd like to make the logged copy
      of the oops appear in the pstore filesystem - so that the user has
      a handle to clear the entry from the persistent backing store (if
      we don't, the store may fill with "oops" entries (that are also
      safely stashed in /var/log/messages) leaving no space for real
      errors.
      
      Current code calls pstore_mkfile() immediately. But this may
      not be safe. The oops could have happened with arbitrary locks
      held, or in interrupt or NMI context. So allocating memory and
      calling into generic filesystem code seems unwise.
      
      This patch defers making the entry appear. At the time
      of the oops, we merely set a flag "pstore_new_entry" noting that
      a new entry has been added. A periodic timer checks once a minute
      to see if the flag is set - if so, it schedules a work queue to
      rescan the backing store and make all new entries appear in the
      pstore filesystem.
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
      6dda9266
  2. 14 Aug, 2011 13 commits
  3. 13 Aug, 2011 23 commits
  4. 12 Aug, 2011 2 commits