public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: qzhang2 <qiang.zhang@windriver.com>
To: Markus Elfring <Markus.Elfring@web.de>, Tejun Heo <tj@kernel.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [v2] workqueue: Fix double kfree for rescuer
Date: Tue, 26 May 2020 10:05:44 +0800	[thread overview]
Message-ID: <e002d552-b161-0cc3-88ea-daee541ee6f4@windriver.com> (raw)
In-Reply-To: <8b67c327-e70c-1e96-6a99-a5fd2667f666@web.de>

Thanks for your advice.
The rescuer null pointer is intentionally passed by a data structure?
and also I read the code of workqueue again, when destroy_workqueue is
called, after "wq->rescuer = NULL" was executed, The scenario described 
below does not happen

"if non-null pointers (according to valid rescuer objects) are 
occasionally passed by the corresponding data structure member
for the callback function "rcu_free_wq"."


On 5/25/20 6:40 PM, Markus Elfring wrote:
>> I see, kfree does nothing with null pointers and direct return.
>> but again kfree is not a good suggestion.
> 
> I have got the impression that the implementation detail is important here
> if non-null pointers (according to valid rescuer objects) are occasionally
> passed by the corresponding data structure member for the callback
> function “rcu_free_wq”.
> Can another clarification attempt reduce unwanted confusion for this patch review?
> 
> Regards,
> Markus
> 

      reply	other threads:[~2020-05-26  2:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25  7:59 [PATCH] workqueue: Fix double kfree for rescuer qiang.zhang
2020-05-25  8:20 ` [PATCH v2] workqueue: Delete duplicate kfree() call for “rescuer” from rcu_free_wq() Markus Elfring
2020-05-25  9:50 ` [PATCH v2] workqueue: Fix double kfree for rescuer Markus Elfring
2020-05-25  9:55   ` Markus Elfring
2020-05-25 10:19   ` qzhang2
2020-05-25 10:40     ` [v2] " Markus Elfring
2020-05-26  2:05       ` qzhang2 [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=e002d552-b161-0cc3-88ea-daee541ee6f4@windriver.com \
    --to=qiang.zhang@windriver.com \
    --cc=Markus.Elfring@web.de \
    --cc=jiangshanlai@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /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