Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp645762imw; Fri, 8 Jul 2022 09:10:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vo63Az2VZKJf/Uduqt2Sw8Kskm8Y9i7VveSLYh08NauEVARXNhDVcYd0gQfByaoyxmR4es X-Received: by 2002:a17:907:7b8a:b0:72a:9a42:d5ac with SMTP id ne10-20020a1709077b8a00b0072a9a42d5acmr4301277ejc.306.1657296622097; Fri, 08 Jul 2022 09:10:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657296622; cv=none; d=google.com; s=arc-20160816; b=HqBTiZbweASHB4lElfSIxIO0P2EcJiLP0NbElBvMSR4tslIXuJa6oUmQFPf03pJcnp 6S7YQue/z1hkEmAm5RJ/Doj4P0eyNqQmHhjK2sjkvit93Q71PMY/412TWPQqGKlcJKgU bFcihTwbxGkA9v9Bc+sGB9i6wX9QRoDw/UBB9w9Is4moDnG77rYMlUuG85ZHeyXrIUKN 4q2SETSlkBJhez8MkNY571osBLK0AhhMspSa7UmEbXwEAXnmcV8uF9EN/dGu4JAdS3zg yOX+EFTGtye2hydB1USbMCY0oDJxMNhz0fwrtWomzRuea2vrKQdQMf/Buks2QkGni5mM +l9Q== 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=2qYi6QRAXIoC5/GJOd8/GV/65rQmXuZYuqFcmMvOenA=; b=l8tKfxoSDa3MdnkZK9O9K+qBgdJ5FM04eNeEGyxAVBx8U1/BpYVR1tTc0bIkOEd+di FsCYcG4A4W4OvGvOwD2aVh0iQ8kymeJq7MVZ+z7zuucqXh+J5ooSgdUJJtJeDBJBs/YY pEBCZHfq0vyRk33kYa8pSCEZJMWV5+XbD/a+hY93RQ2kxRv5eGyYFRmnwW4vIZWvZvl6 LsE8Y7eRUxjwxCqrNY77oUP/7aO11uZjDrsupvEFBhVn6MSV1YpYH52vWhn03VV0NcUL ey6edVpVzEi5RydjmiL7fNqbIVUYUWIKA0h02q1/LTL35E4K2neDZsy0BvX6xBybmYJb 6lKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=tDqThvuk; 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 t36-20020a056402242400b00439b80cadb9si24114363eda.438.2022.07.08.09.09.46; Fri, 08 Jul 2022 09:10:22 -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=tDqThvuk; 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 S238821AbiGHPVQ (ORCPT + 99 others); Fri, 8 Jul 2022 11:21:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238808AbiGHPVM (ORCPT ); Fri, 8 Jul 2022 11:21:12 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD37D1ADA3; Fri, 8 Jul 2022 08:21:11 -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=2qYi6QRAXIoC5/GJOd8/GV/65rQmXuZYuqFcmMvOenA=; b=tDqThvukfm6Rl5xaMglGGZGrf1 MiBVvWRZyhOOG1UkM2V3/fcFJhNBTIj9vf2VxfKOonHWkgcvn2236UOsja3d9CFiR+8Ab7bvTFJMi D4ndHEUZJMfJVdOIkVZpC38Yi+5VL9t0m9NdBkV8ToKZywmYeV56R2dW7tp4cJAawwEzw5zI8dG6e /8+oD7Pb4b3LCi0LZn+7YJgF8Cph+r1gWE7lq6EHH/MP5YAMMfoas6FGGrd/TuZdtFAp/Vzmc8TKn rTwQa77sxBCuee+HfbI1mk5Rv+tYb92XbSpI4lSkiDY5hOfSRfEPTXyC4+9Hb0XI1TqMK7YMy5sAa oMKIcETQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1o9pmy-003b17-Ag; Fri, 08 Jul 2022 15:21:04 +0000 Date: Fri, 8 Jul 2022 16:21:04 +0100 From: Matthew Wilcox To: Ira Weiny Cc: Dan Williams , Greg Kroah-Hartman , "Rafael J. Wysocki" , Alison Schofield , Vishal Verma , linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org, linux-pci@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [RFC PATCH 1/3] xarray: Introduce devm_xa_init() Message-ID: References: <20220705232159.2218958-1-ira.weiny@intel.com> <20220705232159.2218958-2-ira.weiny@intel.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 Fri, Jul 08, 2022 at 07:59:22AM -0700, Ira Weiny wrote: > On Fri, Jul 08, 2022 at 03:53:50PM +0100, Matthew Wilcox wrote: > > On Tue, Jul 05, 2022 at 04:21:57PM -0700, ira.weiny@intel.com wrote: > > > The main issue I see with this is defining devm_xa_init() in device.h. > > > This makes sense because a device is required to use the call. However, > > > I'm worried about if users will find the call there vs including it in > > > xarray.h? > > > > Honestly, I don't want users to find it. This only makes sense if you're > > already bought in to the devm cult. I worry people will think that > > they don't need to do anything else; that everything will be magically > > freed for them, and we'll leak the objects pointed to from the xarray. > > I don't even like having xa_destroy() in the API, because of exactly this. > > > > Fair enough. Are you ok with the concept though? I'd rather have it in one place than open-coded in two.