Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755609Ab2HQV2J (ORCPT ); Fri, 17 Aug 2012 17:28:09 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:36802 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754173Ab2HQV2B (ORCPT ); Fri, 17 Aug 2012 17:28:01 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Mike Waychison Date: Fri, 17 Aug 2012 14:27:40 -0700 Message-ID: Subject: Re: [RFC][PATCH 2/2] efi_pstore: Introducing workqueue updating sysfs entries To: Seiji Aguchi Cc: "linux-kernel@vger.kernel.org" , "Luck, Tony (tony.luck@intel.com)" , "Matthew Garrett (mjg@redhat.com)" , "dzickus@redhat.com" , "dle-develop@lists.sourceforge.net" , Satoru Moriya Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1640 Lines: 41 On Fri, Aug 17, 2012 at 2:15 PM, Seiji Aguchi wrote: > >> I'm not a fan of creating a periodic timer that wakes up here to check for an event that should be considered very rare. >> >> Can this just become scheduled work? Scheduling work itself is a very lightweight process and should be relatively safe to do from a >> pstore write. > > I agree that the periodic timer is heavy a bit. > But I would like to keep a write callback simple as much as possible in panic situation. > For example, I'm concerned that efi_pstore hangs up due to some spin_locks related workqueue like gcwq->lock. > > Also, a situation which this workqueue is needed is just oops case because, system will be down and users can't access to sysfs files > in other cases, panic, reboot and emergency_restart. > > So, Can I call schedule_work in oops case only as follows? > > efi_pstore_write() > { > > > if (reason != KMSG_DUMP_OOPS) > return; > > schedule_work() You could, but why not always just schedule_work()? If we are hosed by broken workqueue/scheduler locking, the user isn't going to see those files in sysfs either way :) If you are going to insist that we shouldn't schedule_work() in the other cases, I'd prefer: /* The user may want to see an entry for this write in sysfs. */ if (reason == KMSG_DUMP_OOPS) schedule_work(...); > > } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/