Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1169262ybl; Thu, 22 Aug 2019 10:18:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqz91YyJmiWZlr0j81rCLfYYAaXK91JnP7WZE65f1uPhOVoiEavRbMhuTb/LgVgV1WLEBZ0l X-Received: by 2002:a17:902:24b:: with SMTP id 69mr38991448plc.250.1566494317641; Thu, 22 Aug 2019 10:18:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566494317; cv=none; d=google.com; s=arc-20160816; b=lcZu5Oy4A+2WL0nLqASvoAexFW0L1ugfmbGmZUHLTNYP89cf8Tnc02xJM+rAd41+SO f1p9HkcTGd0QxMxJxM/91EF1t3y7PW0nXp8BBa6RyBvwsKCLoetub1+ZC2lj7xW02VG3 OupyqiEmeXw2G1yiHuPDV7sfsWuS2SpPEnPIoSWd7CTcDTVYUyZv7R2pZ9fwwQISW7vd 0ngYRaV4IPKaIWDEO1NNIqjfoFXv1B9biDOBwYgSv5nabCFSOnSmK8eP122Ln8Qux04P /yTC8eIYCsn+hRZalqbkqFWYCBcJE6OxfCmcm3/3OlEoUvyvlqzUyEEPhU3+ITF7Z/1j o5lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=vNeNy/XVkUcgOh8uO2E1BlWN04LEesxYiWq+rmAaKCQ=; b=oPnYQazTaOoYBSQXdamppZS2vmeNnf32GZyunLMleH88sNRuebo+sEI7MEtRuM8UoS Y+1kU9/2wtSe28eeNBHOc57Ojah3KnpBvfRr3uuGpMbfCiAHNtcauMqWsOJqh4U+LvwM 7j4Eh29edFgEaJ14s8Djw8AqnBqo4DjbBguutbCBq/RWTB7l/u2u+37gOCvBnJSFGaPH AElLfmg0bmBEMT5pdwDA+m2+TNvl6v4l4kEmkRNG2IFZjioiCjOT9Y6z1ZX6f/ssXRkr iZbPMzb0jyZGZ21yF5+RRFeX0GbuBI2Vpb1tMGTLNUep5C43kIwb5leYxWAkrEE8TauS pZQA== 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 e80si173181pfh.121.2019.08.22.10.18.22; Thu, 22 Aug 2019 10:18:37 -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 S2389121AbfHVPfC (ORCPT + 99 others); Thu, 22 Aug 2019 11:35:02 -0400 Received: from out30-54.freemail.mail.aliyun.com ([115.124.30.54]:41160 "EHLO out30-54.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731907AbfHVPfC (ORCPT ); Thu, 22 Aug 2019 11:35:02 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e07487;MF=luoben@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0Ta8nBUi_1566488079; Received: from localhost(mailfrom:luoben@linux.alibaba.com fp:SMTPD_---0Ta8nBUi_1566488079) by smtp.aliyun-inc.com(127.0.0.1); Thu, 22 Aug 2019 23:34:53 +0800 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, linyunsheng@huawei.com Subject: [PATCH v4 0/3] genirq/vfio: Introduce irq_update_devid() and optimize VFIO irq ops Date: Thu, 22 Aug 2019 23:34:40 +0800 Message-Id: X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, VFIO takes uses a free-then-request-irq way to do interrupt affinity setting and masking/unmasking for a VM (with device passthru via VFIO). Sometimes only change the cookie data of irqaction or even change 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 hung 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 v3: - rename the new function to irq_update_devid() - amend commit messages and code comments - use disbale_irq()/enable_irq() to avoid a twist for threaded interrupt - add more comments to vfio-pci code 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 | 112 +++++++++++++++++++++++++------------- include/linux/interrupt.h | 3 + kernel/irq/manage.c | 105 +++++++++++++++++++++++++++++++---- 3 files changed, 170 insertions(+), 50 deletions(-) -- 1.8.3.1