Received: by 10.213.65.68 with SMTP id h4csp565635imn; Tue, 20 Mar 2018 09:45:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELuxpEw7Ga9Ln2e9sFPI/HAz8oJrKgP9/fJgj2y0b5wGPuSUBc6HGKPoKYFY4YpI5vqyQJqD X-Received: by 10.99.151.26 with SMTP id n26mr12646238pge.370.1521564332669; Tue, 20 Mar 2018 09:45:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521564332; cv=none; d=google.com; s=arc-20160816; b=WzQPC7BHSFLsr25XPRHZ1cj3ybDCKTIAj8/tYnoSHyrlGhM4HvwimuHC/cAPO2kKy3 nJe7YbtDgxxTJODuBH4k2zyllNLHoqhbUnZ84qce1CG8scJU7KIbN6UnGENLGcVhu8HE K5ZdtQ7lhFOfMd+pJhrusIEdPJ49vLpVnKv4hjxdjqy/3r10n7GXk5p5BUO8F4WyjLg/ 5TLfH5ThgT3neO8eUq++iNbzX2vAmaTRQNvd/yUdfVfwcXfWFDXsoE+JSykAFa8VrEoe 1gFx0Skwa+j5RoAGQ5oWBNn4YPEqCuKx3reNpy1lbfI9AX2yWbjGLhfTtZyFkqFOhZIf VdGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=cdLnz1L2IDRuhv/6fykWYbmO2mp+COJkVjrQoxfH6vE=; b=AyXc7VX15bZFcC852UCHXwuWgcOXSwDMgPQbFCo9o+F5cdg4lllUY6Ikqlwktzp55w oeHrQStgabsNJojLJ19GsbewAdDoyYfhLpZHhznaHwU3QVsGzdhJ+oPnMeDVxG9GdpxT Apx/Ujm/aifqdecM7F3hTYzUuuntju5r2jc8gUhJelc4EDZFNM7lVtjjEfx24bEoJpfL QKI/PB6M2ivgp0Z3lFR+2SXp1g+WqTAyEyi9QjZy79u0Yz7ce4KsuZrLjdy5ArUe1KG9 FKHUYLD+V9jWhyoxg19nVnvph0nkChSiMpaTKSzIbFa2RpiwsJVAHN45rFeI+m+qiFaN UNrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d23si1407170pgn.235.2018.03.20.09.45.18; Tue, 20 Mar 2018 09:45:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751986AbeCTQoO (ORCPT + 99 others); Tue, 20 Mar 2018 12:44:14 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:48299 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751310AbeCTQnp (ORCPT ); Tue, 20 Mar 2018 12:43:45 -0400 Received: from 79.184.254.228.ipv4.supernova.orange.pl (79.184.254.228) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id 9cfc0f95ec709ddd; Tue, 20 Mar 2018 17:43:43 +0100 From: "Rafael J. Wysocki" To: Peter Zijlstra , Linux PM Cc: Frederic Weisbecker , Thomas Gleixner , Paul McKenney , Thomas Ilsche , Doug Smythies , Rik van Riel , Aubrey Li , Mike Galbraith , LKML Subject: [RFT][PATCH v7 4/8] jiffies: Introduce USER_TICK_USEC and redefine TICK_USEC Date: Tue, 20 Mar 2018 16:16:28 +0100 Message-ID: <4255295.KFD9yx16PH@aspire.rjw.lan> In-Reply-To: <2390019.oHdSGtR3EE@aspire.rjw.lan> References: <2390019.oHdSGtR3EE@aspire.rjw.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Since the subsequent changes will need a TICK_USEC definition analogous to TICK_NSEC, rename the existing TICK_USEC as USER_TICK_USEC, update its users and redefine TICK_USEC accordingly. Suggested-by: Peter Zijlstra Signed-off-by: Rafael J. Wysocki --- drivers/net/ethernet/sfc/mcdi.c | 2 +- include/linux/jiffies.h | 7 +++++-- kernel/time/ntp.c | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) Index: linux-pm/include/linux/jiffies.h =================================================================== --- linux-pm.orig/include/linux/jiffies.h +++ linux-pm/include/linux/jiffies.h @@ -62,8 +62,11 @@ extern int register_refined_jiffies(long /* TICK_NSEC is the time between ticks in nsec assuming SHIFTED_HZ */ #define TICK_NSEC ((NSEC_PER_SEC+HZ/2)/HZ) -/* TICK_USEC is the time between ticks in usec assuming fake USER_HZ */ -#define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) +/* TICK_USEC is the time between ticks in usec assuming SHIFTED_HZ */ +#define TICK_USEC ((USEC_PER_SEC + HZ/2) / HZ) + +/* USER_TICK_USEC is the time between ticks in usec assuming fake USER_HZ */ +#define USER_TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ) #ifndef __jiffy_arch_data #define __jiffy_arch_data Index: linux-pm/drivers/net/ethernet/sfc/mcdi.c =================================================================== --- linux-pm.orig/drivers/net/ethernet/sfc/mcdi.c +++ linux-pm/drivers/net/ethernet/sfc/mcdi.c @@ -375,7 +375,7 @@ static int efx_mcdi_poll(struct efx_nic * because generally mcdi responses are fast. After that, back off * and poll once a jiffy (approximately) */ - spins = TICK_USEC; + spins = USER_TICK_USEC; finish = jiffies + MCDI_RPC_TIMEOUT; while (1) { Index: linux-pm/kernel/time/ntp.c =================================================================== --- linux-pm.orig/kernel/time/ntp.c +++ linux-pm/kernel/time/ntp.c @@ -31,7 +31,7 @@ /* USER_HZ period (usecs): */ -unsigned long tick_usec = TICK_USEC; +unsigned long tick_usec = USER_TICK_USEC; /* SHIFTED_HZ period (nsecs): */ unsigned long tick_nsec;