public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: lizhe  <sensor1010@163.com>
To: "Thomas Gleixner" <tglx@linutronix.de>
Cc: ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org
Subject: Re:Re: [PATCH] hrtimer.c : Remove redundant thread state settings
Date: Fri, 12 Jan 2024 13:03:47 +0800 (CST)	[thread overview]
Message-ID: <257fc950.14ca.18cfc0e0a5a.Coremail.sensor1010@163.com> (raw)
In-Reply-To: <877ckfkefv.ffs@tglx>


[-- Attachment #1.1: Type: text/plain, Size: 766 bytes --]







Hi, 
    Please review this patch, It does not check the condition when executing the scheduler() function.
       
                                                                                                       Lizhe
                                                                                           thanks











At 2024-01-12 00:44:20, "Thomas Gleixner" <tglx@linutronix.de> wrote:
>On Wed, Jan 10 2024 at 06:13, Lizhe wrote:
>> After a thread is awakened, its state is already task_running
>
>That's correct, but please look at hrtimer_wakeup() and the conditional
>schedule() invocation in schedule_hrtimeout_range_clock(). You break the
>guarantee that this function returns with task state == TASK_RUNNING.
>
>Thanks,
>
>        tglx

[-- Attachment #1.2: Type: text/html, Size: 1874 bytes --]

[-- Attachment #2: 0001-drivers-dm-crypt.c-remove-redundant-state-settings-a.patch --]
[-- Type: application/octet-stream, Size: 775 bytes --]

From 81a6920517e5e2d9ac6f5b3e464b64b550f07049 Mon Sep 17 00:00:00 2001
From: Lizhe <sensor1010@163.com>
Date: Thu, 11 Jan 2024 20:57:01 -0800
Subject: [PATCH] drivers/dm-crypt.c : remove redundant state settings after
 waking up

The task status has been set to TASK_RUNNING in schedule().
No need to set again here.

Signed-off-by: Lizhe <sensor1010@163.com>
---
 drivers/md/dm-crypt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 855b482cbff1..ab1e30630e64 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1948,7 +1948,6 @@ static int dmcrypt_write(void *data)
 
 		schedule();
 
-		set_current_state(TASK_RUNNING);
 		spin_lock_irq(&cc->write_thread_lock);
 		goto continue_locked;
 
-- 
2.25.1


      reply	other threads:[~2024-01-12  5:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10 14:13 [PATCH] hrtimer.c : Remove redundant thread state settings Lizhe
2024-01-11 16:44 ` Thomas Gleixner
2024-01-12  5:03   ` lizhe [this message]

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=257fc950.14ca.18cfc0e0a5a.Coremail.sensor1010@163.com \
    --to=sensor1010@163.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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