From patchwork Sat May 26 13:20:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 9000 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 8010423EB5 for ; Sat, 26 May 2012 13:22:50 +0000 (UTC) Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) by fiordland.canonical.com (Postfix) with ESMTP id 463E2A18A40 for ; Sat, 26 May 2012 13:22:50 +0000 (UTC) Received: by mail-ob0-f180.google.com with SMTP id un3so3478139obb.11 for ; Sat, 26 May 2012 06:22:50 -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=Srkp4oSWyS4SnnJND3ZGs4zgqEq8ttm+xv7+pDDRXs0=; b=ZR0IRLHx6BZpyMP7Y5b5Xru36xNKRt94RBlF0jAmSpxN1E2lObqR5X58UN79iiS6HC GNtTY89a/Quvkz1NIjOjpJHsd2DfENYvwL8Wg/xhbIO95GDejmTNjYO2Ut2XIQmoFv9B 9RI0K3Cw3DRQsOXkkYXYIG+NJLjxatFPqlU9+aiUhCCNsa7PkY3ssfbS8GpUca0jDh26 KQ57nRgxL1DA+PicGjh99cPuoE7tOwzIQrtDbJgS0kBenoWuHNsQweTmwmDFaR7QKcHI dqn9odMj0CdK42IRooeHC5Iu/517PcKM817gCz3wKb5ZcX2EnVkcjx1I8C06AzMH98EC htZw== Received: by 10.50.40.193 with SMTP id z1mr1009884igk.0.1338038569968; Sat, 26 May 2012 06:22:49 -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.24.148 with SMTP id v20csp86347ibb; Sat, 26 May 2012 06:22:49 -0700 (PDT) Received: by 10.68.217.233 with SMTP id pb9mr7978153pbc.59.1338038569239; Sat, 26 May 2012 06:22:49 -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 ro10si9941970pbc.312.2012.05.26.06.22.49 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 26 May 2012 06:22:49 -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 rr4so3292827pbb.37 for ; Sat, 26 May 2012 06:22:49 -0700 (PDT) Received: by 10.68.217.138 with SMTP id oy10mr7927868pbc.30.1338038569007; Sat, 26 May 2012 06:22:49 -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 po10sm12545638pbb.21.2012.05.26.06.22.46 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 26 May 2012 06:22:48 -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 10/11] pstore/platform: Make automatic updates interval configurable Date: Sat, 26 May 2012 06:20:28 -0700 Message-Id: <1338038429-21945-10-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.9.2 In-Reply-To: <20120526131747.GA15054@lizard> References: <20120526131747.GA15054@lizard> X-Gm-Message-State: ALoCoQleCdo8YxamGZfx1OiD8dYpGS2e7VQ1QWDQmSSWVny7vE1CPDQfERgH4oPOIzlBQ17Fz5dU 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 61461ed..34ca314 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; @@ -231,8 +235,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; } @@ -291,7 +298,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);