Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5451683ybe; Tue, 10 Sep 2019 04:02:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyC6hmSgcfjMRW56IuTo0HEe7Lsr/RFYQI7y26Yjjb6xcr9fOTbuO2DKRj1IU9S7xhS2Fug X-Received: by 2002:aa7:cb4e:: with SMTP id w14mr28669547edt.230.1568113336584; Tue, 10 Sep 2019 04:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568113336; cv=none; d=google.com; s=arc-20160816; b=ITbz7cT0JJ9fXtoodfKNYiV+XhyZ7acsTuO+w1hKPu4ONjsQ6Weu7i+MAG/7thfXMu pKw8QzP7IuVPVlM5xEhsS2yUrp2ruhW6WG52Ch8vZhWlcpIBt7rYa4IGZpF62AreaU2r B28qRffJ/n2VVTf+NtdDGU2qEaK9suv8RbmaM6+ZpjXU7u/tuHm85oSF/zMWQT9QlmWY k6kdYg2KP6JlHp1fGdRs0wwigZfnMJxgn9yakDw+v4Ql/zD59cMD8HV6r1BVh4zGFpTp W0xq8FhLOxHz5Elot9+2gjnQcDN5CPaczulVmUxc8ANBKO7TyuYUEqEa7szrrqk3ujZY hDFw== 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:in-reply-to :mime-version:user-agent:date:message-id:references:cc:to:from :subject; bh=6tpjj5Wj6fjqq4o3fLRvRsraMIyTkcCx2/DQN8ElJc0=; b=0jHDp/Sazt0g7bSs275T6XKGheO/PbH/eLNSZFxBxb7MXa3BUFSioWnn5QK8WOc3XN 6vLbtSkLpPJtpS63IS8mEpPuS7bx7jATuC0MYMkI0RQHV8CuhlEogXnvcC9brTV1YGv7 1HIk5dCEikkLa8wH3WqSDl3Pxq0cygpuQimJVP7tnkcQcNQvQDOfLmSLUv3yJWsdKFUI kZ8/mhNSlxwhMvYKoCBSqqA0uJlH1hLrPb2RPmP/amaYeTr+grATA5OQ0WrSjU5NgrU4 us71X1eSt7khs5dn4tFDEM2Pu9Fo2d++f9VqLI3opMdhfod3cA6IGK/af4d1Dyaha/D8 17+Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10si9225317ejj.116.2019.09.10.04.01.49; Tue, 10 Sep 2019 04:02:16 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393359AbfIJGa0 (ORCPT + 99 others); Tue, 10 Sep 2019 02:30:26 -0400 Received: from out30-54.freemail.mail.aliyun.com ([115.124.30.54]:58251 "EHLO out30-54.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729634AbfIJGa0 (ORCPT ); Tue, 10 Sep 2019 02:30:26 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=luoben@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0Tbz28j6_1568097016; Received: from bn0418deMacBook-Pro.local(mailfrom:luoben@linux.alibaba.com fp:SMTPD_---0Tbz28j6_1568097016) by smtp.aliyun-inc.com(127.0.0.1); Tue, 10 Sep 2019 14:30:17 +0800 Subject: Re: [PATCH v6 0/3] genirq/vfio: Introduce irq_update_devid() and optimize VFIO irq ops From: Ben Luo To: tglx@linutronix.de, alex.williamson@redhat.com Cc: linux-kernel@vger.kernel.org, tao.ma@linux.alibaba.com, gerry@linux.alibaba.com, nanhai.zou@linux.alibaba.com References: Message-ID: Date: Tue, 10 Sep 2019 14:30:16 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A friendly reminder. Thanks,     Ben 在 2019/9/2 下午12:01, Ben Luo 写道: > Currently, VFIO takes a free-then-request-irq way to do interrupt > affinity setting and masking/unmasking for a VM with device passthru > via VFIO. Sometimes it only changes the cookie data of irqaction or even > changes nothing. The free-then-request-irq not only adds more latency, > but also increases the risk of losing interrupt, which may lead to a > VM hang forever in waiting for IO completion > > This patchset solved the issue by: > Patch 2 introduces irq_update_devid() to only update dev_id of irqaction > Patch 3 make use of this function and optimize irq operations in VFIO > > changes from v5: > - Patch 3: remove an error log to avoid potential DDoS attacking > _ Patch 3: fix typo in comment > > changes from v4: > - Patch 3: follow the previous behavior to disable interrupt on error path > - Patch 3: do irqbypass registration before update or free the interrupt > - Patch 3: add more comments > > changes from v3: > - Patch 2: rename the new function to irq_update_devid() > - Patch 2: use disbale_irq() to avoid a twist for threaded interrupt > - ALL: amend commit messages and code comments > > changes from v2: > - reformat to avoid quoted string split across lines and etc. > > changes from v1: > - add Patch 1 to enhance error recovery etc. in free irq per tglx's comments > - enhance error recovery code and debugging info in irq_update_devid > - use __must_check in external referencing of this function > - use EXPORT_SYMBOL_GPL for irq_update_devid > - reformat code of patch 3 for better readability > > Ben Luo (3): > genirq: enhance error recovery code in free irq > genirq: introduce irq_update_devid() > vfio/pci: make use of irq_update_devid() and optimize irq ops > > drivers/vfio/pci/vfio_pci_intrs.c | 118 ++++++++++++++++++++++++++------------ > include/linux/interrupt.h | 3 + > kernel/irq/manage.c | 105 +++++++++++++++++++++++++++++---- > 3 files changed, 177 insertions(+), 49 deletions(-) >