[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/3] x86/irq: remove duplicated clear_domain_irq_pirq calls


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 26 Jan 2021 17:08:51 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a/vQa2NbY/bVuHY04JqJMzn9D44lxaNuRm0/5qoznNk=; b=nZARjfuV2S74PAx5mTN+GB0Si+ivUr10fYostRpVkbjCYek7YMMI3ThyfuqLo2jMa+chPz0SAlQ9ok74ZvmSZtk9d5Yem2Xv1oW7wfw+S6iBcp9c2PmEbpSocXcP64jKmYmWrRCAjuLxwdaHLLyAzaL4RGmJpZ30VW/+9aoQ70VJyXAD3/jKlvoDiwfMboI11ExtpMsDZvSg+wdKVL7ypYxYSmj/gw2xYELa04Up+D7Lsj6lJhq4Xl4TgjEdxL393MC0d0b+AyjYoMt7iqZbWUE6+1fckUIEUHuVOO+ZeipuvzGZxAlg2EsUAZvn9xsaAvKRMHn0M1dmvbVSt9i4tQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XBkWleEn3u5pn1BKFkQhy5y0+xLOtIujCFTMoWTHInVsvHpJSPM//LAY2LdWcFmdFkUAwUVSeKFSq1+qFQ9+N3dMvmQO6abU+mxEvI5brAR/CnA4eWHjS7DpBJbf4uXeFkUBR1EoO9lPVrXi0AjOkfeDO2VpoIMlf/IneWhajM02PGR6K9+vBQVLxVZGcJYvZlR0/WjstZWcrpv5FVkRF8HYwm216QMuTS8zMGZIw36zeuD9dh8fLVowrflcAEoMAKhcq0tpUsDjPe2wuc7C9WAW5bF6fMoY2IgVNDBBZoTdqYiT0jLfty7YR5zxxHJZijLuobJZOZ8Xxqt0boMejQ==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 26 Jan 2021 16:09:08 +0000
  • Ironport-sdr: XpSQJtUVYHyEFO4zDDqODvuR4uGuMeiGFFY/U7pBXgYSGepOXOJC6rBetiEy9lMc2xFmN0POFV V+5/nF+RPMbHZbhhxOKr/6SRGexqnpWfZXVhMdJ/oAxHP51XbmX6S9sYxwOP9bMGFw651uu+Of kaFro21hsxEd7L4D/i5L6TdfnXejxrg07vKa9dBXTnuFC3Now4S0QSroI72kuRjtUwUBsDipDw z8TnV/v46hIW3V9Pd+D6ewjOo9xj0i8bR8IqNU7VpW2QIdneeXZoxa3Z2BL3huYiJo/uDIbuEI o+Y=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, Jan 26, 2021 at 03:38:27PM +0100, Jan Beulich wrote:
> On 26.01.2021 12:06, Roger Pau Monne wrote:
> > There are two duplicated calls to cleanup_domain_irq_pirq in
> > unmap_domain_pirq.
> > 
> > The first one in the for loop will be called with exactly the same
> > arguments as the call placed closer to the loop start.
> 
> I'm having trouble figuring out which two instances you refer
> to: To me "first one" and "closer to the start" are two ways
> of expressing the same thing. You don't refer to the call to
> clear_domain_irq_pirq(), do you, when the two calls you
> remove are to cleanup_domain_irq_pirq()? Admittedly quite
> similar names, but entirely different functions.

Urg, yes, that's impossible to parse sensibly, sorry.

Also the subject is wrong, should be cleanup_domain_irq_pirq, not
clear_domain_irq_pirq.

This should instead be:

"There are two duplicated calls to cleanup_domain_irq_pirq in
unmap_domain_pirq.

The first removed call to cleanup_domain_irq_pirq will be called with
exactly the same arguments as the previous call placed above it."

It's hard to explain this in a commit message.

Do you agree that the removed calls are duplicated though? I might have
as well missed part of the logic here and be wrong about this.

> > The logic used in the loop seems extremely complex to follow IMO,
> > there are several breaks for exiting the loop, and the index (i) is
> > also updated in different places.
> 
> Indeed, and it didn't feel well already back at the time when
> I much extended this to support multi-vector MSI. I simply
> didn't have any good idea how to streamline all of this
> (short of rewriting it altogether, which would have made
> patch review quite difficult). If you have thoughts, I'm all
> ears.

I would just rewrite it altogether. Code like this is very prone to
cause mistakes in the future IMO. If you want I can try to.

I guess the problem with this is that we would lose the history of the
code for no functional change.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.