Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp922130iog; Mon, 13 Jun 2022 16:20:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoI5RygmX1UkqPP4VUulQuJkHjYI540YaOwYEzQ8MxuGOpl7qGV1VSMj+1QFs8Bf6+dpNB X-Received: by 2002:a17:906:eb54:b0:708:99d6:83e with SMTP id mc20-20020a170906eb5400b0070899d6083emr1690589ejb.745.1655162426029; Mon, 13 Jun 2022 16:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655162426; cv=none; d=google.com; s=arc-20160816; b=mrcraBRTDd5Z9unVTqQZ3M2tqxORAeLbpXLsUu2WvM2A5uC01erGQWzYZkv3N/kSgl pTNB+NuOMyw0wyhBCfILUUWTwDwoNGXA5vIRDA94LFAS1chZ0ZEikMorjCBgHu1jL1rY 1t5omVqRz68SeYbsQb9u5nX8frxxnl3w9X98sE3F6t60BQC1nYWAkMWjGyHkIOTSIDa6 Z03zz5e/zd0tUs24KIMVsxam8K7mxzX9Qfo4OoV/+4faPNpfBMWrJ8xdi5qBJxsFgwHM s21f0PxPPya017YTNGHg86OGGmVUqqwzNfuDPuQ5LxN5pAYThnib6++BYsTOFV3mB0L7 USBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vivHcuWEO7dFMdfWmFo2zz7FZRzU0nU+SpS3rXiOnKw=; b=bZTbiAZbtMF3U5JqKjcu4HSuHdRPGnLUuLGNH1op0SLMuY56qIuonTdK9GptVsCNKM eG5C2ME7TktfKr6dUNfQvxckv/t9Fpl0ZrYOu258RVhzguk7YQVt0FI6LrB1PURixqNf jqaI2UzzZ+7ol/fkqt0IyDgJM8Pw4V3xBSr8rijpQow0EMnL9PS1ReqkDarZe+Yr4oTf 9cBBv/tZSf5dP7UbzbOiKMJfMHktj7nrN15DGuWIv40gR4wgctcKE43uYEqd2yQgzez7 fftTYCWCttL4uM1vFriP5Cd2YYSlyMEuvyZkumli8Ce7e7Iq4CJgOSJK1eWrrtKqXSIE wIVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=iW5b1d09; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i20-20020a05640242d400b0042dd2f1949dsi10921267edc.511.2022.06.13.16.20.00; Mon, 13 Jun 2022 16:20:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=iW5b1d09; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232762AbiFMWtM (ORCPT + 99 others); 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: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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?