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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7080C4363C for ; Sun, 4 Oct 2020 14:16:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D02C20735 for ; Sun, 4 Oct 2020 14:16:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725910AbgJDOQG (ORCPT ); Sun, 4 Oct 2020 10:16:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725825AbgJDOQG (ORCPT ); Sun, 4 Oct 2020 10:16:06 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09D02C0613CE; Sun, 4 Oct 2020 07:16:06 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kP4ns-00BnIM-ID; Sun, 04 Oct 2020 14:15:56 +0000 Date: Sun, 4 Oct 2020 15:15:56 +0100 From: Al Viro To: Matthew Wilcox Cc: Linus Torvalds , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Marc Zyngier Subject: Re: [RFC][PATCHSET] epoll cleanups Message-ID: <20201004141556.GO3421308@ZenIV.linux.org.uk> References: <20201004023608.GM3421308@ZenIV.linux.org.uk> <20201004121329.GG20115@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201004121329.GG20115@casper.infradead.org> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Sun, Oct 04, 2020 at 01:13:29PM +0100, Matthew Wilcox wrote: > Have you considered just storing a pointer to each struct file in an > epoll set in an XArray? Linked lists suck for modern CPUs, and there'd > be no need to store any additional data in each struct file. Using > xa_alloc() to store the pointer and throw away the index the pointer > got stored at would leave you with something approximating a singly > linked list, except it's an array. Which does zero memory allocations > for a single entry and will then allocate a single node for your first > 64 entries. Won't work - those struct file can get freed while we are collecting the set/allocating epitem/calling ->poll()/etc.