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 EF8D0C83F12 for ; Tue, 29 Aug 2023 18:34:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237560AbjH2SeJ (ORCPT ); Tue, 29 Aug 2023 14:34:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjH2Sdl (ORCPT ); Tue, 29 Aug 2023 14:33:41 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9221F19A for ; Tue, 29 Aug 2023 11:33:37 -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-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=cFaAbUJjl2UXtlahY+fCqV8++1uLiZUrQMG64DLh/k8=; b=Cv4sMiBtHPqhcvYzMcH9hdAWnx Q9OMnGzle6A0Gq2+3jpLjbG4PDAwEiqttJUNJ4wUs/N7xwqmORzj1ejuujmrSTPiaYYHlWgHo8Po3 B+Y6zZ9XM5Grju4Ix49bxDj1xVGinBvTocE7RhIhZKYspCLdZiYMVaEncUMO0gwDZ3kt4goYO9pDL QqKjhBdI8nalakhFQ7nr7J6XWO959b4pV4nTTCVZ7SL6ud0RVTpFX/zAH5KAX/A5kNu5gaIeNS5DJ iDgFU04JUnx9wqoGys2nTQjPB/zBvXXMxFEsOSSVX00aevP7bdg8C5FPYVYnGgWrkt9y/PuswYK5z XpQg/jqg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qb3Wo-0087wD-Ey; Tue, 29 Aug 2023 18:33:26 +0000 Date: Tue, 29 Aug 2023 19:33:26 +0100 From: Matthew Wilcox To: James Zhu Cc: =?utf-8?Q?Micha=C5=82?= Winiarski , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Simon Ser , Oded Gabbay , Christian =?iso-8859-1?Q?K=F6nig?= , James Zhu , Pekka Paalanen , Emil Velikov Subject: Re: [PATCH v6 1/4] drm: Use XArray instead of IDR for minors Message-ID: References: <20230724211428.3831636-1-michal.winiarski@intel.com> <20230724211428.3831636-2-michal.winiarski@intel.com> <10bb9689-9226-d47c-4cf1-7bf9d599456c@amd.com> <6qcxpntlr36itieyoyebsncwdv4vadr5ac7imgl4rdemoyedvp@a3m7l32pkcnf> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 29, 2023 at 01:34:22PM -0400, James Zhu wrote: > > > > @@ -1067,7 +1055,7 @@ static void drm_core_exit(void) > > > > unregister_chrdev(DRM_MAJOR, "drm"); > > > > debugfs_remove(drm_debugfs_root); > > > > drm_sysfs_destroy(); > > > > - idr_destroy(&drm_minors_idr); > > > [JZ] Should we call xa_destroy instead here? > > We could, if we expect the xarray to potentially not be empty. > > From what I understand - all minors should be released at this point. > [JZ] In practice,  adding destroy here will be better. Why do you say that?