All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] timers: use set_current_state macro
@ 2020-05-08  2:02 Xianting Tian
  2020-05-13 21:22 ` Thomas Gleixner
  0 siblings, 1 reply; 4+ messages in thread
From: Xianting Tian @ 2020-05-08  2:02 UTC (permalink / raw)
  To: john.stultz, tglx, sboyd; +Cc: linux-kernel, tian.xianting

Use set_current_state macro instead of current->state = TASK_RUNNING.

Signed-off-by: Xianting Tian <tian.xianting@h3c.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 a5221abb4..7c6d42755 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1885,7 +1885,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);
                        goto out;
                }
        }
--
2.17.1

-------------------------------------------------------------------------------------------------------------------------------------
±¾Óʼþ¼°Æ丽¼þº¬ÓÐлªÈý¼¯Íŵı£ÃÜÐÅÏ¢£¬½öÏÞÓÚ·¢Ë͸øÉÏÃæµØÖ·ÖÐÁгö
µÄ¸öÈË»òȺ×é¡£½ûÖ¹ÈκÎÆäËûÈËÒÔÈκÎÐÎʽʹÓ㨰üÀ¨µ«²»ÏÞÓÚÈ«²¿»ò²¿·ÖµØй¶¡¢¸´ÖÆ¡¢
»òÉ¢·¢£©±¾ÓʼþÖеÄÐÅÏ¢¡£Èç¹ûÄú´íÊÕÁ˱¾Óʼþ£¬ÇëÄúÁ¢¼´µç»°»òÓʼþ֪ͨ·¢¼þÈ˲¢É¾³ý±¾
Óʼþ£¡
This e-mail and its attachments contain confidential information from New H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] timers: use set_current_state macro
  2020-05-08  2:02 [PATCH] timers: use set_current_state macro Xianting Tian
@ 2020-05-13 21:22 ` Thomas Gleixner
  2020-05-14  1:46   ` 答复: " Tianxianting
  2020-05-15  1:15   ` Tianxianting
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Gleixner @ 2020-05-13 21:22 UTC (permalink / raw)
  To: Xianting Tian, john.stultz, sboyd; +Cc: linux-kernel, tian.xianting

Xianting,

Xianting Tian <tian.xianting@h3c.com> writes:

thanks for your patch.

Can you please fix your mail client to have proper mail headers? It
provides:

  Content-Type: text/plain
  Content-Transfer-Encoding: quoted-printable

but it fails to provide the charset information. That causes the footer
to become unreadable garbage not only in my mail reader. See:

  https://lore.kernel.org/lkml/20200508020222.15791-1-tian.xianting@h3c.com/

What's worse is that is causes my patch handling scripts to decode the
mail body correctly. And I'm not really inclined to figure out how to
handle this case.

> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -1885,7 +1885,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);

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.

> -------------------------------------------------------------------------------------------------------------------------------------
> ±¾Óʼþ¼°Æ丽¼þº¬ÓÐлªÈý¼¯Íŵı£ÃÜÐÅÏ¢£¬½öÏÞÓÚ·¢Ë͸øÉÏÃæµØÖ·ÖÐÁгö
> µÄ¸öÈË»òȺ×é¡£½ûÖ¹ÈκÎÆäËûÈËÒÔÈκÎÐÎʽʹÓ㨰üÀ¨µ«²»ÏÞÓÚÈ«²¿»ò²¿·ÖµØй¶¡¢¸´ÖÆ¡¢
> »òÉ¢·¢£©±¾ÓʼþÖеÄÐÅÏ¢¡£Èç¹ûÄú´íÊÕÁ˱¾Óʼþ£¬ÇëÄúÁ¢¼´µç»°»òÓʼþ֪ͨ·¢¼þÈ˲¢É¾³ý±¾
> Óʼþ£¡

This is the resulting garbage. Not that I could decipher the chinese
characters which should be here instead, but at least they would look
way nicer. But see below:

> This e-mail and its attachments contain confidential information from New H3C, which is
> intended only for the person or entity whose address is listed above. Any use of the
> information contained herein in any way (including, but not limited to, total or partial
> disclosure, reproduction, or dissemination) by persons other than the intended
> recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
> by phone or email immediately and delete it!

Can you please remove this disclaimer completely (which avoids the
garbage issue as well) ?

It does not make any sense if you send mail to a public mailing list:

 1) If you send mail to a public list which is archived in public then
    the information can't be confidential and restricted to a particular
    audience. It can be accessed by everyone on this planet who has
    access to the internet.

 2) If you really send confidental information accidentally then there
    is no way to delete it. It's out there in the public and in archives
    and you can't call it back.

