From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDE67C433F5 for ; Thu, 17 Feb 2022 23:23:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229562AbiBQXXn (ORCPT ); Thu, 17 Feb 2022 18:23:43 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:60222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbiBQXXn (ORCPT ); Thu, 17 Feb 2022 18:23:43 -0500 Received: from cloud48395.mywhc.ca (cloud48395.mywhc.ca [173.209.37.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 387604C41C for ; Thu, 17 Feb 2022 15:23:19 -0800 (PST) Received: from [45.44.224.220] (port=44638 helo=[192.168.1.179]) by cloud48395.mywhc.ca with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nKq2p-0000n5-2W; Thu, 17 Feb 2022 18:18:39 -0500 Message-ID: <0a9c1bdcedac611518e4a90c1921d1f7657c2248.camel@trillion01.com> Subject: Re: napi_busy_poll From: Olivier Langlois To: Hao Xu , Jens Axboe , io-uring@vger.kernel.org Date: Thu, 17 Feb 2022 18:18:38 -0500 In-Reply-To: References: <21bfe359aa45123b36ee823076a036146d1d9518.camel@trillion01.com> <0446f39d-f926-0ae4-7ea4-00aff9236322@linux.alibaba.com> <995e65ce3d353cacea4d426c9876b2a5e88faa99.camel@trillion01.com> Organization: Trillion01 Inc Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.42.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud48395.mywhc.ca X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - trillion01.com X-Get-Message-Sender-Via: cloud48395.mywhc.ca: authenticated_id: olivier@trillion01.com X-Authenticated-Sender: cloud48395.mywhc.ca: olivier@trillion01.com X-Source: X-Source-Args: X-Source-Dir: Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Wed, 2022-02-16 at 20:14 +0800, Hao Xu wrote: > > > > Hi Olivier, > I've write something to express my idea, it would be great if you can > try it. > It's totally untested and only does polling in sqthread, won't be > hard > to expand it to cqring_wait. My original idea is to poll all the napi > device but seems that may be not efficient. so for a request, just > do napi polling for one napi. > There is still one problem: when to delete the polled NAPIs. > I think that I have found an elegant solution to the remaining problem! Are you ok if I send out a patch to Jens that contains your code if I put your name as a co-author? > > > +       ne = kmalloc(sizeof(*ne), GFP_KERNEL); > +       if (!ne) > +               return; > + > +       list_add_tail(&ne->list, &ctx->napi_list); > +} ne->napi_id is not initialized before returning from the function!