From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932290AbdJVVnN (ORCPT ); Sun, 22 Oct 2017 17:43:13 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:45458 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932267AbdJVVnK (ORCPT ); Sun, 22 Oct 2017 17:43:10 -0400 Message-Id: <20171022214052.236256885@linutronix.de> User-Agent: quilt/0.63-1 Date: Sun, 22 Oct 2017 23:39:49 +0200 From: Anna-Maria Gleixner To: LKML Cc: Thomas Gleixner , Peter Zijlstra , Ingo Molnar , keescook@chromium.org, Christoph Hellwig , John Stultz Subject: [PATCH v2 11/37] hrtimer: Change boolean struct members into bitfield References: <20171022213938.940451689@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline; filename=hrtimer--Change-bool-into-bitfield.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The struct member migration_enabled and nohz_active of struct hrtimer_cpu_base are boolean. Thus, they cannot easily be packed with the subsequent bitfield when CONFIG_HIGH_RES_TIMERS is enabled. Change the type of boolean struct members into bitfield. Adapt the function timers_update_migration() which updates those members. No functional change. Suggested-by: Peter Zijlstra Signed-off-by: Anna-Maria Gleixner --- include/linux/hrtimer.h | 4 ++-- kernel/time/timer.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -184,8 +184,8 @@ struct hrtimer_cpu_base { unsigned int cpu; unsigned int active_bases; unsigned int clock_was_set_seq; - bool migration_enabled; - bool nohz_active; + unsigned int migration_enabled : 1, + nohz_active : 1; #ifdef CONFIG_HIGH_RES_TIMERS unsigned int in_hrtirq : 1, hres_active : 1, --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -216,6 +216,7 @@ unsigned int sysctl_timer_migration = 1; void timers_update_migration(bool update_nohz) { bool on = sysctl_timer_migration && tick_nohz_active; + struct hrtimer_cpu_base *base; unsigned int cpu; /* Avoid the loop, if nothing to update */ @@ -225,12 +226,13 @@ void timers_update_migration(bool update for_each_possible_cpu(cpu) { per_cpu(timer_bases[BASE_STD].migration_enabled, cpu) = on; per_cpu(timer_bases[BASE_DEF].migration_enabled, cpu) = on; - per_cpu(hrtimer_bases.migration_enabled, cpu) = on; + base = per_cpu_ptr(&hrtimer_bases, cpu); + base->migration_enabled = on; if (!update_nohz) continue; per_cpu(timer_bases[BASE_STD].nohz_active, cpu) = true; per_cpu(timer_bases[BASE_DEF].nohz_active, cpu) = true; - per_cpu(hrtimer_bases.nohz_active, cpu) = true; + base->nohz_active = true; } }