Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3184951ybi; Mon, 29 Jul 2019 02:22:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzayu2nhYqdoDm1Ew8yKHmowld4WvCWNYQo2i4rHvOJxAQrrLsHHGPZKxvVzpDf5rU0ZYMb X-Received: by 2002:a17:902:4124:: with SMTP id e33mr102581599pld.6.1564392140266; Mon, 29 Jul 2019 02:22:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564392140; cv=none; d=google.com; s=arc-20160816; b=HmYj5oX2t8EyR79KLyuaycdC2fAAQGoHQRQ1ItVysdTtAyIf3AGrBZK0bHPCx2eldB FD4J4wm5cm91YHepGfhLojpu3ac7L1L0oQIlDCdztiFISf3hvoTWsDcoMB/it7AkfvfY LmRSGp2TPy+P4Ye6Cl0udYWl2brX9Z1OHFYhLW0B5wGuz2bW/3I/eDSlJlIUNv2ca2AT htnCn2cdGAZjoMS4xU3CM1SsqLgD2wQZPnXGvWwPtMD7zIdydzBrXFxsM6DS4XYlsize dUdBZZjgsh0twSGiuKantD70dC+CARQ7IiNI/nvwZlUlKTOUqCs++8JUeb18Z1OdZsk6 ZSSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=d3djekZBx04ynyMcDFJKCr73QHLYjMV/cJjcvFhGu0g=; b=WEufVzb942v541WLzgPDQGvetWyPYXg50q+a8U4aeXne/puW/NVQ8C2BIxylzoXzAv wlZWtZwEpYD6S+M4XFrkvlgT7hcUmX8k5BNkSOLa0xmaJFNp2IVdTE5lKW3g8jud2yUT F/9XRJsemVB1M3s14cIKxGL93bX7/Kj8XURzb99cuPQFjWE58ESLOiL5GDpdguvq7upe WgS9jTZMJkV4D4NTjUEGBzATag7iq68bTdo+gNLKYmXs9HzTCLGi9tgQZsIbuukFh89b kQ7nqsXMoDz6xX1hSCK4HfzfzijmuPL7CURs/lmWPW2qevRxCmSmL/M4QVuGwqJAVJIm 7uRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h63si23337052pjb.106.2019.07.29.02.22.04; Mon, 29 Jul 2019 02:22:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727686AbfG2JTD convert rfc822-to-8bit (ORCPT + 99 others); Mon, 29 Jul 2019 05:19:03 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:60246 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726496AbfG2JTC (ORCPT ); Mon, 29 Jul 2019 05:19:02 -0400 Received: from DGGEMM403-HUB.china.huawei.com (unknown [172.30.72.55]) by Forcepoint Email with ESMTP id 0CCEC2E88F05F5A130F2; Mon, 29 Jul 2019 17:19:00 +0800 (CST) Received: from dggeme707-chm.china.huawei.com (10.1.199.103) by DGGEMM403-HUB.china.huawei.com (10.3.20.211) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 29 Jul 2019 17:18:59 +0800 Received: from lhreml703-chm.china.huawei.com (10.201.108.52) by dggeme707-chm.china.huawei.com (10.1.199.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 29 Jul 2019 17:18:57 +0800 Received: from lhreml703-chm.china.huawei.com ([10.201.68.198]) by lhreml703-chm.china.huawei.com ([10.201.68.198]) with mapi id 15.01.1713.004; Mon, 29 Jul 2019 10:18:55 +0100 From: Salil Mehta To: tanhuazhong , "davem@davemloft.net" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Zhuangyuzeng (Yisen)" , Linuxarm , linyunsheng , "lipeng (Y)" Subject: RE: [PATCH net-next 08/11] net: hns3: add interrupt affinity support for misc interrupt Thread-Topic: [PATCH net-next 08/11] net: hns3: add interrupt affinity support for misc interrupt Thread-Index: AQHVQc7SvuUmwP6wYkeZvk7xQcNJGqbhV81w Date: Mon, 29 Jul 2019 09:18:55 +0000 Message-ID: References: <1563938327-9865-1-git-send-email-tanhuazhong@huawei.com> <1563938327-9865-9-git-send-email-tanhuazhong@huawei.com> In-Reply-To: <1563938327-9865-9-git-send-email-tanhuazhong@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.226.45] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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 > ; Zhuangyuzeng (Yisen) ; > Linuxarm ; linyunsheng ; lipeng > (Y) ; tanhuazhong > Subject: [PATCH net-next 08/11] net: hns3: add interrupt affinity support for > misc interrupt > > From: Yunsheng Lin > > 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 > Signed-off-by: Peng Li > Signed-off-by: Huazhong Tan > --- > .../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? > + &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.