Thanks,

        tglx
    


^ permalink raw reply	[flat|nested] 4+ messages in thread

* 答复: [PATCH] timers: use set_current_state macro
  2020-05-13 21:22 ` Thomas Gleixner
@ 2020-05-14  1:46   ` Tianxianting
  2020-05-15  1:15   ` Tianxianting
  1 sibling, 0 replies; 4+ messages in thread
From: Tianxianting @ 2020-05-14  1:46 UTC (permalink / raw)
  To: Thomas Gleixner, john.stultz, sboyd; +Cc: linux-kernel

Hi Thomas
Thanks for your reply :)
I am sorry for inconveniencing you about this.
tian.xianting@h3c.com is the mail which is provided by my company,
My company may added some limit&signature when I send the mail out of it,
I will re-send the patch via my personal mail, I used it to send several patches before, and patches were accepted.

-----邮件原件-----
发件人: Thomas Gleixner [mailto:tglx@linutronix.de]
发送时间: 2020年5月14日 5:22
收件人: tianxianting (RD) <tian.xianting@h3c.com>; john.stultz@linaro.org; sboyd@kernel.org
抄送: linux-kernel@vger.kernel.org; tianxianting (RD) <tian.xianting@h3c.com>
主题: Re: [PATCH] timers: use set_current_state macro

Xianting,

Xianting Tian <tian.xianting@h3c.com> writes:

thanks for your patch.

Can you please fix your mail client to have proper mail headers? It
provides:

  Content-Type: text/plain
  Content-Transfer-Encoding: quoted-printable

but it fails to provide the charset information. That causes the footer to become unreadable garbage not only in my mail reader. See:

  https://lore.kernel.org/lkml/20200508020222.15791-1-tian.xianting@h3c.com/

What's worse is that is causes my patch handling scripts to decode the mail body correctly. And I'm not really inclined to figure out how to handle this case.

> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -1885,7 +1885,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);

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.

> ----------------------------------------------------------------------
> ---------------------------------------------------------------
> ±¾Óʼþ¼°Æ丽¼þº¬ÓÐлªÈý¼¯Íŵı£ÃÜÐÅÏ¢£¬½öÏÞÓÚ·¢Ë͸øÉÏÃæµØÖ·ÖÐÁгö
> µÄ¸öÈË»òȺ×é¡£½ûÖ¹ÈκÎÆäËûÈËÒÔÈκÎÐÎʽʹÓ㨰üÀ¨µ«²»ÏÞÓÚÈ«²¿»ò²¿·ÖµØй
> ¶¡¢¸´ÖÆ¡¢
> »òÉ¢·¢£©±¾ÓʼþÖеÄÐÅÏ¢¡£Èç¹ûÄú´íÊÕÁ˱¾Óʼþ£¬ÇëÄúÁ¢¼´µç»°»òÓʼþ֪ͨ·¢¼þ
> È˲¢É¾³ý±¾
> Óʼþ£¡

This is the resulting garbage. Not that I could decipher the chinese characters which should be here instead, but at least they would look way nicer. But see below:

> This e-mail and its attachments contain confidential information from
> New H3C, which is intended only for the person or entity whose address
> is listed above. Any use of the information contained herein in any
> way (including, but not limited to, total or partial disclosure,
> reproduction, or dissemination) by persons other than the intended
> recipient(s) is prohibited. If you receive this e-mail in error,
> please notify the sender by phone or email immediately and delete it!

Can you please remove this disclaimer completely (which avoids the garbage issue as well) ?

It does not make any sense if you send mail to a public mailing list:

 1) If you send mail to a public list which is archived in public then
    the information can't be confidential and restricted to a particular
    audience. It can be accessed by everyone on this planet who has
    access to the internet.

 2) If you really send confidental information accidentally then there
    is no way to delete it. It's out there in the public and in archives
    and you can't call it back.

Thanks,

        tglx


-------------------------------------------------------------------------------------------------------------------------------------
本邮件及其附件含有新华三集团的保密信息,仅限于发送给上面地址中列出
的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、
或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本
邮件!
This e-mail and its attachments contain confidential information from New H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* 答复: [PATCH] timers: use set_current_state macro
  2020-05-13 21:22 ` Thomas Gleixner
  2020-05-14  1:46   ` 答复: " Tianxianting
@ 2020-05-15  1:15   ` Tianxianting
  1 sibling, 0 replies; 4+ messages in thread
