Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1609886ybe; Fri, 13 Sep 2019 21:05:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwevFksMGDapUsY13BP4BTwY8w87zdW4IScFMRPHGCjQ6PQpvTnYjmbw86x4PovPoqRkSXU X-Received: by 2002:a50:9e08:: with SMTP id z8mr52192538ede.305.1568433914213; Fri, 13 Sep 2019 21:05:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568433914; cv=none; d=google.com; s=arc-20160816; b=KXA3N2+nvxRb78vlUO+yQWjrt8LHIatNlXkMgHGC2o21tKE/BEsRGKsoLRywJ4A8TZ mGaBksQN74QpKoABd+wHUv7NUFVnrv1q+Ykzhj6t0r20Au2byDUnXN0BnK65Ehm7ZSoz S/EQ7KgDuhCo9Nq1u3UZnLsiw3zDooNuFubUz6HeARsqI53wxiRCo9E1EJURu5foy4Ew W+JKIZOR7DArqBb4VCZpOEeRBTIDgmWQ5RrDPeyOfIJ/0ygHPC5BX/n82ROQnLAZ0qVg h6kunn51EKyciEE0LX4n1UZxfkScw5FDot84jJ0BQP5GMdKeOKCW+qdqEfNzNuOLvXyj gG9g== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=ExyP+u7uYwZmtPJyITalirYYp1i0a/l1X/bt5cKDRxI=; b=D7yxXsI6wqFXjl/1cvmqB1VxIBCwB28rWgZjBIIbHgfepjUffmulkYAeYqO5YCK0Qu 7/ErmmVRw1f2IHskTfXbft/sFBfDQaTMKbJlaCGsMD1bX3HtMczYldCEqeOlQyw7SbyF MnzWpoe/6j0k3GLkhUJIwFG3E33qnWED5xQjnBcFfQf73D3EG7FpKVAAjOvWJyNP1+YY Xlc6C7akAR3mefm7T0gVdQwUc1Bd+1NE0cKfiFXU5nrzGlTrkhxQGS8lUlTaV169PG/f MNVnSoeSFDesRKuvpFu2wRlMDsvwXCi893Sh4cb2A9NedI6HFm5KDKY7jETJJvFhI/eO QlIQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si22566441edf.328.2019.09.13.21.04.21; Fri, 13 Sep 2019 21:05: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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731077AbfIMRoz convert rfc822-to-8bit (ORCPT + 99 others); Fri, 13 Sep 2019 13:44:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55842 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731061AbfIMRoz (ORCPT ); Fri, 13 Sep 2019 13:44:55 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8BB0418C4260; Fri, 13 Sep 2019 17:44:54 +0000 (UTC) Received: from x1.home (ovpn-118-102.phx2.redhat.com [10.3.118.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3AF95C28C; Fri, 13 Sep 2019 17:44:53 +0000 (UTC) Date: Fri, 13 Sep 2019 11:44:52 -0600 From: Alex Williamson To: Ben Luo Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, tao.ma@linux.alibaba.com, gerry@linux.alibaba.com, nanhai.zou@linux.alibaba.com Subject: Re: [PATCH v6 0/3] genirq/vfio: Introduce irq_update_devid() and optimize VFIO irq ops Message-ID: <20190913114452.5e05d8c4@x1.home> In-Reply-To: References: Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Fri, 13 Sep 2019 17:44:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Sep 2019 14:30:16 +0800 Ben Luo wrote: > A friendly reminder. The vfio patch looks ok to me. Thomas, do you have further comments or a preference on how to merge these? I'd tend to prefer the vfio changes through my branch for testing and can pull the irq changes with your approval, but we could do the reverse or split them and I could follow with the vfio change once the irq changes are in mainline. Thanks, Alex > 在 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(-) > >