Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp86992ybe; Sun, 1 Sep 2019 21:03:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNY8dPB0+Z3Ji7JzBccqNjs7LRUqS2adWOrFeNWBnRIG/mOl5Bc19GLmtLfTf4suo3wK4N X-Received: by 2002:a65:4304:: with SMTP id j4mr24284825pgq.419.1567396987803; Sun, 01 Sep 2019 21:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567396987; cv=none; d=google.com; s=arc-20160816; b=ZLcreTAMiW3BWjNqgIQ8hleUwl74PcXA8gjEO5SqFumnwAZ+VvCGgb9F7FHr4gnWBK yv2jJIg3dX0lbSpD2OcFyuPpvSWKih6z/KQ+o3Y7RvzcQ/ubHq7rrhsEGRAIhA6Dvjv8 DERImxYzPdTL0J9drSjK6Z9lAsOhNlNagvfiXnQXYhMci8I2TsBXyW4MMyqjfLZPIplB c82O7lioNtpj425X6HFF4b/zQu+yDzhJsCFg5yqan57wVOlxY8CMGCdFhRdlV7ewg3/E 1q3fCOQVUxMFUbdRZPkJ+Detm3ELs2FiTD//0CrIQklJAlH1TOcbTM/K62Ilisre0jIU WM3g== 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=iPTxqGIdyG0WS52UlcCRbnqsldIMEZnaQKcya37YFRY=; b=RGTOOVwb+uJTaIeTr2ePWN0ldt6uJ7go9/beI7EY0mmVfV+WCy+O85PvilMgwo7lxC lUQVuocFPL3rMymHHGSZxjiYrmF8wZnXQIA1Ze+uW/SwUmBsc0jR5bYNlmMauy0sCbAS KM1Ci+QEhIEzD/r7W6pjIQ0wz21mw0B36VN3OPcfW4TUlKCU7tNGfesvwQ+s4hKVebYb dgOJZXPt1cOmGlin+0EdYB8eUaQjLq+RvRGitRbD0+ncr6L9oEBjtskZd5SVgSdfi4CC GdzTAWkT+zMWA+mhRU46ZlXXZcfIMbhwdywuzHK8j5Al2Xg/7e0i1+T55txtBOi38xQc 1fyA== 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 n10si10577950pgr.27.2019.09.01.21.02.52; Sun, 01 Sep 2019 21:03:07 -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 S1726414AbfIBECD (ORCPT + 99 others); Mon, 2 Sep 2019 00:02:03 -0400 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:56131 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725681AbfIBECC (ORCPT ); Mon, 2 Sep 2019 00:02:02 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01422;MF=luoben@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0Tb3eY5p_1567396912; Received: from localhost(mailfrom:luoben@linux.alibaba.com fp:SMTPD_---0Tb3eY5p_1567396912) by smtp.aliyun-inc.com(127.0.0.1); Mon, 02 Sep 2019 12:01:55 +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 Subject: [PATCH v6 0/3] genirq/vfio: Introduce irq_update_devid() and optimize VFIO irq ops Date: Mon, 2 Sep 2019 12:01:49 +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 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(-) -- 1.8.3.1