From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFEC1C433FF for ; Mon, 29 Jul 2019 10:17:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CFF912070D for ; Mon, 29 Jul 2019 10:17:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387444AbfG2KRP (ORCPT ); Mon, 29 Jul 2019 06:17:15 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:39734 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387428AbfG2KRP (ORCPT ); Mon, 29 Jul 2019 06:17:15 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 72AA6AD22FDC85C90763; Mon, 29 Jul 2019 18:17:12 +0800 (CST) Received: from [127.0.0.1] (10.74.191.121) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Mon, 29 Jul 2019 18:17:02 +0800 Subject: Re: [PATCH net-next 08/11] net: hns3: add interrupt affinity support for misc interrupt To: Saeed Mahameed , "tanhuazhong@huawei.com" , "davem@davemloft.net" CC: "lipeng321@huawei.com" , "yisen.zhuang@huawei.com" , "salil.mehta@huawei.com" , "linuxarm@huawei.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <1563938327-9865-1-git-send-email-tanhuazhong@huawei.com> <1563938327-9865-9-git-send-email-tanhuazhong@huawei.com> <67b32cdc72c0be03622e78899ac518d807ca7b85.camel@mellanox.com> From: Yunsheng Lin Message-ID: <6a1d85f1-cc6c-1f5a-38c4-e08915e3bc45@huawei.com> Date: Mon, 29 Jul 2019 18:17:02 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.74.191.121] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2019/7/27 7:18, Saeed Mahameed wrote: > On Thu, 2019-07-25 at 10:05 +0800, Yunsheng Lin wrote: >> On 2019/7/25 3:24, Saeed Mahameed wrote: >>> On Wed, 2019-07-24 at 11:18 +0800, Huazhong Tan wrote: >>>> From: Yunsheng Lin >>>> > > [...] >>>> >>>> +static void hclge_irq_affinity_notify(struct irq_affinity_notify >>>> *notify, >>>> + const cpumask_t *mask) >>>> +{ >>>> + struct hclge_dev *hdev = container_of(notify, struct hclge_dev, >>>> + affinity_notify); >>>> + >>>> + cpumask_copy(&hdev->affinity_mask, mask); >>>> + del_timer_sync(&hdev->service_timer); >>>> + hdev->service_timer.expires = jiffies + HZ; >>>> + add_timer_on(&hdev->service_timer, cpumask_first(&hdev- >>>>> affinity_mask)); >>>> +} >>> >>> I don't see any relation between your misc irq vector and &hdev- >>>> service_timer, to me this looks like an abuse of the irq affinity >>>> API >>> to allow the user to move the service timer affinity. >> >> Hi, thanks for reviewing. >> >> hdev->service_timer is used to schedule the periodic work >> queue hdev->service_task, we want all the management work >> queue including hdev->service_task to bind to the same cpu >> to improve cache and power efficiency, it is better to move >> service timer affinity according to that. >> >> The hdev->service_task is changed to delay work queue in >> next patch " net: hns3: make hclge_service use delayed workqueue", >> So the affinity in the timer of the delay work queue is automatically >> set to the affinity of the delay work queue, we will move the >> "make hclge_service use delayed workqueue" patch before the >> "add interrupt affinity support for misc interrupt" patch, so >> we do not have to set service timer affinity explicitly. >> >> Also, There is there work queues(mbx_service_task, service_task, >> rst_service_task) in the hns3 driver, we plan to combine them >> to one or two workqueue to improve efficiency and readability. >> > > So just to make it clear, you have 3 deferred works, 2 are triggered by > the misc irq and 1 is periodic, you want them all on the same core and > you want to control their affinity via the irq affinity ? for works #1 > and #2 you get that for free since the irq is triggering them, but for > work #3 (the periodic one) you need to manually move it when the irq > affinity changes. Yes, You are right. > > I guess i am ok with this, since moving the irq affinity isn't only > required by the periodic work but also for the other works that the irq > is actually triggering (so it is not an actual abuse, sort of .. ) > > >