From: Tianxianting @ 2020-05-15  1:15 UTC (permalink / raw)
  To: Thomas Gleixner, john.stultz, sboyd; +Cc: linux-kernel

Please review this one, thanks.
https://lkml.org/lkml/2020/5/14/796

-----邮件原件-----
发件人: tianxianting (RD)
发送时间: 2020年5月14日 9:46
收件人: 'Thomas Gleixner' <tglx@linutronix.de>; john.stultz@linaro.org; sboyd@kernel.org
抄送: linux-kernel@vger.kernel.org
主题: 答复: [PATCH] timers: use set_current_state macro

Hi Thomas
Thanks for your reply :)
I am sorry for inconveniencing you about this.
tian.xianting@h3c.com is the mail which is provided by my company, My company may added some limit&signature when I send the mail out of it, I will re-send the patch via my personal mail, I used it to send several patches before, and patches were accepted.

-----邮件原件-----
发件人: Thomas Gleixner [mailto:tglx@linutronix.de]
发送时间: 2020年5月14日 5:22
收件人: tianxianting (RD) <tian.xianting@h3c.com>; john.stultz@linaro.org; sboyd@kernel.org
抄送: linux-kernel@vger.kernel.org; tianxianting (RD) <tian.xianting@h3c.com>
主题: Re: [PATCH] timers: use set_current_state macro

Xianting,

Xianting Tian <tian.xianting@h3c.com> writes:

thanks for your patch.

Can you please fix your mail client to have proper mail headers? It
provides:

  Content-Type: text/plain
  Content-Transfer-Encoding: quoted-printable

but it fails to provide the charset information. That causes the footer to become unreadable garbage not only in my mail reader. See:

  https://lore.kernel.org/lkml/20200508020222.15791-1-tian.xianting@h3c.com/

What's worse is that is causes my patch handling scripts to decode the mail body correctly. And I'm not really inclined to figure out how to handle this case.

> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -1885,7 +1885,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);

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.

> ----------------------------------------------------------------------
> ---------------------------------------------------------------
> ±¾Óʼþ¼°Æ丽¼þº¬ÓÐлªÈý¼¯Íŵı£ÃÜÐÅÏ¢£¬½öÏÞÓÚ·¢Ë͸øÉÏÃæµØÖ·ÖÐÁгö
> µÄ¸öÈË»òȺ×é¡£½ûÖ¹ÈκÎÆäËûÈËÒÔÈκÎÐÎʽʹÓ㨰üÀ¨µ«²»ÏÞÓÚÈ«²¿»ò²¿·ÖµØй
> ¶¡¢¸´ÖÆ¡¢
> »òÉ¢·¢£©±¾ÓʼþÖеÄÐÅÏ¢¡£Èç¹ûÄú´íÊÕÁ˱¾Óʼþ£¬ÇëÄúÁ¢¼´µç»°»òÓʼþ֪ͨ·¢¼þ
> È˲¢É¾³ý±¾
> Óʼþ£¡

This is the resulting garbage. Not that I could decipher the chinese characters which should be here instead, but at least they would look way nicer. But see below:

> This e-mail and its attachments contain confidential information from
> New H3C, which is intended only for the person or entity whose address
> is listed above. Any use of the information contained herein in any
> way (including, but not limited to, total or partial disclosure,
> reproduction, or dissemination) by persons other than the intended
> recipient(s) is prohibited. If you receive this e-mail in error,
> please notify the sender by phone or email immediately and delete it!

Can you please remove this disclaimer completely (which avoids the garbage issue as well) ?

It does not make any sense if you send mail to a public mailing list:

 1) If you send mail to a public list which is archived in public then
    the information can't be confidential and restricted to a particular
    audience. It can be accessed by everyone on this planet who has
    access to the internet.

 2) If you really send confidental information accidentally then there
    is no way to delete it. It's out there in the public and in archives
    and you can't call it back.

Thanks,

        tglx


-------------------------------------------------------------------------------------------------------------------------------------
本邮件及其附件含有新华三集团的保密信息,仅限于发送给上面地址中列出
的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、
或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本
邮件!
This e-mail and its attachments contain confidential information from New H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-15  1:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08  2:02 [PATCH] timers: use set_current_state macro Xianting Tian
2020-05-13 21:22 ` Thomas Gleixner
2020-05-14  1:46   ` 答复: " Tianxianting
2020-05-15  1:15   ` Tianxianting

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.