Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp680315pxb; Wed, 20 Jan 2021 18:20:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyy3n19UnM8JjGFrVWMybHgDZoPC+keJtiyc7mrAjEZmDW/DgMWhnprb6n6dWu13CsetspP X-Received: by 2002:aa7:ccc6:: with SMTP id y6mr9189470edt.226.1611195653590; Wed, 20 Jan 2021 18:20:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611195653; cv=none; d=google.com; s=arc-20160816; b=0N0oEnAqnf2iSdCq3OGXZcJu2LofAsyH2NrKyOCrT/lEvcLk7ykIzfJSNSTNYk0XqM e6KpOhcJ/hAEsKuUXrR8lHWrNz/GDbUZqSVbI09AhWZUxoxHp/i17ObuD2WH/aJCGmu8 xphqjMMOuOt4KfdF2JOwsijz0VFKcUCmYwmVRVz+YmLyGQZNhEL7WugSuN9q+l5PgGFY 3a++Ckkmpc60H/GVT6RanRMfxXy7KRC5ZJNRAY1KCo59qDQa4cpLkRcv46dM8T+0Q6/8 0wJnztLuMGEoe6bOf3NI0FXGRfhsoWG5NGmKfZEHGH/OsEP9M401u7L/Wr9CYoSz5Gh7 Da/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=nSf0ToA2jort2u5AL1d6u4W1M1rj7Hzrgs+Or59IlL8=; b=uQyvWBKRFfERh6QsMW+wB/Nqc94ccZESQliXajVE5Hlr6LqKjL1thdFa4QcFkyZ7LV pigVbZuqjuwBt4iP7CN/N28/HNtVMKe/XhHXMNQOqminLlzAnyJPtrdrOWytO3l0WOBz FZw043TkK+8mkVmcI2hQfi3DrMfM7fnK+fv6oMRuETWJPCHdRIlwE+ldK0m1lZ2hLSZj lc5OjOQJcCjcJ4faiYO5wrVZ//jI/+cLWEiXKBfiVUFYacxuFgUbSu5LRUScWEezm9Ya cwasJU26Wvt33tgdsXesrUXA2F0JzOT2ODUOpO2Ejgrs4230cYDMTnXYEnLkIlTwgJ0t 9pcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Wx00Bh5r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r14si1526917edv.591.2021.01.20.18.20.30; Wed, 20 Jan 2021 18:20:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Wx00Bh5r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727221AbhATX43 (ORCPT + 99 others); Wed, 20 Jan 2021 18:56:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730704AbhATVkU (ORCPT ); Wed, 20 Jan 2021 16:40:20 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F95AC061575 for ; Wed, 20 Jan 2021 13:39:39 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id g24so51415edw.9 for ; Wed, 20 Jan 2021 13:39:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nSf0ToA2jort2u5AL1d6u4W1M1rj7Hzrgs+Or59IlL8=; b=Wx00Bh5rJYoL4qGksYW4rVJ/kBgxBKt2mOLjC9TC7EeE3ZEq7q4OnnIIHafptQ73dK hJs8dnWkRE7Ft9iev9hpbP0dhrGvSrUgOIwvpPVUn0DEnkQntiVbhynN9+6Nrl/QMlr0 QIzkdvK0iA7LxlsR8LWoQAktVCmDEl5Q9AD+oo/NJTKRYT25BZZ036v+RyeLrx0pf+1A Xf0xCxYM3WUJWkMajd8WBdhD6zvIWSVrAOoV2wNOxiuDri1pt2mSAFQ1KGXr+7q3FlH2 I5QqfpEz/N4nnkmWNI856YGLiBkPtO9C0OZtW4O/N28KHzANFfcQlUcqFMitar8vKbRz PPwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nSf0ToA2jort2u5AL1d6u4W1M1rj7Hzrgs+Or59IlL8=; b=A/YQlatcK8xnRRqfqVsrdfqfWaFK/45s9P5zU6yo1K8zJpfk1xOL/DY+RkB258Lk8M IeVEf8IdGlPW8VuwQIyySQaYmB9vZZfUIgZWmr3lxKCDKGOmOmKze321/vZvkUt38KL5 hHrLsAIKasrIqN5tu7wonQcI2Lpaf/GDGt1yfcrTvtb2Gu8gWz2F8Cs75nN8z9oCVPPd f6CSduhK8SfnuliGkTnuS2IZUx7k9v9TlU8Y50pkGFO++lRAM28XXbbtK2LMT5j2ebOI 802aiSvQ/qjTUv4YQ+oKR52drnWr5oYwEYSe7QwG7e3DsT4WmAFVTpO8MpRwwZgmqkKR I3Xg== X-Gm-Message-State: AOAM5337eycVuu4s36cFuQNv4r8NMiWz5eS3YSKLOtWU1/AacZm63Jv4 zLlItp6kYbjFfrLiiJkJ1F19+jvvZiKxyUYp9Amarw== X-Received: by 2002:a05:6402:5107:: with SMTP id m7mr6643099edd.52.1611178778234; Wed, 20 Jan 2021 13:39:38 -0800 (PST) MIME-Version: 1.0 References: <161117153248.2853729.2452425259045172318.stgit@dwillia2-desk3.amr.corp.intel.com> <161117153776.2853729.6944617921517514510.stgit@dwillia2-desk3.amr.corp.intel.com> <20210120194609.GA3843758@infradead.org> In-Reply-To: From: Dan Williams Date: Wed, 20 Jan 2021 13:39:31 -0800 Message-ID: Subject: Re: [PATCH 1/3] cdev: Finish the cdev api with queued mode support To: Christoph Hellwig Cc: Greg KH , Logan Gunthorpe , Hans Verkuil , Alexandre Belloni , Alexander Viro , Linux Kernel Mailing List , linux-nvdimm Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 12:20 PM Dan Williams wrote: > > On Wed, Jan 20, 2021 at 11:46 AM Christoph Hellwig wrote: > > > > The subject doesn't make any sense to me. > > > > But thn again queued sound really weird. You just have a managed > > API with a refcount and synchronization, right? > > Correct. > > "queue" was in reference to the way q_usage_count behaves, but yes, > just refcount + synchronization is all this is. > > > > > procfs and debugfs already support these kind of managed ops, kinda sad > > to duplicate this concept yet another time. > > Oh, I didn't realize there were managed ops there, I'll go take a look > and see if cdev can adopt that scheme. So in both cases they are leveraging the fact that they are the filesystems that allocated the inode and will stash the private reference counting somewhere relative to the container_of the vfs_inode. I don't immediately see how that scheme can be implied to special device files that can come from an inode on any filesystem. I do see how debugfs and procfs could be unified, but I don't think this percpu_ref for cdev is compatible. Other ideas?