All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yijing Wang <wangyijing@huawei.com>
To: "Kaneshige, Kenji" <kaneshige.kenji@jp.fujitsu.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Yinghai Lu <yinghai@kernel.org>, Rafael <rjw@sisk.pl>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Mauro Carvalho Chehab <mchehab@redhat.com>,
	Oliver Neukum <oneukum@suse.de>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	Hanjun Guo <guohanjun@huawei.com>,
	"jiang.liu@huawei.com" <jiang.liu@huawei.com>
Subject: Re: [RFC][PATCH] PCI, pciehp: make every slot have its own workqueue to avoid deadlock
Date: Thu, 8 Nov 2012 09:16:04 +0800	[thread overview]
Message-ID: <509B07D4.2030805@huawei.com> (raw)
In-Reply-To: <4A338DB2991D2A44B9A44B8718AECF650A51AFF0@G01JPEXMBYT03>

On 2012/11/7 18:47, Kaneshige, Kenji wrote:
> Hi Yijing,
> 
> I have some comments. Sorry for the delay.
> 
> <snip.>
> 

Hi Kaneshige,
   Thanks for your review and comments very much!

I will update this patch and using slot name instead of device name, it's really a good suggestion.
Also I will remove the redundant flush_workqueue().

Thanks!
Yijing.

>> --- a/drivers/pci/hotplug/pciehp_hpc.c
>> +++ b/drivers/pci/hotplug/pciehp_hpc.c
>> @@ -773,23 +773,33 @@ static void pcie_shutdown_notification(struct controller *ctrl)
>>  static int pcie_init_slot(struct controller *ctrl)
>>  {
>>  	struct slot *slot;
>> +	char name[32];
>>
>>  	slot = kzalloc(sizeof(*slot), GFP_KERNEL);
>>  	if (!slot)
>>  		return -ENOMEM;
>> -
>> +
>> +	snprintf(name, sizeof(name), "pciehpd_%s",
>> +		pci_name(ctrl->pcie->port));
> 
> The name of the threads seems to be cut off.
> 
> $ ps aux | grep pciehp
> root        125  0.0  0.0      0     0 ?        S<   18:54   0:00 [pciehpd_0000:00]
> root        126  0.0  0.0      0     0 ?        S<   18:54   0:00 [pciehpd_0000:00]
> root        127  0.0  0.0      0     0 ?        S<   18:54   0:00 [pciehpd_0000:0b]
> root        128  0.0  0.0      0     0 ?        S<   18:54   0:00 [pciehpd_0000:0b]
> root        129  0.0  0.0      0     0 ?        S<   18:54   0:00 [pciehpd_0000:0b]
> root        130  0.0  0.0      0     0 ?        S<   18:54   0:00 [pciehpd_0000:0b]
> root        131  0.0  0.0      0     0 ?        S<   18:55   0:00 [pciehpd_0000:1a]
> root        132  0.0  0.0      0     0 ?        S<   18:55   0:00 [pciehpd_0000:1a]
> root        133  0.0  0.0      0     0 ?        S<   18:55   0:00 [pciehpd_0000:1a]
> root        134  0.0  0.0      0     0 ?        S<   18:55   0:00 [pciehpd_0000:1a]
> 
> How about using slot name for the thread name?
> 
> <snip.>
> 
>>
>>  static void pcie_cleanup_slot(struct controller *ctrl)
>>  {
>>  	struct slot *slot = ctrl->slot;
>>  	cancel_delayed_work(&slot->work);
>> -	flush_workqueue(pciehp_wq);
>> +	flush_workqueue(slot->wq);
>> +	destroy_workqueue(slot->wq);
>>  	kfree(slot);
>>  }
> 
> I think flush_workqueue() call is no longer required because
> it is done in destroy_workqueue() code path.
> 
> Regards,
> Kenji Kaneshige
> 
> 
> .
> 


-- 
Thanks!
Yijing


      reply	other threads:[~2012-11-08  1:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31  7:10 [RFC][PATCH] PCI, pciehp: make every slot have its own workqueue to avoid deadlock Yijing Wang
2012-10-31  9:20 ` Kaneshige, Kenji
2012-10-31  9:33   ` Yijing Wang
2012-11-07 10:47 ` Kaneshige, Kenji
2012-11-08  1:16   ` Yijing Wang [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=509B07D4.2030805@huawei.com \
    --to=wangyijing@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=guohanjun@huawei.com \
    --cc=jiang.liu@huawei.com \
    --cc=kaneshige.kenji@jp.fujitsu.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=oneukum@suse.de \
    --cc=rjw@sisk.pl \
    --cc=rusty@rustcorp.com.au \
    --cc=yinghai@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 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.