From patchwork Tue May 22 14:17:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 8885 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A610023F0A for ; Tue, 22 May 2012 14:21:01 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 75443A18B74 for ; Tue, 22 May 2012 14:21:01 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so6656685yhp.11 for ; Tue, 22 May 2012 07:21:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=nqNw4ee5CutRn4ZsuQk2emllLwp6955OY3g7HjF7NqE=; b=PgTa2om2PtkULw9ezGSnmU/UW6DG5+umWpSMUay62IEenNVvDyK5/KWSoQsJUAvkwk DE8CsatuzHMj6y8vRDt6Y3+gExXGnAMbP7EFhPGzvyn438Oab6KdsM1rF6WXOEdON8jW lxZi6iLSrC9h8QuMrbHFUaEfhTMhE36CXFh4LW7iuaF2Gswi/uqAUdm3W/KYAGkj6Zs3 //1TpfCMxF0v57LlYk8nHW8XiQQ+Xc4LeuMgijEef2UaO7Dt6CC5vN0o0GgJP7I+TVxM d7JWEyqOWV5Fe12Ou3iPhF7JXmVvfD13Ad8Pzg2kOticYsoQIINeAZgeCJvIFu1n7vxC yu6g== Received: by 10.43.59.205 with SMTP id wp13mr37612icb.57.1337696461160; Tue, 22 May 2012 07:21:01 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.35.72 with SMTP id o8csp369572ibd; Tue, 22 May 2012 07:21:00 -0700 (PDT) Received: by 10.50.186.134 with SMTP id fk6mr9978988igc.22.1337696460651; Tue, 22 May 2012 07:21:00 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id u7si13297842igw.62.2012.05.22.07.21.00 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 May 2012 07:21:00 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) smtp.mail=anton.vorontsov@linaro.org Received: by mail-pb0-f50.google.com with SMTP id rr4so10070401pbb.37 for ; Tue, 22 May 2012 07:21:00 -0700 (PDT) Received: by 10.68.190.39 with SMTP id gn7mr22830912pbc.5.1337696460260; Tue, 22 May 2012 07:21:00 -0700 (PDT) Received: from localhost (c-71-204-165-222.hsd1.ca.comcast.net. [71.204.165.222]) by mx.google.com with ESMTPS id qr2sm26865561pbb.19.2012.05.22.07.20.57 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 May 2012 07:20:59 -0700 (PDT) From: Anton Vorontsov To: Greg Kroah-Hartman , Kees Cook , Colin Cross , Tony Luck Cc: Arnd Bergmann , John Stultz , Shuah Khan , arve@android.com, Rebecca Schultz Zavin , Jesper Juhl , Randy Dunlap , Stephen Boyd , Thomas Meyer , Andrew Morton , Marco Stornelli , WANG Cong , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linaro-kernel@lists.linaro.org, patches@linaro.org, kernel-team@android.com Subject: [PATCH 15/16] pstore/platform: Make automatic updates interval configurable Date: Tue, 22 May 2012 07:17:58 -0700 Message-Id: <1337696279-8994-15-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.9.2 In-Reply-To: <20120522141717.GA31574@lizard> References: <20120522141717.GA31574@lizard> X-Gm-Message-State: ALoCoQn/O0xV/cd8r4XZX2tK2V49B0SOCcywX+ZwjtMDZJLcsGLdFS1mpsW7cxV7f3aiRNgYL7m3 There is no behavioural change, the default value is still 60 seconds. Signed-off-by: Anton Vorontsov Acked-by: Kees Cook --- fs/pstore/platform.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index a3f6d96..4f49bb4 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include "internal.h" @@ -40,7 +41,10 @@ * whether the system is actually still running well enough * to let someone see the entry */ -#define PSTORE_INTERVAL (60 * HZ) +static int pstore_update_ms = 60000; +module_param_named(update_ms, pstore_update_ms, int, 0600); +MODULE_PARM_DESC(update_ms, "milliseconds before pstore updates its content " + "(default is 60000; -1 means runtime updates are disabled)"); static int pstore_new_entry; @@ -227,8 +231,11 @@ int pstore_register(struct pstore_info *psi) kmsg_dump_register(&pstore_dumper); pstore_register_console(); - pstore_timer.expires = jiffies + PSTORE_INTERVAL; - add_timer(&pstore_timer); + if (pstore_update_ms >= 0) { + pstore_timer.expires = jiffies + + msecs_to_jiffies(pstore_update_ms); + add_timer(&pstore_timer); + } return 0; } @@ -287,7 +294,7 @@ static void pstore_timefunc(unsigned long dummy) schedule_work(&pstore_work); } - mod_timer(&pstore_timer, jiffies + PSTORE_INTERVAL); + mod_timer(&pstore_timer, jiffies + msecs_to_jiffies(pstore_update_ms)); } module_param(backend, charp, 0444);