Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4757058iob; Mon, 9 May 2022 00:25:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTDfRYiMvfmpaunC1+ipnWGXXG6LbnGEaJJhDOvAw+6fPB0IHMiIjauhllS+/0h+cpp7GF X-Received: by 2002:a63:6a88:0:b0:3c1:4a6c:be3 with SMTP id f130-20020a636a88000000b003c14a6c0be3mr11943016pgc.13.1652081150581; Mon, 09 May 2022 00:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652081150; cv=none; d=google.com; s=arc-20160816; b=OBeA1z4HBp23QxpIySq+2WSm0wrvUy6+ENZMuWTOiwv19aPmIIy5euC5xM6wkWf+bs cfYeGwe4LiDLjxwdUGa0XjO06kTnayS+lcxFmQ/20y/EQJVzQrUtzIJuRKpW5SoUFwzA pnRnyr/nwoark0UnqHITyQmoT9wesk5uG2jzGoqSjeNQlVudRQX1kvXlcJtqL9B8gvms RzRqOIbwPkiHc1cESdZBrN/7FVGKT8IdRPPVPo85bATASsYApFgJVDIW8mW1zgm0rzxc q279RBm3mt3byS4FobiN6z0JF1zZoLQoOu4C8Jnw6kokYtXj78njluk8/F80eWxaiXeD 7GLw== 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:sender:dkim-signature; bh=mlYdaZj1ZllD0dqZ9JILFLLCIzKibd0Th5kenPcu9aU=; b=HgRG04egpByJj/9tEgc61uVC5K0dHHoSjUtqoapi217KAEL0f7V1mRVyghFKMftmHv fwsPd3oPuBz3x7QrXS65aT9fZKLKOtPKGI5HFoXf1G+gzToxd0sIyTQeaBdYAu8S4hM1 +AKF0RAdeaucgbtpBQzUSfBMJl/Ryz5M2pTiZxptZlvN1rlMklHiC8LQTr5+J3Veuw+a W9ysUBHG/Lm+pRJkTIk8p6qvSwEwb76LuaxZyRhCdCGUjP5DPBLrpfIg2n92AqamQZXV AiAE1iYc1N/tOPiiVh3jC89jMyd9Cmi3YRJRKRK5+YTunZrj2aUODFlugTOb/YfGZNU9 wzeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aLnCuVnk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x189-20020a6386c6000000b00381ff256f5esi11999005pgd.551.2022.05.09.00.25.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 00:25:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aLnCuVnk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7816E23BC4; Mon, 9 May 2022 00:21:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385488AbiEETut (ORCPT + 99 others); Thu, 5 May 2022 15:50:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385403AbiEETuc (ORCPT ); Thu, 5 May 2022 15:50:32 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E37FD5EBC3 for ; Thu, 5 May 2022 12:46:48 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id cq17-20020a17090af99100b001dc0386cd8fso4991668pjb.5 for ; Thu, 05 May 2022 12:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mlYdaZj1ZllD0dqZ9JILFLLCIzKibd0Th5kenPcu9aU=; b=aLnCuVnkP07jOSRDPM+S773YWsrmKkKkSF2qL4GIA3sDV7OGXqW9QWr//JB/9x8hFw Us2MPLD00hj9Cga3n6gCUvuC/36r1HblFssD+8Gk9mQOx9srm7it2ep4f6NBtCJRI4Oo 1ViRyd2gY/a019BGDDJ6YJRq6yoKRm7FKzw5aNj0Hwl07v57/RywR/gL5i6wYKAyYdKQ l2oSNqqrO8koCOOHCnvptPNc7cV88ElC3j2OEZ3ATqtiCDgVtzWjo4oW0250khQOen9/ nspVZIPhhi7ZaUBwrjeHDGRjRkO6M8zZLbvEgXU4HJDfruoXyPKsYbuFmcWUCJkXrA9o l4vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=mlYdaZj1ZllD0dqZ9JILFLLCIzKibd0Th5kenPcu9aU=; b=I/L3QXUmTYAbKHpJuYenkkpY02VpMp4ijtVoIJGBf/48aNkxzLxl/dihwsaE6EoKvi vdXdRH6BY2Iy/IgtY9d8gODVNpuFmsFh4DeWj9mNrvPZc8mxG7Z8iLo94NwqS4xWeqAX r5ne7R3IrAjZ81FqtW+nlcnaa5b3vc1DCfup/qCPhNNnH9ZGhrPai6c0iv71jbVSGffc jgb6XzC8Xa/h6Ye49+iAM1mtJES2TMMhrVj06xOhMyMEvHKUjZM6F98IMTZ+OoGWo25q 0Y4o7875ESOFQrR3YI+VTcrsA8nlpHS0b32NXKLjFNCrNRCRsjZ5TVIXoo/yJIIUQuuc mgkA== X-Gm-Message-State: AOAM531ESO7SFyeF/kXy8t+UVCVKvuSDU+7B3j4QEDfLQbOgtsyWGGcT 8Zx49AbBvCZgiv9LXgMns449xecRoHE= X-Received: by 2002:a17:903:22cb:b0:15e:d715:1bd8 with SMTP id y11-20020a17090322cb00b0015ed7151bd8mr5766669plg.159.1651780008231; Thu, 05 May 2022 12:46:48 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::4:29a5]) by smtp.gmail.com with ESMTPSA id z12-20020a63330c000000b003c14af50629sm1652742pgz.65.2022.05.05.12.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 12:46:47 -0700 (PDT) Sender: Tejun Heo Date: Thu, 5 May 2022 09:46:46 -1000 From: Tejun Heo To: Imran Khan Cc: viro@zeniv.linux.org.uk, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] kernfs: Remove reference counting for kernfs_open_node. Message-ID: References: <20220428055431.3826852-1-imran.f.khan@oracle.com> <20220428055431.3826852-2-imran.f.khan@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220428055431.3826852-2-imran.f.khan@oracle.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 Thu, Apr 28, 2022 at 03:54:27PM +1000, Imran Khan wrote: > The decision to free kernfs_open_node object in kernfs_put_open_node can > be taken based on whether kernfs_open_node->files list is empty or not. As > far as kernfs_drain_open_files is concerned it can't overlap with > kernfs_fops_open and hence can check for ->attr.open optimistically > (if ->attr.open is NULL) or under kernfs_open_file_mutex (if it needs to > traverse the ->files list.) Thus kernfs_drain_open_files can work w/o ref > counting involved kernfs_open_node as well. > So remove ->refcnt and modify the above mentioned users accordingly. > > Suggested by: Al Viro > Signed-off-by: Imran Khan Acked-by: Tejun Heo Thanks. -- tejun