From: Thomas Gleixner <tglx@linutronix.de>
To: Xianting Tian <xianting_tian@126.com>,
john.stultz@linaro.org, sboyd@kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] timers: Use set_current_state macro
Date: Tue, 19 May 2020 10:36:11 +0200 [thread overview]
Message-ID: <87imgsuxs4.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <1589469647-33814-1-git-send-email-xianting_tian@126.com>
Xianting Tian <xianting_tian@126.com> writes:
> Use set_current_state macro instead of current->state = TASK_RUNNING
>
> Signed-off-by: Xianting Tian <xianting_tian@126.com>
> ---
> kernel/time/timer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/time/timer.c b/kernel/time/timer.c
> index 4820823..b9ecf87 100644
> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -1882,7 +1882,7 @@ signed long __sched schedule_timeout(signed long timeout)
> printk(KERN_ERR "schedule_timeout: wrong timeout "
> "value %lx\n", timeout);
> dump_stack();
> - current->state = TASK_RUNNING;
> + set_current_state(TASK_RUNNING);
This is still wrong. Again:
"That's not the same and adds a barrier which is not needed.
Not a big problem in that particular error handling code path, but in
general you really have to look whether your replacement is resulting in
the same code.
If not then you need to make an argument in the changelog why you are
replacing existing code with something which is not fully equivalent.
For this particular case, please check the implementation and read the
documentation of set_current_state() in include/linux/sched.h."
Thanks,
tglx
next prev parent reply other threads:[~2020-05-19 8:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-14 15:20 Xianting Tian
2020-05-19 8:36 ` Thomas Gleixner [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-05-08 2:02 [PATCH] timers: use " Xianting Tian
2020-05-13 21:22 ` Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87imgsuxs4.fsf@nanos.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sboyd@kernel.org \
--cc=xianting_tian@126.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®