Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3526213ybl; Mon, 12 Aug 2019 01:53:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWE4fCB9BOGfR1GKmgjaMw6usjBbUTPi46P9nO5kAOkoiq8NP+6znADjzoXnOBdJmf72Y6 X-Received: by 2002:a17:902:8d95:: with SMTP id v21mr332935plo.157.1565599994043; Mon, 12 Aug 2019 01:53:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565599994; cv=none; d=google.com; s=arc-20160816; b=uHg6xlbeZlCtveoracC8LWC+oj0iWsOJwLDAI5ByBT86zBqDlWBzydOHMC6xSwUUeQ yMBVAlaTT+2kfVA60mnaS0SXhCpCYZ0m/yYOyzrMdukMGpKIYdjSsbc2s0ZMAYi5K0kJ y21Q1Ncy4ywFN7JxQPPclRNosZyUgmcOcL8W3nyj2JtEGnQTUkIKDk7uCizrXIrvfYMx nIFG0kK1c6yuRl9lhpEQbVR314DdKKJ6sznU7K3rXyYUvpj4Anj7EXJhU6ncR2yD41AS L4EQ/a5oNFd8g7TI2MeD8dLkJy1ddW7CYUC0Stz8nlfkrFpPhRdfWCv/BieW+KGqtA17 4NIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=ymLKxWrbCa8L8b7k+i+t4b+OOyOkzZKKkqbnbaCYMiI=; b=b8U3eiSm+A5jahUnbFbqzotHpjwM10arbP/dvteZ5bQ2QQiGmgdE023+YZAM0/hfx7 Dsq9zOOsGLCxiRwRLrCD0Jqh4m54MnD8VL4MCrWawCQIblWeTWb9AgFpplZbiUakmANy WwOVrdANpYH+ij8ojlstVLrg22pHpwmfNQufJ+AMbsivq4L5kykKbehkqEAFrdvdFZ4A 0QprIk1BObjFQlLpX5z6/h7oDYDt/HG5HI3GtJD7eoYYTVdam+HiLykbhkc8oepmf396 MqPU8K8kQ2CVsLm7dFOA+qVUa/NmOpMhW4UGq7Csuuap+Yk4ZDtZTpDLUIqiBn0OtQJD I+rQ== 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 m15si63972636pff.267.2019.08.12.01.52.58; Mon, 12 Aug 2019 01:53: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727197AbfHLIwU (ORCPT + 99 others); Mon, 12 Aug 2019 04:52:20 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:48127 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726495AbfHLIwU (ORCPT ); Mon, 12 Aug 2019 04:52:20 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04391;MF=luoben@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0TZGPiR-_1565599926; Received: from localhost(mailfrom:luoben@linux.alibaba.com fp:SMTPD_---0TZGPiR-_1565599926) by smtp.aliyun-inc.com(127.0.0.1); Mon, 12 Aug 2019 16:52:14 +0800 From: Ben Luo To: tglx@linutronix.de, alex.williamson@redhat.com, linux-kernel@vger.kernel.org Cc: tao.ma@linux.alibaba.com, gerry@linux.alibaba.com, nanhai.zou@linux.alibaba.com, linyunsheng@huawei.com Subject: [PATCH v2 0/3] introduce update_irq_devid and optimize VFIO irq ops Date: Mon, 12 Aug 2019 16:52:03 +0800 Message-Id: X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, VFIO takes a lot of free-then-request-irq actions whenever a VM (with device passthru via VFIO) sets irq affinity or mask/unmask irq. Those actions only change the cookie data of irqaction or even change nothing. The free-then-request-irq not only add more latency, but also increases the risk of losing interrupt, this may lead to a VM hung forever in waiting IO completion This patchset solved this issue by: Patch 2 introduces update_irq_devid to only update dev_id of irqaction Patch 3 make use of update_irq_devid and optimize irq operations in VFIO 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 update_irq_devid - use __must_check in external referencing of update_irq_devid - use EXPORT_SYMBOL_GPL for update_irq_devid - reformat code of patch 3 for better readability Ben Luo (3): genirq: enhance error recovery code in free irq genirq: introduce update_irq_devid() vfio_pci: make use of update_irq_devid and optimize irq ops drivers/vfio/pci/vfio_pci_intrs.c | 99 +++++++++++++++++++++------------- include/linux/interrupt.h | 3 ++ kernel/irq/manage.c | 111 +++++++++++++++++++++++++++++++++----- 3 files changed, 163 insertions(+), 50 deletions(-) -- 1.8.3.1