Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7147219rwb; Tue, 6 Dec 2022 01:39:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf5fW+jx2BbPrVgd3U87KTKzX5JX1sdR5fNxnvOBS9z4z2KQTXFK9SlEJ+aS9dhRLYsXIhu/ X-Received: by 2002:a17:906:6d8a:b0:7ad:69eb:923b with SMTP id h10-20020a1709066d8a00b007ad69eb923bmr10378803ejt.19.1670319594208; Tue, 06 Dec 2022 01:39:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670319594; cv=none; d=google.com; s=arc-20160816; b=FFZHH4wBWpo2LnCBATURlUe+naPpokZIS6yANwLC2yTLytgs9EDWp48gaYySsDjczx MKSswZL9ZvVx6ZVxovXlVkHlTT7T5BfghtOGeBQ0OFbYcPmkAvzIvapyO9Hah6JXI84l sqMXyXwx+IyaxPq0o8bkyC6FvL9OAnob5vZMF8gBTdJ/wNxlPVD/mfSbE3t8P80EQzOI J0LIPG6MM5Ydy/pW/SHDRM68WmSnj6t0I97r4OZfEtoaXkWql8VBZwLxNS/65iYMIHiL COfZkWT7mGcDZ5z1i0fWekYb6WTuxk+ywmrbsm1TLDHReOKhmkMTkSuUDtTuk4yryb44 kwbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=aQpGqNHxYw+bSAB9c50lX21tcNWSxpddd/mG7+lfCjo=; b=jlLxcxCRn48xT4H7BcsySKw6G3bETnlaWsedwBQ++HBWFbzFjp2nLUz17XFBS8ad0g GQofLapUKNzoB1bQL3K5Nt0fRW35mzd0A+ZraNHcOaZbdC5l5utf/arWlIvAmpTxhj19 xSZC92Nw6uwqDoY7ecmjcWIgzTfbSwQkZfasmgsdNs5KcJSD9n8Un1hGivLLWOQf706w u7/YC968AepdGAKLLbjV1Df65U+V+ENxjzfyZS4iAhvzI5EYGJdlCwU/y5D9ZCBBsm3O /VoByTv3AbgXEHvv+S7FrQkUWrrIH5v/noVOeGvAzRQNHPW04kqGzbV/cC8sK/Fyq+8o EMqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=FCgNoG35; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv14-20020a17090760ce00b007c0d4f96d8esi8165006ejc.566.2022.12.06.01.39.34; Tue, 06 Dec 2022 01:39:54 -0800 (PST) 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; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=FCgNoG35; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234216AbiLFJ26 (ORCPT + 80 others); Tue, 6 Dec 2022 04:28:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231869AbiLFJ25 (ORCPT ); Tue, 6 Dec 2022 04:28:57 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 390A35F58 for ; Tue, 6 Dec 2022 01:28:56 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id gh17so4717885ejb.6 for ; Tue, 06 Dec 2022 01:28:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=aQpGqNHxYw+bSAB9c50lX21tcNWSxpddd/mG7+lfCjo=; b=FCgNoG35K9sAxR/tLD67EP+lONqVLi8q61xA185kswkEDyhCajPpZEiqXlmi/gU87w horZWF3KCDTIMwnEsr6kZ6aruINGqqKZDoqVkHdGepsKG4ZxCL5M1OMgtT8D8rFm14T/ +FwLXz0rlaem9ccHSkxv/QEBZJEDRHpIVdzT6nWVpYjSBeVyzyioiEg7uC2dMGJ3KUyk tO/ifYmrKCCB2M1bmWbwlMgiQ4QZbkjh5n4Fc9py+Fogzn7Bx5RJt+yulv1Y05G1z7fl WOglQS8aT/Q5ViFEWPgvNmtgkRPawyRByXccPz5uuBN6Jsn9DZ08wCUbSVZukANpC9UZ RZdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aQpGqNHxYw+bSAB9c50lX21tcNWSxpddd/mG7+lfCjo=; b=VEMCT1twmRtJkJFhLHUrl0yvZKUyhs1p8NXEfGQdJ6oT8k5nSVUytzITZHRCA68fpw a2JrC1g6b9KtfWr9y2ky2fQ08FVxqT80OCGxrvVzJbQYEzlibYQcNXYN7WmgSdfIIyuz ijmF+mfCzxPPpG738RG2YW2x9Or8XOqldtxTi7BKEWl0MRUI/tSVYSP7GJ/fvEkM81/J BHr7IrEHfuN8XWT7W5tsPXI2M3KKuUUhMGBGmeDkCEGmORMdkmpWT1K1YHD0IrxRYpIU fO1tY8Lz3MdiGnFc0X2sJUVHK0P6/Rlgo9p73QJvGn8/tyhnBb0meuwRrWnMOYoWDzx/ x5LA== X-Gm-Message-State: ANoB5plKaUR5839eITV08oRWUvAmsj57svm56EEL53lCTG6WRdiWgceN aji1BoqL9/PMyRUuoJiWJzhG1fCrmUhWJrXdebBI X-Received: by 2002:a17:906:9bc4:b0:7c0:e310:3193 with SMTP id de4-20020a1709069bc400b007c0e3103193mr9513930ejc.653.1670318934770; Tue, 06 Dec 2022 01:28:54 -0800 (PST) MIME-Version: 1.0 References: <20221205084127.535-1-xieyongji@bytedance.com> <20221205084127.535-2-xieyongji@bytedance.com> <20221206081847.GA8771@lst.de> <20221206084736.GA9507@lst.de> In-Reply-To: <20221206084736.GA9507@lst.de> From: Yongji Xie Date: Tue, 6 Dec 2022 17:28:43 +0800 Message-ID: Subject: Re: [PATCH v2 01/11] genirq/affinity:: Export irq_create_affinity_masks() To: Christoph Hellwig Cc: "Michael S. Tsirkin" , Jason Wang , Thomas Gleixner , virtualization , linux-kernel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Tue, Dec 6, 2022 at 4:47 PM Christoph Hellwig wrote: > > On Tue, Dec 06, 2022 at 04:40:37PM +0800, Yongji Xie wrote: > > With the vDPA framework, some drivers (vduse, vdpa-sim) can create > > software-defined virtio devices and attach them to the virtio bus. > > This kind of virtio device is not a pci device or a platform device. > > So it would be needed to export this function if we want to implement > > the automatic affinity management for the virtio device driver which > > is binded to this device. > > Why are these devices even using interrupts? They don't use interrupt. But they use a bound workqueue to run the interrupt callback. So the driver needs an algorithm to choose which cpu to run the interrupt callback. Then we found the existing interrupt affinity spreading mechanism is very suitable for this scenario, so we try to export this function to reuse it. > The whjole vdpa thing > is a mess, I also still need to fix up the horrible abuse of the DMA > API for something that isn't even DMA, and this just seems to spread > that same mistake even further. We just want to reuse this algorithm. And it is completely independent of the IRQ subsystem. I guess it would not mess things up. Thanks, Yongji