Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1245129pxb; Sun, 19 Sep 2021 10:37:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz62IDVt6vE0C8k33YmJ66PumZZZb5UXW7RYV87a343qwak4oWDpBH3f63cDsxJI1pfNaUZ X-Received: by 2002:a05:6602:1a:: with SMTP id b26mr2429277ioa.0.1632073056752; Sun, 19 Sep 2021 10:37:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632073056; cv=none; d=google.com; s=arc-20160816; b=dQRrkANGGRRxO0s6ja4ARBBWyOaLbfVDWPRE6w/Am4VBeew/x/OqGi/yva3CFo5FjL /a42lQanGQAv3hEgOTcNppaSEDh8oJfXMt/hW7J/IoP0lEoEYKHM4XIUc+R/H2KDXCu7 9xIyXRTepIYqgSRsxQduiVsX7ZxYipfAZPjvCzeCyjw9t/Lzy65BXgeSNT5Qrmeq6q1/ +Cxe2iG7iTMuFYo6lREtZpPO7xaKr9RKEpi8O2pKO18YNDPea8yPyiwGnY4J7v2FKu8E N/Iovwg+9z9NTLq3PlZubQpVL71r2whzGNSuquhbpjguhF0VFIh1ZvPtik0I/Kn5uQS6 P3fw== 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=2TKPAYwsM5aldz1mPdl+bnmxWM+wWp5NzsC7Oo3puGs=; b=gtWEiipBmgXHJ4M6Zfo7Sxx2vHaKkog8gVchGpn4cpBbZdcbfAR9EEgGNrGUNPkK0t jjvu5cyKuHQsFKi6Xpne9YA7j2o8PY9vva1Ijw/sMGOm8gzepLTja/Jv21PEIs3Ax0U7 6T3qw9B+e6dNwueUm8WOta8yWsCkfCWWMhePtkVctffkOGwMAlG/4Vw6e6z662LE4qNK eU9UJ6ALOL0b374+Qd4WhtTkjeDMtpNXij2FLmBbDDwR8kaVuwXddsR1pJmTgqqzJ44t yIbxH8ZqnsFkrDWhGUSmfGcLIsirwgAlJ9qsG71f8JdP2ymMQFjVT1e1vItvf1j0qD3M EhRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w18si10481732ilc.63.2021.09.19.10.37.24; Sun, 19 Sep 2021 10:37:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233195AbhISP0L (ORCPT + 99 others); Sun, 19 Sep 2021 11:26:11 -0400 Received: from kanga.kvack.org ([205.233.56.17]:37213 "EHLO kanga.kvack.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230105AbhISP0L (ORCPT ); Sun, 19 Sep 2021 11:26:11 -0400 X-Greylist: delayed 1679 seconds by postgrey-1.27 at vger.kernel.org; Sun, 19 Sep 2021 11:26:10 EDT Received: by kanga.kvack.org (Postfix, from userid 63042) id C0D346B0072; Sun, 19 Sep 2021 10:56:45 -0400 (EDT) Date: Sun, 19 Sep 2021 10:56:45 -0400 From: Benjamin LaHaise To: Hamza Mahfooz Cc: linux-kernel@vger.kernel.org, kernel test robot , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-aio@kvack.org Subject: Re: [PATCH v2] aio: convert active_reqs into a hashtable Message-ID: <20210919145645.GE16005@kvack.org> References: <20210919144146.19531-1-someguy@effective-light.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210919144146.19531-1-someguy@effective-light.com> User-Agent: Mutt/1.4.2.2i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 19, 2021 at 10:41:46AM -0400, Hamza Mahfooz wrote: > Commit 833f4154ed56 ("aio: fold lookup_kiocb() into its sole caller") > suggests that, the fact that active_reqs is a linked-list means aio_kiocb > lookups in io_cancel() are inefficient. So, to get faster lookups (on > average) while maintaining similar insertion and deletion characteristics, > turn active_reqs into a hashtable. You're doing this wrong. If you want faster cancellations, stash an index into iocb->aio_key to index into an array with all requests rather than using a hash table. -ben -- "Thought is the essence of where you are now."