Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2191551ybl; Thu, 15 Aug 2019 07:59:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPtQ4HYBeIYdvG7/o4tWCpmw7dl0S3BroXsE7GR0dsfrOnACHNKmUO5PDHdCtlpzSCflF/ X-Received: by 2002:a17:902:7488:: with SMTP id h8mr4804713pll.168.1565881149567; Thu, 15 Aug 2019 07:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565881149; cv=none; d=google.com; s=arc-20160816; b=zeAT9wxj+S3s5bJxrfgllYSg8cQatVAPTOcGa4miGg8bK/iRWCFxDeP1orfqg0YeVW PKKVRcQldvvQXfV4sGvvvMvlTFbiWqwSHj28cMaMoio0sMnGOuDteeACBs9yM9UOpj1Q VyHzE0yrDRKYCUV8fYc9mxfUSy0384UNs1nKxFOZeTkF/dxWxkV1jvY//hRZSl7bk30D P2t1tRKVxiESkS7EMHQ+kim/PZqv72m6ZmtwPwq7wUIsMV/67rCuedpjRHRuoQp/w7iR 2djjRKn4+J7iTAPPYROV4ZKh3QufwmOM5Omi7Agv0/G1LRdiWqt/dZ1+TFeVzMyV/QQJ j+RQ== 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=wNzWB+J9r5LjyllJSLYBc0K6NtPevxbFr2+MufhXPa0=; b=zR5yXkObZ+CCqdGkUwRMx6TRNdKfKH1CHVgYhqp+FInyxQZGfSENgDyDfPkTaQe9kR ZF3Z/wlpQVigKnwZ/9aKZhaJ66w/yBflB8WGFut7YRf3zoYBnW9Ce46ILlT0VRC+9bH7 GP83+lWl4Hu+3PSmjGMsznNyqkc8cWwTFNHb9LmaFdbHWKC07Oy26/qJD+5qySJ5yZxp ulxbvRKqAvzbWfE0UVv8+ChDxcX1QERyrstwkilbTkmXaFiGnUSQpMibYve848n+iC5D fSw8R7pflha0I4WMZlJ8ZVGFDm9cysIAXvIjgXdG95HxERpPgnw6uFcTVEfHXqgtWh9j c6Zg== 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 q13si1117471pjb.13.2019.08.15.07.58.52; Thu, 15 Aug 2019 07:59:09 -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 S1732071AbfHONDJ (ORCPT + 99 others); Thu, 15 Aug 2019 09:03:09 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:37323 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730775AbfHONDJ (ORCPT ); Thu, 15 Aug 2019 09:03:09 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04446;MF=luoben@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0TZYQf.p_1565874181; Received: from localhost(mailfrom:luoben@linux.alibaba.com fp:SMTPD_---0TZYQf.p_1565874181) by smtp.aliyun-inc.com(127.0.0.1); Thu, 15 Aug 2019 21:03:06 +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 v3 0/3] genirq/vfio: Introduce update_irq_devid and optimize VFIO irq ops Date: Thu, 15 Aug 2019 21:02:58 +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 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 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 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 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 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 | 101 +++++++++++++++++++++------------- include/linux/interrupt.h | 3 ++ kernel/irq/manage.c | 110 +++++++++++++++++++++++++++++++++----- 3 files changed, 164 insertions(+), 50 deletions(-) -- 1.8.3.1