From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sagi Grimberg Subject: Re: mlx5 broken affinity Date: Sun, 5 Nov 2017 10:36:00 +0200 Message-ID: <1d2e9304-089a-a769-9f38-a742dc066baf@grimberg.me> References: <2187e555-2c4e-ef55-1c3a-17f5af54d762@fb.com> <573060a9-19a7-9133-ef52-fa947088dabb@fb.com> <3af0c164-8dde-b6f0-45e1-edbbb28e7f73@mellanox.com> <83d3944f-8a31-eb31-93db-294906630b0e@grimberg.me> <556f3ff5-c1d4-25c6-7bfc-9866c0d9b323@fb.com> <9384acdc-a5d8-872c-0034-9a3869f4fc8b@grimberg.me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Jes Sorensen , Tariq Toukan , Saeed Mahameed , Networking , Leon Romanovsky , Saeed Mahameed , Kernel Team , Christoph Hellwig To: Thomas Gleixner Return-path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:47364 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751871AbdKEIgJ (ORCPT ); Sun, 5 Nov 2017 03:36:09 -0500 Received: by mail-wm0-f68.google.com with SMTP id r196so8339407wmf.2 for ; Sun, 05 Nov 2017 01:36:08 -0700 (PDT) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: >>> This wasn't to start a debate about which allocation method is the >>> perfect solution. I am perfectly happy with the new default, the part >>> that is broken is to take away the user's option to reassign the >>> affinity. That is a bug and it needs to be fixed! >> >> Well, >> >> I would really want to wait for Thomas/Christoph to reply, but this >> simple change fixed it for me: >> -- >> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c >> index 573dc52b0806..eccd06be5e44 100644 >> --- a/kernel/irq/manage.c >> +++ b/kernel/irq/manage.c >> @@ -146,8 +146,7 @@ bool irq_can_set_affinity_usr(unsigned int irq) >> { >> struct irq_desc *desc = irq_to_desc(irq); >> >> - return __irq_can_set_affinity(desc) && >> - !irqd_affinity_is_managed(&desc->irq_data); >> + return __irq_can_set_affinity(desc); > > Which defeats the whole purpose of the managed facility, which is _not_ to > break the affinities on cpu offline and bring the interrupt back on the CPU > when it comes online again. > > What I can do is to have a separate flag, which only uses the initial > distribution mechanism, but I really want to have Christophs opinion on > that. I do agree that the user would lose better cpu online/offline behavior, but it seems that users want to still have some control over the IRQ affinity assignments even if they lose this functionality. Would it be possible to keep the managed facility until a user overrides an affinity assignment? This way if the user didn't touch it, we keep all the perks, and in case the user overrides it, we log the implication so the user is aware?