From: Ulrich Obergfell <uobergfe@redhat.com> Date: Wed, 1 Sep 2010 16:23:32 -0400 Subject: [time] introduce 'pmtimer_fine_grained' kernel parameter Message-id: <1618040470.683941283358212941.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com> Patchwork-id: 27994 O-Subject: [RHEL5.6 PATCH 1/3 BZ586285] introduce 'pmtimer_fine_grained' kernel parameter Bugzilla: 586285 RH-Acked-by: Glauber Costa <glommer@redhat.com> RH-Bugzilla: 586285 RH-Upstream-status: N/A This is the second part of a four-part message. Please refer to first part: http://post-office.corp.redhat.com/archives/rhkernel-list/2010-September/msg00037.html Patch part 1 of 3 ----------------- Signed-off-by: Jarod Wilson <jarod@redhat.com> diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c index ed86e23..f953710 100644 --- a/arch/x86_64/kernel/time.c +++ b/arch/x86_64/kernel/time.c @@ -103,6 +103,10 @@ struct timezone __sys_tz __section_sys_tz; /* -1=>disabled, 0=>autoconfigure, 1=>enabled */ int timekeeping_use_tsc; + +/* 0=>disabled, 1=>enabled (default) */ +static unsigned int pmtimer_fine_grained = 1; + static cycles_t cycles_per_tick, cycles_accounted_limit; /* @@ -1941,3 +1945,29 @@ static int __init divider_setup(char *s) __setup("divider=", divider_setup); #endif + + +/* + * If the kernel parameter 'divider' is set to a value greater than 1, + * the kernel parameter 'pmtimer_fine_grained' enables / disables the + * functionality of pmtimer_mark_offset_return_njiffies() as well as + * the divider-specific initialization of 'tick_nsec' in time_init(). + */ + +static int __init pmtimer_fine_grained_setup(char *s) +{ + unsigned int fine_grained = 1; + int ret = get_option(&s, (int *)&fine_grained); + + if (ret == 1 && fine_grained < 2) + pmtimer_fine_grained = fine_grained; + else + printk(KERN_ERR "pmtimer_fine_grained: incorrect value\n"); + + if (!pmtimer_fine_grained) + printk(KERN_INFO "PM timer fine grained accounting disabled\n"); + + return 1; +} + +__setup("pmtimer_fine_grained=", pmtimer_fine_grained_setup);