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 4605DCCA47B for ; Mon, 13 Jun 2022 22:49:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233171AbiFMWtM (ORCPT ); Mon, 13 Jun 2022 18:49:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbiFMWtK (ORCPT ); Mon, 13 Jun 2022 18:49:10 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED8823121B; Mon, 13 Jun 2022 15:49:09 -0700 (PDT) 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?