Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1227307pxb; Sat, 23 Apr 2022 00:13:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyD4rnRczp2nFqvOxoi1rNP++xZrtpTbApGSA1sqUpcsXySbdCs4W3E/NuMmQKefJ5DEpK X-Received: by 2002:a17:907:6d2a:b0:6df:e513:5410 with SMTP id sa42-20020a1709076d2a00b006dfe5135410mr7271973ejc.544.1650697983627; Sat, 23 Apr 2022 00:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650697983; cv=none; d=google.com; s=arc-20160816; b=EfJ699PsFFdEhndg9GrYbqbIXVfS7TpPb07sYy/CeLYviBDDdY8Ysk+L+YiQ0gH+zm vCKHbpH+2oYW1VtNlDb9A4qpiKLmNwnE6iawbkDvFCIg7SkwpiUfrS7JoBxAN+b/xRGl hV99zgrP5rWaeXFOWHFOQmbu2OBrN57vYjQ0/gVclqQEvbvjJdTUzNQe75mCKO7R9ZRB AWmnTQW1hExn2UmX9brMG+W5QLgcQgJK89NyvttvCjuftBssDywJwGezqplOvO4IebIn 1qGivGX0vFc0/FhFbh7BvzPLIiKAFp5aCM02LUznSLb0V5jDzQKfq+VHhe5dxBAuw+1d sm+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Xu6jWmS2V1JMyV/pquK6LUZ5tejcC5V2x7EeK8T2eUQ=; b=wsRitpIAiIyU8nHg+GapK/6farFtwuRGXrz1POmyGlT8LWFKBotK1pI7ZTXXq+FTZq 6RLNPfkhkIgAG9pi/fXTdK7QHx8wth2takakxDZm62cuh5V56xpbTvISVIgAd/N4aMd5 xwHxQK50QS82ir7NIr/5rYE8rZZ3UFVngSgW9P9k7XMRJ/DQO+0E0rBiB4TlL2DtgKTr YNyiclP3whUfa9hzyOd9Lhmh3q0BL752ahtgS7HUwP1VSaHjdftrVjWztV9Qvmi/BYI0 fzov4FHMGaJ6hAWUKl0vbjGu8amU2i+9jtcrZx7WxmgQ0rUUlKzHM4zcQbyoGEYE148a hr5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p9-20020aa7c4c9000000b00425c9eb7977si1520338edr.256.2022.04.23.00.12.39; Sat, 23 Apr 2022 00:13:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232594AbiDWFqf (ORCPT + 99 others); Sat, 23 Apr 2022 01:46:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230025AbiDWFqd (ORCPT ); Sat, 23 Apr 2022 01:46:33 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF6D864716; Fri, 22 Apr 2022 22:43:36 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 7331568AFE; Sat, 23 Apr 2022 07:43:32 +0200 (CEST) Date: Sat, 23 Apr 2022 07:43:31 +0200 From: Christoph Hellwig To: "brookxu.cn" Cc: kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, tglx@linutronix.de, frederic@kernel.org Subject: Re: [RFC PATCH] nvme-pci: allowed to modify IRQ affinity in latency sensitive scenarios Message-ID: <20220423054331.GA17823@lst.de> References: <1650625106-30272-1-git-send-email-brookxu.cn@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1650625106-30272-1-git-send-email-brookxu.cn@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 22, 2022 at 06:58:26PM +0800, brookxu.cn wrote: > From: Chunguang Xu > > In most cases, setting the affinity through managed IRQ is a better > choice. But in some scenarios that use isolcpus, such as DPDK, because > managed IRQ does not distinguish between housekeeping CPU and isolated > CPU when selecting CPU, this will cause IO interrupts triggered by > housekeeping CPU to be routed to isolated CPU, which will affect the > tasks running on isolated CPU. commit 11ea68f553e2 ("genirq, > sched/isolation: Isolate from handling managed interrupts") tries to > fix this in a best effort way. However, in a real production environment, > latency-sensitive business needs more of a deterministic result. So, > similar to the mpt3sas driver, we might can add a module parameter > smp_affinity_enable to the Nvme driver. This kind of boilerplate code in random drivers is not sustainable. I really think we need to handle this whole housekeeping CPU case in common code. That is designed CPUs as housekeeping vs non-housekeeping and let the generic affinity assignment code deal with it and solve it for all drivers using the proper affinity masks instead of having random slighty overrides in all drivers anyone ever wants to use in such a system.