From patchwork Mon Sep 30 14:06:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 2965251 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 E5AF79F288 for ; Mon, 30 Sep 2013 14:09:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51BC4201C8 for ; Mon, 30 Sep 2013 14:09:07 +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 0F946200EA for ; Mon, 30 Sep 2013 14:09:06 +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 1VQe8t-0006Zy-Q6; Mon, 30 Sep 2013 14:08:08 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VQe8h-0004DI-Bf; Mon, 30 Sep 2013 14:07:55 +0000 Received: from mail-wg0-x22d.google.com ([2a00:1450:400c:c00::22d]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VQe8E-00049R-Co for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2013 14:07:28 +0000 Received: by mail-wg0-f45.google.com with SMTP id y10so5700257wgg.0 for ; Mon, 30 Sep 2013 07:07:00 -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=Xtp+25uDs+cRhlnqDVYU3L71nzQXZDga2xDSJsbA0ao1piF6xi6I1Id5YgDFCg7rH9 VkrwSZZcp9M2cCHyl3x5RTE7uMP3S9iVxTbjC4AxfWIx1c8NuKMp4R7XhN7xJYsTdh2/ n1+NRGSBlXEMPubWm1q0ZiRtVtedWdo4AivOC3qHRvdiZlGr/+yqLKM1j+hHZDCNdGec FwdTNroQhLzo8+oekPo0tQ5q/SJ0yPGQntTM4Z3k8X0yPGFzqvhh4Ky+NYwuJhnImdXr L6xA0gea5XdvN/03LUm0mI0mrUVvSTOOHkXZTkLgnUBG/2MsXkzomIcK6Tclc/Fxz2Z9 LHmA== X-Received: by 10.194.241.228 with SMTP id wl4mr18034021wjc.2.1380550020740; Mon, 30 Sep 2013 07:07:00 -0700 (PDT) Received: from localhost.localdomain (64.104.89.79.rev.sfr.net. [79.89.104.64]) by mx.google.com with ESMTPSA id b11sm26341418wik.1.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 30 Sep 2013 07:07:00 -0700 (PDT) From: Frederic Weisbecker To: Kevin Hilman Subject: [PATCH 1/3] vtime: Add HAVE_VIRT_CPU_ACCOUNTING_GEN Kconfig Date: Mon, 30 Sep 2013 16:06:50 +0200 Message-Id: <1380550012-7321-2-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1380550012-7321-1-git-send-email-fweisbec@gmail.com> References: <1380550012-7321-1-git-send-email-fweisbec@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130930_100726_662384_B54CADE3 X-CRM114-Status: GOOD ( 12.57 ) X-Spam-Score: -2.0 (--) Cc: Frederic Weisbecker , LKML , Russell King , "Paul E. McKenney" , Ingo Molnar , 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