Message ID | 20231114114656.1003841-1-maobibo@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1801890vqg; Tue, 14 Nov 2023 03:49:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IHH3JWKCSNi37uxEJJsUn51n3Aj9MQ+v6Jd6u0LEsF5vs8Tut0etjCpmeuI8B5kbOnEHsWH X-Received: by 2002:a05:6830:22f9:b0:6d6:4793:75ab with SMTP id t25-20020a05683022f900b006d6479375abmr2043395otc.33.1699962573942; Tue, 14 Nov 2023 03:49:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699962573; cv=none; d=google.com; s=arc-20160816; b=KUX9gvrkokEDlXIo7G3qw2YV+EgUJNDFrUAezU66FJOmrY9aS40tqmH5GYHa6LPo1D jln8OAVWwUh+aUCCuDhLv5L0KPkybj4EPtXeKRRVJ2NS5essp7lU1V0iW7oUi6NCDCv0 Y6HcKHUsWOYqQ/wyD9CnXNOlUpUsm/3o6O82ubhJczrGOsQFT+X37C5IoqQtt/YnxBzT hSLTxQee6osQ8MvyoCwxsyJdX/NNVEjVkIbAjcmpZNZSoJwPNpGWrufm/q6ZLeWLMyrl DFCwihq+383WoGS5HSJa0YslfbEbmRpYF+Mgl3ofAHe2mj1v3qLq8TIls2YAaOgPCiyf cD9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=NBnZnodbBtDOnz2rLaKdVpinNAzvB9uOGoRlQ0UH9ZE=; fh=VHLl5hJq+YmtZ4C4dBYyaB1/BenUC1DkHJSPoZ4A400=; b=hWpCaBEIXQvxmqLwUDHqZtsIReGglvqPQkvETLTxdriQfbdcAa+tLg9pzxAGjU53hs DDwAkyIYqj2lT+FCttXOKMpJDWyfCwbvAAWz65e+kR68ES2wPcS4MSHg68mUey57b7Wd 82gyo4n8RjJAVTro20Do01QwqYkpYA7adlZJ63qEq5maiioWlp984kXW8fe33M5zyccY sIVEfFQnIJgbxizPBUnE4jP5otmqwQWH9xmlWKtclOGyH6XyxNMfgpjqQRD/0p3DzrDu KsUU0Dr2GG6uBw6+VAan8jBQIlRJYiic/fckLkV2uOxMCShEBjrYVKxuBiSearCV0ejq PX3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id c7-20020a631c07000000b005bd30867387si7974134pgc.226.2023.11.14.03.49.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 03:49:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1C00180DFF52; Tue, 14 Nov 2023 03:49:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232725AbjKNLt3 (ORCPT <rfc822;lhua1029@gmail.com> + 29 others); Tue, 14 Nov 2023 06:49:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjKNLt2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 14 Nov 2023 06:49:28 -0500 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 672EEE8 for <linux-kernel@vger.kernel.org>; Tue, 14 Nov 2023 03:49:24 -0800 (PST) Received: from loongson.cn (unknown [10.2.5.213]) by gateway (Coremail) with SMTP id _____8CxNvHCXlNlvfA5AA--.48113S3; Tue, 14 Nov 2023 19:49:22 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.213]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Bxni_CXlNlnuRBAA--.13313S2; Tue, 14 Nov 2023 19:49:22 +0800 (CST) From: Bibo Mao <maobibo@loongson.cn> To: Huacai Chen <chenhuacai@kernel.org> Cc: WANG Xuerui <kernel@xen0n.name>, Peter Zijlstra <peterz@infradead.org>, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] LoongArch: Implement stable timer shutdown interface Date: Tue, 14 Nov 2023 19:46:56 +0800 Message-Id: <20231114114656.1003841-1-maobibo@loongson.cn> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Bxni_CXlNlnuRBAA--.13313S2 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj93XoW7Cw45uFW3JFW3XF18Xry5GFX_yoW8Zw4Dpw srCFnxKrWYk3ZagFyDtr4kZr98J3409wsFya4DKay8CFyYqr1fGFs7trWqvF4avryFgayx J3W0vw1qqa17JabCm3ZEXasCq-sJn29KB7ZKAUJUUUU5529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07j1WlkUUUUU= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 14 Nov 2023 03:49:33 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782539956160272564 X-GMAIL-MSGID: 1782539956160272564 |
Series |
LoongArch: Implement stable timer shutdown interface
|
|
Commit Message
maobibo
Nov. 14, 2023, 11:46 a.m. UTC
When cpu is hotplug out, cpu is in idle state and function
arch_cpu_idle_dead is called. Timer interrupt for this processor should
be disabled, else there will be timer interrupt for the dead cpu. Also
this prevents vcpu to schedule out during halt-polling flow when system
is running in vm mode, since there is pending timer interrupt.
This patch adds detailed implementation for timer shutdown interface, so
that timer will be disabled when cpu is plug-out.
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
---
arch/loongarch/kernel/time.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
base-commit: 9bacdd8996c77c42ca004440be610692275ff9d0
Comments
Hi, Bibo, "stable timer" is Chinglish, use "constant timer" here. On Tue, Nov 14, 2023 at 7:49 PM Bibo Mao <maobibo@loongson.cn> wrote: > > When cpu is hotplug out, cpu is in idle state and function > arch_cpu_idle_dead is called. Timer interrupt for this processor should > be disabled, else there will be timer interrupt for the dead cpu. Also > this prevents vcpu to schedule out during halt-polling flow when system > is running in vm mode, since there is pending timer interrupt. > > This patch adds detailed implementation for timer shutdown interface, so > that timer will be disabled when cpu is plug-out. > > Signed-off-by: Bibo Mao <maobibo@loongson.cn> > --- > arch/loongarch/kernel/time.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/arch/loongarch/kernel/time.c b/arch/loongarch/kernel/time.c > index 3064af94db9c..2920770e30a9 100644 > --- a/arch/loongarch/kernel/time.c > +++ b/arch/loongarch/kernel/time.c > @@ -58,7 +58,7 @@ static int constant_set_state_oneshot(struct clock_event_device *evt) > return 0; > } > > -static int constant_set_state_oneshot_stopped(struct clock_event_device *evt) > +static int constant_set_state_shutdown(struct clock_event_device *evt) > { > unsigned long timer_config; > Please remove the whole constant_set_state_oneshot_stopped() and move its logic to the below constant_set_state_shutdown(). And it is very strange that this "bug" hasn't caused any problems until now. Huacai > @@ -90,11 +90,6 @@ static int constant_set_state_periodic(struct clock_event_device *evt) > return 0; > } > > -static int constant_set_state_shutdown(struct clock_event_device *evt) > -{ > - return 0; > -} > - > static int constant_timer_next_event(unsigned long delta, struct clock_event_device *evt) > { > unsigned long timer_config; > @@ -161,7 +156,7 @@ int constant_clockevent_init(void) > cd->rating = 320; > cd->cpumask = cpumask_of(cpu); > cd->set_state_oneshot = constant_set_state_oneshot; > - cd->set_state_oneshot_stopped = constant_set_state_oneshot_stopped; > + cd->set_state_oneshot_stopped = constant_set_state_shutdown; > cd->set_state_periodic = constant_set_state_periodic; > cd->set_state_shutdown = constant_set_state_shutdown; > cd->set_next_event = constant_timer_next_event; > > base-commit: 9bacdd8996c77c42ca004440be610692275ff9d0 > -- > 2.39.3 >
On 2023/11/16 上午10:50, Huacai Chen wrote: > Hi, Bibo, > > "stable timer" is Chinglish, use "constant timer" here. will do if you insist on, the name is not created by me :( > > On Tue, Nov 14, 2023 at 7:49 PM Bibo Mao <maobibo@loongson.cn> wrote: >> >> When cpu is hotplug out, cpu is in idle state and function >> arch_cpu_idle_dead is called. Timer interrupt for this processor should >> be disabled, else there will be timer interrupt for the dead cpu. Also >> this prevents vcpu to schedule out during halt-polling flow when system >> is running in vm mode, since there is pending timer interrupt. >> >> This patch adds detailed implementation for timer shutdown interface, so >> that timer will be disabled when cpu is plug-out. >> >> Signed-off-by: Bibo Mao <maobibo@loongson.cn> >> --- >> arch/loongarch/kernel/time.c | 9 ++------- >> 1 file changed, 2 insertions(+), 7 deletions(-) >> >> diff --git a/arch/loongarch/kernel/time.c b/arch/loongarch/kernel/time.c >> index 3064af94db9c..2920770e30a9 100644 >> --- a/arch/loongarch/kernel/time.c >> +++ b/arch/loongarch/kernel/time.c >> @@ -58,7 +58,7 @@ static int constant_set_state_oneshot(struct clock_event_device *evt) >> return 0; >> } >> >> -static int constant_set_state_oneshot_stopped(struct clock_event_device *evt) >> +static int constant_set_state_shutdown(struct clock_event_device *evt) >> { >> unsigned long timer_config; >> > Please remove the whole constant_set_state_oneshot_stopped() and move > its logic to the below constant_set_state_shutdown(). will do. > > And it is very strange that this "bug" hasn't caused any problems until now. Since there is no other hw timer except percpu timer, there will be problem if hw timer is switched, also nobody watches hw behaviors when cpu is plug-out. LTP cpu hotplug test cases just report passed on physical machine. Regards Bibo Mao > > Huacai > >> @@ -90,11 +90,6 @@ static int constant_set_state_periodic(struct clock_event_device *evt) >> return 0; >> } >> >> -static int constant_set_state_shutdown(struct clock_event_device *evt) >> -{ >> - return 0; >> -} >> - >> static int constant_timer_next_event(unsigned long delta, struct clock_event_device *evt) >> { >> unsigned long timer_config; >> @@ -161,7 +156,7 @@ int constant_clockevent_init(void) >> cd->rating = 320; >> cd->cpumask = cpumask_of(cpu); >> cd->set_state_oneshot = constant_set_state_oneshot; >> - cd->set_state_oneshot_stopped = constant_set_state_oneshot_stopped; >> + cd->set_state_oneshot_stopped = constant_set_state_shutdown; >> cd->set_state_periodic = constant_set_state_periodic; >> cd->set_state_shutdown = constant_set_state_shutdown; >> cd->set_next_event = constant_timer_next_event; >> >> base-commit: 9bacdd8996c77c42ca004440be610692275ff9d0 >> -- >> 2.39.3 >>
Hi, Sorry for the late review but here we go: On 11/14/23 19:46, Bibo Mao wrote: > When cpu is hotplug out, cpu is in idle state and function "When a CPU is hot-unplugged, it is put into idle state and the function ... is called" > arch_cpu_idle_dead is called. Timer interrupt for this processor should > be disabled, else there will be timer interrupt for the dead cpu. Also > this prevents vcpu to schedule out during halt-polling flow when system > is running in vm mode, since there is pending timer interrupt. The logical relationship is a bit unclear, is my paraphrasing correct in your opinion? "Timer interrupt for this processor should be disabled, else a pending timer interrupt will prevent the vCPU from scheduling out during the halt-polling flow when system is running in VM mode" (I don't immediately know what a "schedule out" is. Is that a translation artifact or some KVM jargon?) > > This patch adds detailed implementation for timer shutdown interface, so > that timer will be disabled when cpu is plug-out. Missing some definite articles too. "This patch implements the timer shutdown interface so that the timer will be properly disabled when a CPU is hot-unplugged" Is this version better? > > Signed-off-by: Bibo Mao <maobibo@loongson.cn> > --- > arch/loongarch/kernel/time.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/arch/loongarch/kernel/time.c b/arch/loongarch/kernel/time.c > index 3064af94db9c..2920770e30a9 100644 > --- a/arch/loongarch/kernel/time.c > +++ b/arch/loongarch/kernel/time.c > @@ -58,7 +58,7 @@ static int constant_set_state_oneshot(struct clock_event_device *evt) > return 0; > } > > -static int constant_set_state_oneshot_stopped(struct clock_event_device *evt) > +static int constant_set_state_shutdown(struct clock_event_device *evt) > { > unsigned long timer_config; > > @@ -90,11 +90,6 @@ static int constant_set_state_periodic(struct clock_event_device *evt) > return 0; > } > > -static int constant_set_state_shutdown(struct clock_event_device *evt) > -{ > - return 0; > -} > - > static int constant_timer_next_event(unsigned long delta, struct clock_event_device *evt) > { > unsigned long timer_config; > @@ -161,7 +156,7 @@ int constant_clockevent_init(void) > cd->rating = 320; > cd->cpumask = cpumask_of(cpu); > cd->set_state_oneshot = constant_set_state_oneshot; > - cd->set_state_oneshot_stopped = constant_set_state_oneshot_stopped; > + cd->set_state_oneshot_stopped = constant_set_state_shutdown; > cd->set_state_periodic = constant_set_state_periodic; > cd->set_state_shutdown = constant_set_state_shutdown; > cd->set_next_event = constant_timer_next_event; > > base-commit: 9bacdd8996c77c42ca004440be610692275ff9d0 Otherwise LGTM (regarding the renaming of constant_set_state_oneshot_stopped, both it and the removed constant_set_state_shutdown only has one usage respectively, and looking at the function body it's arguably more appropriate to let it take the "shutdown" name: it's just clearing the enable bit from the CSR.TCFG and nothing else). With the nits addressed: Reviewed-by: WANG Xuerui <git@xen0n.name>
Xuerui, Thanks for reviewing my patch, and I reply inline. On 2023/11/16 下午3:09, WANG Xuerui wrote: > Hi, > > Sorry for the late review but here we go: > > On 11/14/23 19:46, Bibo Mao wrote: >> When cpu is hotplug out, cpu is in idle state and function > "When a CPU is hot-unplugged, it is put into idle state and the function > ... is called" Will do in next patch. >> arch_cpu_idle_dead is called. Timer interrupt for this processor should >> be disabled, else there will be timer interrupt for the dead cpu. Also >> this prevents vcpu to schedule out during halt-polling flow when system >> is running in vm mode, since there is pending timer interrupt. > > The logical relationship is a bit unclear, is my paraphrasing correct in > your opinion? > > "Timer interrupt for this processor should be disabled, else a pending > timer interrupt will prevent the vCPU from scheduling out during the > halt-polling flow when system is running in VM mode" > > (I don't immediately know what a "schedule out" is. Is that a > translation artifact or some KVM jargon?) how about "prevent the vCPU from giving up scheduling"? > >> >> This patch adds detailed implementation for timer shutdown interface, so >> that timer will be disabled when cpu is plug-out. > > Missing some definite articles too. > > "This patch implements the timer shutdown interface so that the timer > will be properly disabled when a CPU is hot-unplugged" > > Is this version better? sure, will do in next version. Regards Bibo Mao > >> >> Signed-off-by: Bibo Mao <maobibo@loongson.cn> >> --- >> arch/loongarch/kernel/time.c | 9 ++------- >> 1 file changed, 2 insertions(+), 7 deletions(-) >> >> diff --git a/arch/loongarch/kernel/time.c b/arch/loongarch/kernel/time.c >> index 3064af94db9c..2920770e30a9 100644 >> --- a/arch/loongarch/kernel/time.c >> +++ b/arch/loongarch/kernel/time.c >> @@ -58,7 +58,7 @@ static int constant_set_state_oneshot(struct >> clock_event_device *evt) >> return 0; >> } >> -static int constant_set_state_oneshot_stopped(struct >> clock_event_device *evt) >> +static int constant_set_state_shutdown(struct clock_event_device *evt) >> { >> unsigned long timer_config; >> @@ -90,11 +90,6 @@ static int constant_set_state_periodic(struct >> clock_event_device *evt) >> return 0; >> } >> -static int constant_set_state_shutdown(struct clock_event_device *evt) >> -{ >> - return 0; >> -} >> - >> static int constant_timer_next_event(unsigned long delta, struct >> clock_event_device *evt) >> { >> unsigned long timer_config; >> @@ -161,7 +156,7 @@ int constant_clockevent_init(void) >> cd->rating = 320; >> cd->cpumask = cpumask_of(cpu); >> cd->set_state_oneshot = constant_set_state_oneshot; >> - cd->set_state_oneshot_stopped = constant_set_state_oneshot_stopped; >> + cd->set_state_oneshot_stopped = constant_set_state_shutdown; >> cd->set_state_periodic = constant_set_state_periodic; >> cd->set_state_shutdown = constant_set_state_shutdown; >> cd->set_next_event = constant_timer_next_event; >> >> base-commit: 9bacdd8996c77c42ca004440be610692275ff9d0 > > Otherwise LGTM (regarding the renaming of > constant_set_state_oneshot_stopped, both it and the removed > constant_set_state_shutdown only has one usage respectively, and looking > at the function body it's arguably more appropriate to let it take the > "shutdown" name: it's just clearing the enable bit from the CSR.TCFG and > nothing else). > > With the nits addressed: > > Reviewed-by: WANG Xuerui <git@xen0n.name> >
On 11/16/23 16:21, maobibo wrote: >>> arch_cpu_idle_dead is called. Timer interrupt for this processor should >>> be disabled, else there will be timer interrupt for the dead cpu. Also >>> this prevents vcpu to schedule out during halt-polling flow when system >>> is running in vm mode, since there is pending timer interrupt. >> >> The logical relationship is a bit unclear, is my paraphrasing correct >> in your opinion? >> >> "Timer interrupt for this processor should be disabled, else a >> pending timer interrupt will prevent the vCPU from scheduling out >> during the halt-polling flow when system is running in VM mode" >> >> (I don't immediately know what a "schedule out" is. Is that a >> translation artifact or some KVM jargon?) > how about "prevent the vCPU from giving up scheduling"? That's very easy to understand, so no problem and thanks!
diff --git a/arch/loongarch/kernel/time.c b/arch/loongarch/kernel/time.c index 3064af94db9c..2920770e30a9 100644 --- a/arch/loongarch/kernel/time.c +++ b/arch/loongarch/kernel/time.c @@ -58,7 +58,7 @@ static int constant_set_state_oneshot(struct clock_event_device *evt) return 0; } -static int constant_set_state_oneshot_stopped(struct clock_event_device *evt) +static int constant_set_state_shutdown(struct clock_event_device *evt) { unsigned long timer_config; @@ -90,11 +90,6 @@ static int constant_set_state_periodic(struct clock_event_device *evt) return 0; } -static int constant_set_state_shutdown(struct clock_event_device *evt) -{ - return 0; -} - static int constant_timer_next_event(unsigned long delta, struct clock_event_device *evt) { unsigned long timer_config; @@ -161,7 +156,7 @@ int constant_clockevent_init(void) cd->rating = 320; cd->cpumask = cpumask_of(cpu); cd->set_state_oneshot = constant_set_state_oneshot; - cd->set_state_oneshot_stopped = constant_set_state_oneshot_stopped; + cd->set_state_oneshot_stopped = constant_set_state_shutdown; cd->set_state_periodic = constant_set_state_periodic; cd->set_state_shutdown = constant_set_state_shutdown; cd->set_next_event = constant_timer_next_event;