From patchwork Wed Oct 2 12:37:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 2974671 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 327749F2B8 for ; Wed, 2 Oct 2013 12:39:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 08D09202FF for ; Wed, 2 Oct 2013 12:38:59 +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 33CFD20399 for ; Wed, 2 Oct 2013 12:38:54 +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 1VRLhP-0005nT-Ng; Wed, 02 Oct 2013 12:38:39 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VRLhM-0007KZ-Fs; Wed, 02 Oct 2013 12:38:36 +0000 Received: from mail-we0-x230.google.com ([2a00:1450:400c:c03::230]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VRLh9-0007Fe-Jz for linux-arm-kernel@lists.infradead.org; Wed, 02 Oct 2013 12:38:24 +0000 Received: by mail-we0-f176.google.com with SMTP id u56so832127wes.7 for ; Wed, 02 Oct 2013 05:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PpL+PFmG6GCh0bgYcFVD1seINphXXAPXzqVKTfNlFeQ=; b=xs3K9NKFy7ofcT9XtGtgxDNaTaoQiIrxTZDeB4q/n5TInVcQ0PA40OI1CrUkR9ohUV 4PZuhXhT7P14x1TyiWUzs5frWKGR6cnMcDMJBgk5DP6jxtsTxePAVKPOpDsEnZWZLvgS 8deOswqeBjuowesbOJdMtRJx9iSaJORCDJT2+sCNMFm9wMKkc8kSdMoEgV1z0lOTop6F 2NhEFuYEUJUuW6LY953SZOM9ZVCXcLOk7c0X89mdByJCCs7DTxDksGUpeFdjcpLGuUJd CtNCNYIUfj9Ms/0JAc9/9ohGdFSm51PyK2qaBQK4pk/e0PGD3CAkHSXR1+pueiGjjUFm ZHpA== X-Received: by 10.194.122.168 with SMTP id lt8mr150233wjb.76.1380717481924; Wed, 02 Oct 2013 05:38:01 -0700 (PDT) Received: from localhost.localdomain (64.104.89.79.rev.sfr.net. [79.89.104.64]) by mx.google.com with ESMTPSA id b7sm3172292wiz.8.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 02 Oct 2013 05:38:01 -0700 (PDT) From: Frederic Weisbecker To: Ingo Molnar Subject: [PATCH 1/3] vtime: Add HAVE_VIRT_CPU_ACCOUNTING_GEN Kconfig Date: Wed, 2 Oct 2013 14:37:53 +0200 Message-Id: <1380717475-11505-2-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1380717475-11505-1-git-send-email-fweisbec@gmail.com> References: <1380717475-11505-1-git-send-email-fweisbec@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131002_083823_789452_B775129E X-CRM114-Status: GOOD ( 12.44 ) X-Spam-Score: -2.0 (--) Cc: Kevin Hilman , Frederic Weisbecker , LKML , Russell King , "Paul E. McKenney" , Arm Linux 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.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Kevin Hilman With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit. In order to use that feature, arch code should be audited to 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 for low and high value parts, so proper locking is needed to protect against concurrent accesses. Therefore, add CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN which arches can enable after they've been audited for potential races. This option is automatically enabled on 64-bit platforms. Feature requested by Frederic Weisbecker. Signed-off-by: Kevin Hilman Cc: Ingo Molnar Cc: Russell King Cc: Paul E. McKenney Cc: Arm Linux Signed-off-by: Frederic Weisbecker --- arch/Kconfig | 12 ++++++++++++ init/Kconfig | 1 + kernel/time/Kconfig | 1 + 3 files changed, 14 insertions(+) diff --git a/arch/Kconfig b/arch/Kconfig index af2cc6e..185f8b0 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -353,6 +353,18 @@ config HAVE_CONTEXT_TRACKING config HAVE_VIRT_CPU_ACCOUNTING bool +config HAVE_VIRT_CPU_ACCOUNTING_GEN + bool + default y if 64BIT + help + With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit. + Before enabling this option, arch code must be audited + to 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 3ecd8a1..68c1a0e 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 && 64BIT + depends on HAVE_VIRT_CPU_ACCOUNTING_GEN select VIRT_CPU_ACCOUNTING select CONTEXT_TRACKING help diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig index 2b62fe8..f148475 100644 --- a/kernel/time/Kconfig +++ b/kernel/time/Kconfig @@ -101,6 +101,7 @@ config NO_HZ_FULL depends on HAVE_CONTEXT_TRACKING # VIRT_CPU_ACCOUNTING_GEN dependency depends on 64BIT + depends on HAVE_VIRT_CPU_ACCOUNTING_GEN select NO_HZ_COMMON select RCU_USER_QS select RCU_NOCB_CPU