From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by gnuweeb.org (Postfix) with ESMTPS id DA03E7E60D for ; Mon, 13 Jun 2022 22:49:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=vivHcuWEO7dFMdfWmFo2zz7FZRzU0nU+SpS3rXiOnKw=; b=iW5b1d09EFoLvsVlISsRSBUFm+ i0yU6R1qoudm0DVptYWGiDb4K1rbX9NCW4n7gRx/qPIs+Qx7llAtxEorPQO0y20O7/Me9iOqwEepZ rIR06xpcRk8Ci66ZeGy0dEfELDTD7bZBT9hR52YNbNZWtqVHPqvHQrNxyxS4b1813A3n/IPHqJvZz yaLZyzSJNnrTSlqHEDf2NgHEuFoJutfmcNCQlttqe34fVD+PQkKsZZDtpuWl9Lrj6LeI+2wexcy6x sjVOGsUf9kmyLA3RlmwcEJVDoyoIyefkiGVbQRB6J7rhnWifAKdnLYlQsp3lS6Xc3w6RJ1gyrMUQ2 JlDWpDDQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1o0srU-00HF9w-Vs; Mon, 13 Jun 2022 22:48:45 +0000 Date: Mon, 13 Jun 2022 23:48:44 +0100 From: Matthew Wilcox To: John Johansen Cc: Linus Torvalds , "Eric W. Biederman" , Ammar Faizi , James Morris , LSM List , Linux Kernel Mailing List , Al Viro , Kees Cook , linux-fsdevel@vger.kernel.org, Linux-MM , gwml@vger.gnuweeb.org Subject: Re: Linux 5.18-rc4 Message-ID: References: <226cee6a-6ca1-b603-db08-8500cd8f77b7@gnuweeb.org> <87r1414y5v.fsf@email.froward.int.ebiederm.org> <266e648a-c537-66bc-455b-37105567c942@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: On Mon, Jun 06, 2022 at 02:00:33PM -0700, John Johansen wrote: > On 6/6/22 13:23, Matthew Wilcox wrote: > > On Mon, Jun 06, 2022 at 12:19:36PM -0700, John Johansen wrote: > >>> I suspect that part is that both Apparmor and IPC use the idr local lock. > >>> > >> bingo, > >> > >> apparmor moved its secids allocation from a custom radix tree to idr in > >> > >> 99cc45e48678 apparmor: Use an IDR to allocate apparmor secids > >> > >> and ipc is using the idr for its id allocation as well > >> > >> I can easily lift the secid() allocation out of the ctx->lock but that > >> would still leave it happening under the file_lock and not fix the problem. > >> I think the quick solution would be for apparmor to stop using idr, reverting > >> back at least temporarily to the custom radix tree. > > > > How about moving forward to the XArray that doesn't use that horrid > > prealloc gunk? Compile tested only. > > > > I'm not very familiar with XArray but it does seem like a good fit. We do try > to keep the secid allocation dense, ideally no holes. Wrt the current locking > issue I want to hear what Thomas has to say. Regardless I am looking into > whether we should just switch to XArrays going forward. Nothing from Thomas ... shall we just go with this? Do you want a commit message, etc for the patch?