Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3240902ybi; Mon, 29 Jul 2019 03:19:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXMlmHbYBKDgiX8IL9aI4bcjQho6cUJoH8lbt4spbK7EANpTTVmUe4jeTkWiM6IuoMj6ll X-Received: by 2002:a17:902:70cc:: with SMTP id l12mr67918021plt.87.1564395554219; Mon, 29 Jul 2019 03:19:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564395554; cv=none; d=google.com; s=arc-20160816; b=KyhlUc1W87FU9v0kLrB6iqQIl0pSWdWBnjUYUuGr15pLINSKF0aELB8yQMZjCjiJCn wQwGPlxq9cliyGl92CP6q6bNuPBwND0T9gSQrnZYov9G+bLlnAsDIWii8hh19mT+t7xC Wy0kdc7a02xAcuIvHoKRF8aHWGjFSM5imF8XmYKD3JzbLGoeApzjLYZF8ZgA5vxxKjUE eFOF1SBdtJSYMGOD0tG+maLqoNAgdLBd4tfzjuI7BNABUMxb4BFhxzeuIsor4lbi9vqA bzgR7BkLY8cAzztde/iIVbSo6bBmw8ULCNkSjPIjGW75WXdWazzn/lHL9f8yPSnQsbPo FKpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=jKTRq8j6726+6Yrt81+u4gA8u7nCDjgnd9PF60udIGA=; b=FYwNH/kEKFjEn/EWj87b3pDtR/h8ozKIVsNkXHV0tWVeVNtVipw/rh4ozgrrwE7CBI 0xbJimuGLtMezOU66go+wt8EEWEPr8jnAcGY8Cz/bJC34fXxKfY07H48G6DzKSxmvUyU 2jymlWND472APLY/lgwDckt1xgaT9YA1XXxKOahu3YgsmYMZ8K7l399DJzdNkrbz820N nSEp6MZCgLR/VqGm+bSMCSLy0pYqQy6rmd5swD7Zci86XnsWdm0SvBPenipopOBI4oD3 w6AQx64Uy8Mlg/FutmtBfPkcMJwaFUGOKr1estvI34n87c40NG213bgZdnpppbK2ROqV NhGQ== 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 o11si24276365pjb.30.2019.07.29.03.18.59; Mon, 29 Jul 2019 03:19:14 -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 S2387449AbfG2KRQ (ORCPT + 99 others); Mon, 29 Jul 2019 06:17:16 -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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 .. ) > > >