mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yunsheng Lin <linyunsheng@huawei.com>
To: Salil Mehta <salil.mehta@huawei.com>,
	tanhuazhong <tanhuazhong@huawei.com>,
	"davem@davemloft.net" <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Zhuangyuzeng (Yisen)" <yisen.zhuang@huawei.com>,
	Linuxarm <linuxarm@huawei.com>,
	"lipeng (Y)" <lipeng321@huawei.com>
Subject: Re: [PATCH net-next 08/11] net: hns3: add interrupt affinity support for misc interrupt
Date: Mon, 29 Jul 2019 18:37:18 +0800	[thread overview]
Message-ID: <f6e02338-b545-61a9-17de-222543dfef75@huawei.com> (raw)
In-Reply-To: <fa3dbcce9e22453fb1ef111fd107d20f@huawei.com>

On 2019/7/29 17:18, Salil Mehta wrote:
>> From: tanhuazhong
>> Sent: Wednesday, July 24, 2019 4:19 AM
>> To: davem@davemloft.net
>> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Salil Mehta
>> <salil.mehta@huawei.com>; Zhuangyuzeng (Yisen) <yisen.zhuang@huawei.com>;
>> Linuxarm <linuxarm@huawei.com>; linyunsheng <linyunsheng@huawei.com>; lipeng
>> (Y) <lipeng321@huawei.com>; tanhuazhong <tanhuazhong@huawei.com>
>> Subject: [PATCH net-next 08/11] net: hns3: add interrupt affinity support for
>> misc interrupt
>>
>> From: Yunsheng Lin <linyunsheng@huawei.com>
>>
>> The misc interrupt is used to schedule the reset and mailbox
>> subtask, and a 1 sec timer is used to schedule the service
>> subtask, which does periodic work.
>>
>> This patch sets the above three subtask's affinity using the
>> misc interrupt' affinity.
>>
>> Also this patch setups a affinity notify for misc interrupt to
>> allow user to change the above three subtask's affinity.
>>
>> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
>> Signed-off-by: Peng Li <lipeng321@huawei.com>
>> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
>> ---
>>  .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c    | 59
>> ++++++++++++++++++++--
>>  .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h    |  4 ++
>>  2 files changed, 59 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
>> b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
>> index f345095..fe45986 100644
>> --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
>> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
>> @@ -1270,6 +1270,12 @@ static int hclge_configure(struct hclge_dev *hdev)
>>
>>  	hclge_init_kdump_kernel_config(hdev);
>>
>> +	/* Set the init affinity based on pci func number */
>> +	i = cpumask_weight(cpumask_of_node(dev_to_node(&hdev->pdev->dev)));
>> +	i = i ? PCI_FUNC(hdev->pdev->devfn) % i : 0;
>> +	cpumask_set_cpu(cpumask_local_spread(i, dev_to_node(&hdev->pdev->dev)),
>> +			&hdev->affinity_mask);
>> +
>>  	return ret;
>>  }
>>
>> @@ -2502,14 +2508,16 @@ static void hclge_mbx_task_schedule(struct hclge_dev
>> *hdev)
>>  {
>>  	if (!test_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state) &&
>>  	    !test_and_set_bit(HCLGE_STATE_MBX_SERVICE_SCHED, &hdev->state))
>> -		schedule_work(&hdev->mbx_service_task);
>> +		queue_work_on(cpumask_first(&hdev->affinity_mask), system_wq,
> 
> 
> Why we have to use system Work Queue here? This could adversely affect
> other work scheduled not related to the HNS3 driver. Mailbox is internal
> to the driver and depending upon utilization of the mbx channel(which could
> be heavy if many VMs are running), this might stress other system tasks
> as well. Have we thought of this?

If I understand the CMWQ correctly, it is better to reuse the system Work
Queue when the work queue needed by HNS3 driver shares the same property of
system Work Queue, because Concurrency Managed Workqueue mechnism has ensured
they have the same worker pool if they share the same property.

Some driver(i40e) allocates a work queue with WQ_MEM_RECLAIM, I am not sure
what is the usecase which requires the WQ_MEM_RECLAIM.

Anyway, If the HNS3 need to allocate a new work queue, we need to
figure out the usecase first.

> 
> 
> 
>> +			      &hdev->mbx_service_task);
>>  }
>>
>>  static void hclge_reset_task_schedule(struct hclge_dev *hdev)
>>  {
>>  	if (!test_bit(HCLGE_STATE_REMOVING, &hdev->state) &&
>>  	    !test_and_set_bit(HCLGE_STATE_RST_SERVICE_SCHED, &hdev->state))
>> -		schedule_work(&hdev->rst_service_task);
>> +		queue_work_on(cpumask_first(&hdev->affinity_mask), system_wq,
>> +			      &hdev->rst_service_task);
>>  }
>>
>>  static void hclge_task_schedule(struct hclge_dev *hdev)
>> @@ -2517,7 +2525,8 @@ static void hclge_task_schedule(struct hclge_dev *hdev)
>>  	if (!test_bit(HCLGE_STATE_DOWN, &hdev->state) &&
>>  	    !test_bit(HCLGE_STATE_REMOVING, &hdev->state) &&
>>  	    !test_and_set_bit(HCLGE_STATE_SERVICE_SCHED, &hdev->state))
>> -		(void)schedule_work(&hdev->service_task);
>> +		queue_work_on(cpumask_first(&hdev->affinity_mask), system_wq,
> 
> Same here.
> 
> 
> Salil.
> 
> .
> 


  reply	other threads:[~2019-07-29 10:37 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24  3:18 [PATCH net-next 00/11] net: hns3: some code optimizations & bugfixes & features Huazhong Tan
2019-07-24  3:18 ` [PATCH net-next 01/11] net: hns3: add reset checking before set channels Huazhong Tan
2019-07-24  3:18 ` [PATCH net-next 02/11] net: hns3: add a check for get_reset_level Huazhong Tan
2019-07-24  3:18 ` [PATCH net-next 03/11] net: hns3: remove upgrade reset level when reset fail Huazhong Tan
2019-07-24  3:18 ` [PATCH net-next 04/11] net: hns3: fix mis-counting IRQ vector numbers issue Huazhong Tan
2019-07-24 18:28   ` Saeed Mahameed
2019-07-25  2:04     ` tanhuazhong
2019-07-24  3:18 ` [PATCH net-next 05/11] net: hns3: change GFP flag during lock period Huazhong Tan
2019-07-24  3:18 ` [PATCH net-next 06/11] net: hns3: modify firmware version display format Huazhong Tan
2019-07-24 18:34   ` Saeed Mahameed
2019-07-25  2:34     ` tanhuazhong
2019-07-25 21:32       ` Saeed Mahameed
2019-07-26  1:50         ` tanhuazhong
2019-07-24  3:18 ` [PATCH net-next 07/11] net: hns3: adds debug messages to identify eth down cause Huazhong Tan
2019-07-24 19:12   ` Saeed Mahameed
2019-07-25 12:28     ` liuyonglong
2019-07-25 21:59       ` Saeed Mahameed
2019-07-26  1:28         ` Jakub Kicinski
2019-07-26  2:33           ` liuyonglong
2019-07-26  2:21         ` liuyonglong
2019-07-24  3:18 ` [PATCH net-next 08/11] net: hns3: add interrupt affinity support for misc interrupt Huazhong Tan
2019-07-24 19:24   ` Saeed Mahameed
2019-07-25  2:05     ` Yunsheng Lin
2019-07-26 23:18       ` Saeed Mahameed
2019-07-29 10:17         ` Yunsheng Lin
2019-07-29  9:18   ` Salil Mehta
2019-07-29 10:37     ` Yunsheng Lin [this message]
2019-07-24  3:18 ` [PATCH net-next 09/11] net: hns3: make hclge_service use delayed workqueue Huazhong Tan
2019-07-24  3:18 ` [PATCH net-next 10/11] net: hns3: Add support for using order 1 pages with a 4K buffer Huazhong Tan
2019-07-24  3:18 ` [PATCH net-next 11/11] net: hns3: add support for handling IMP error Huazhong Tan

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=f6e02338-b545-61a9-17de-222543dfef75@huawei.com \
    --to=linyunsheng@huawei.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=lipeng321@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=tanhuazhong@huawei.com \
    --cc=yisen.zhuang@huawei.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®