From patchwork Mon Sep 16 22:28:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 2899791 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8E9439F1C0 for ; Mon, 16 Sep 2013 22:30:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9AF0320131 for ; Mon, 16 Sep 2013 22:30:04 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 75C152012D for ; Mon, 16 Sep 2013 22:30:03 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VLhIK-0006Wd-7B; Mon, 16 Sep 2013 22:29:24 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VLhI7-00020J-JC; Mon, 16 Sep 2013 22:29:11 +0000 Received: from mail-pb0-f52.google.com ([209.85.160.52]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VLhHl-0001vh-5U for linux-arm-kernel@lists.infradead.org; Mon, 16 Sep 2013 22:28:51 +0000 Received: by mail-pb0-f52.google.com with SMTP id wz12so4622082pbc.25 for ; Mon, 16 Sep 2013 15:28:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZI+oKXOFcBle54owBSHwhkGPN0PdPchzos752rLzcso=; b=JwjfdxViTQNblsrrSZwPwldAFkAgdJ8quqipVt9yczLnTtNwnjgsoKOTZIVuzWsgD4 PyHQGBOJbi8SpKFKwZFsdKsb3Bp2pJTbiSunIPIqYMtw6yf8xPY14Pq5dHeS0TUTyvtH 0m2NFaJ+MMLiqXNwf7R9KeqAWTOf1ql/DFukcSySODRizginFJfDPzgD72sDuEjLdHuN LtlWYl7RbOJS6I2JLzFcWZMNJ4jpQedjaLiJpVUgHFICuEOYmkPbq3jxzezSJEGqCyKo hvIa1PWvCqaRW81IcaVuSjR/ms3pPVBtnnWhCTOEdn++iqEw+axXqtDWscaB7LyCvA0R 5sew== X-Gm-Message-State: ALoCoQkBCqTnCvRCGTEqfOT6UNo7TgMXsQVYPHP0igz3mBRw59UXR0hFu2UAvk5WWwtRGAmwVBFX X-Received: by 10.68.234.130 with SMTP id ue2mr5068673pbc.159.1379370512764; Mon, 16 Sep 2013 15:28:32 -0700 (PDT) Received: from localhost (c-24-19-7-36.hsd1.wa.comcast.net. [24.19.7.36]) by mx.google.com with ESMTPSA id a5sm33606354pbw.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 16 Sep 2013 15:28:32 -0700 (PDT) From: Kevin Hilman To: Frederic Weisbecker , Russell King Subject: [PATCH 3/4] full_nohz: Kconfig: add HAVE_VIRT_CPU_ACCOUNTING_GEN Date: Mon, 16 Sep 2013 15:28:21 -0700 Message-Id: <1379370502-30376-4-git-send-email-khilman@linaro.org> X-Mailer: git-send-email 1.8.3 In-Reply-To: <1379370502-30376-1-git-send-email-khilman@linaro.org> References: <1379370502-30376-1-git-send-email-khilman@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130916_182849_372147_02C5AB41 X-CRM114-Status: UNSURE ( 9.71 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: Paul McKenney , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With HAVE_VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit. In order to use that feature, arch code should be audited ensure there are no races in concurrent read/write of cputime_t. For example, reading/writing 64-bit cputime_t on some 32-bit arches may require multiple accesses, so proper locking is needed to protect against concurrent accesses. Therefore, add CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN which arches can enabled after they've been audited for potential races. This option is automatically enabled on 64-bit platforms. Feature requested by Frederic Weisbecker. Cc: Frederic Weisbecker Signed-off-by: Kevin Hilman --- arch/Kconfig | 11 +++++++++++ init/Kconfig | 1 + 2 files changed, 12 insertions(+) diff --git a/arch/Kconfig b/arch/Kconfig index 1feb169..3c94a2d 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -356,6 +356,17 @@ config HAVE_CONTEXT_TRACKING config HAVE_VIRT_CPU_ACCOUNTING bool +config HAVE_VIRT_CPU_ACCOUNTING_GEN + bool + default y if 64BIT + help + With HAVE_VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit. + Before enabling this option, arch code must be audited + ensure there are no races in concurrent read/write of + cputime_t. For example, reading/writing 64-bit cputime_t on + some 32-bit arches may require multiple accesses, so proper + locking is needed to protect against concurrent accesses. + config HAVE_IRQ_TIME_ACCOUNTING bool help diff --git a/init/Kconfig b/init/Kconfig index e9cd23b..7c283a5 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -355,6 +355,7 @@ config VIRT_CPU_ACCOUNTING_NATIVE config VIRT_CPU_ACCOUNTING_GEN bool "Full dynticks CPU time accounting" depends on HAVE_CONTEXT_TRACKING + depends on HAVE_VIRT_CPU_ACCOUNTING_GEN select VIRT_CPU_ACCOUNTING select CONTEXT_TRACKING help