Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4234518ybl; Tue, 20 Aug 2019 08:53:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0mx8qpxOwRsvQ0p+NMe8TIvxaE6CA2ZYjo7J5wuo4wdykfUM3XrsJj6y/ipDkOCMAlliD X-Received: by 2002:a63:c442:: with SMTP id m2mr4973827pgg.286.1566316422632; Tue, 20 Aug 2019 08:53:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566316422; cv=none; d=google.com; s=arc-20160816; b=L5bfiOgXXms7LoPFXKbuYvt0SSjuO2ebc1mjd8VEhtSj8/AlzFquH7K/+CypRn7/4V apTKyfjgB2a51/JTB1zImMyMelVPx7F9kCJtw0m8NipiNotMFRysywtPhsvW+04CgHc2 5kwhDdEb5LKSnJ3onRyIfEYAEPpDYJNLwwkMiZE959Z1ivt388Q2kE0OpFdt7PzDk6fr nEGOH/CclCELvLe5H+dKAqqJw1ZA8NA/VOSiNbe/3BJ7BVuOD2ww8K90E6RhHXg0/tgm p5pnBA7IIRmi20VnSgzItuU/FYNhg3fNIQYEJepkvfuW+j4rD0Ox2vA1Xil3PtTkbJXL CIsw== 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:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=r8RTF1bXRzdpnIFVPD9v6Xrmp9oCYLiXnqdsgMDCKpQ=; b=AgDWIHFycHw1PlwRg8TdR5a9YTrIWZB5riif25BCFyqFbiYl1qHmvi2O+GkDPuPmry TAPi2IHDG+vJaHQEfXjfrN/cYwPemaBctSVAcLyHcFgFP1GjYQlqwyt98tySPXnp2i00 U7x5vgBJn4nTkNwK0T+9dn0zSGaukJ5gOel+l2rB885GbD14SA6/LkbgOQvc8f5iYJar 5OeSH1XAU+YwrL6T+9RKx/pUNjDqyJOATlKBmE/v1sMUL0iZEovI4qxQRK3dZQdwqlSC 6NM+SPNZzTUgVpy1C7ExrhKzKn6wsdfgZUfBNm+A4xwwJ9GXo4nAi7HB4y1IS4rodOUg zSrQ== 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 a9si13223402pfn.104.2019.08.20.08.53.27; Tue, 20 Aug 2019 08:53:42 -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 S1730760AbfHTPvj (ORCPT + 99 others); Tue, 20 Aug 2019 11:51:39 -0400 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:33957 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729827AbfHTPvj (ORCPT ); Tue, 20 Aug 2019 11:51:39 -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=e01e04423;MF=luoben@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0Ta-xkxy_1566316283; Received: from bn0418deMacBook-Pro.local(mailfrom:luoben@linux.alibaba.com fp:SMTPD_---0Ta-xkxy_1566316283) by smtp.aliyun-inc.com(127.0.0.1); Tue, 20 Aug 2019 23:51:24 +0800 Subject: Re: [PATCH v3 0/3] genirq/vfio: Introduce update_irq_devid and optimize VFIO irq ops To: Alex Williamson Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, tao.ma@linux.alibaba.com, gerry@linux.alibaba.com, nanhai.zou@linux.alibaba.com, linyunsheng@huawei.com References: <20190819145150.2d30669b@x1.home> <20190820092209.0c89effd@x1.home> From: luoben Message-ID: <4b2c76e3-91da-09b6-65f4-535828373c04@linux.alibaba.com> Date: Tue, 20 Aug 2019 23:51:23 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190820092209.0c89effd@x1.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2019/8/20 下午11:22, Alex Williamson 写道: > On Tue, 20 Aug 2019 12:03:50 +0800 > luoben wrote: > >> 在 2019/8/20 上午4:51, Alex Williamson 写道: >>> On Thu, 15 Aug 2019 21:02:58 +0800 >>> Ben Luo wrote: >>> >>>> 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 >>> What guest environment is generating this? Typically I don't see that >>> Windows or Linux guests bounce the interrupt configuration much. >>> Thanks, >>> >>> Alex >> By tracing centos5u8 on host, I found it keep masking and unmasking >> interrupt like this: >> >> [1566032533709879] index:28 irte_hi:000000010004a601 >> irte_lo:adb54bc000b98001 >> [1566032533711242] index:28 irte_hi:0000000000000000 >> irte_lo:0000000000000000 >> [1566032533711258] index:28 irte_hi:000000000004a601 >> irte_lo:00003fff00ac002d >> [1566032533711269] index:28 irte_hi:000000000004a601 >> irte_lo:00003fff00ac002d > [snip] >> "[1566032533720007]" is timestamp in μs, so centos5u8 tiggers 30+ irte >> modification within 10ms > Ok, that matches my understanding that only very old guests behave in > this manner. It's a curious case to optimize as RHEL5 is in extended > life-cycle support, with regular maintenance releases ending 2+ years > ago. Thanks, > > Alex But repeatedly set interrupt affinity in a new version guest can also cause the problem. Thanks,     Ben