Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4621786iob; Sun, 8 May 2022 19:32:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytp71mkYUmtvX2EN4MFn7zUnCuVjJIUggPMGBSV2f83LBCtCiOcJ2Qqnq8H89GV5bmbM35 X-Received: by 2002:a05:6a00:2908:b0:4fa:9297:f631 with SMTP id cg8-20020a056a00290800b004fa9297f631mr13678720pfb.3.1652063577031; Sun, 08 May 2022 19:32:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652063577; cv=none; d=google.com; s=arc-20160816; b=NPycGFZtz3EDHxhzu9sVs5z4cFvReadV6A3CIGS0lrXroWHMm7BNgbrY+udTj2zlk+ 07ey6FfviJUrTWc4RmkHDtllFJhnITZdly4ctuJadAXpseHvzxgDArSuuvQGKpTPl7zK uEDQCwVvnP2riKMmdfOt19hGkcRl6DgiWge3NjszJyV468aSVWisk+PMZprVXNwHKSqS v4HdpcRnIxVc3UHOMQAazZOtaLLXizb8vC3nZvUpba7qAaso5ZPuALPD9J/IOes8FWIl g5yL7Q+p102I4Tt8WP3PZN0n5Tc5lDLjPKyFCYBUaKnlLmrE+EDde71oyRE8Y6WQtHc7 mhfA== 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=sIjvi2ONOFeBeVuRiGtsd7aQNLczbj8OwDdnK8wAXKw=; b=aOuEI5zsuV/PAJ5tqc4yMeVaj9i8n3KcwML9/16JPyRWrlB0eXtNiyujjMuCeI3GNN cR9K1qrb8S89MfnWKqaXqbTZ9YovKE6CnZbiaiMiRFNjwlth7DZcqZj2dW9S11i/AVkT unqOfRHafS9N1gg/gi+uyJWEdBluLxAdPBJtA0WnafD3zgmUIBADFCMUisNrxEQlhrDR KqR5M4kFIUc9dvs+QQPHy+GvNKJQzRn3wGi8kvd1mnHKLDzHTY974w6jDlFpFJTBXtwD k4NE3+PMV3PrxfCYHR2nyhMfc3c3YkGFL0HWtlAOMc+q+01ogcaM3Ppl5m7FKHrURsRr X+6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aer0VOWf; 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 h1-20020a17090aa88100b001dc54892bcbsi12442752pjq.147.2022.05.08.19.32.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 19:32:57 -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=aer0VOWf; 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 6A0CF7307E; Sun, 8 May 2022 19:31:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245002AbiEEUJg (ORCPT + 99 others); Thu, 5 May 2022 16:09:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237607AbiEEUJe (ORCPT ); Thu, 5 May 2022 16:09:34 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B99B3615A for ; Thu, 5 May 2022 13:05:54 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d22so5382672plr.9 for ; Thu, 05 May 2022 13:05:54 -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=sIjvi2ONOFeBeVuRiGtsd7aQNLczbj8OwDdnK8wAXKw=; b=aer0VOWfI6ezatiFZA9hRTPxPjQ0x/qrluledVqkvB5bOCsQoGzYQ3n7KQdAzZhaLe juxO6rqI80TIWFlaS22iD1IuIVkvh6MWX3XFN38CjbOZPoUpQsbOwmcb7OKU1TsqwQMu VIpptp76tlnlP8Nt1kggAoIOfS3of/aC/M1vFugeMajoGiw1FFSt4tFkKvvyG6+hrrtw 3/6X6nvHfBKWcMwnIs15SFv62euGepNTjE2J1+TVQoRHFoAB5zMabtkGL6Jh6h97gCcC gmjl0LU84CFuM620BagphiELDR0Twy/Bo04EdbYivdLObqlJn6SKyuf0zs8MB90G/j8y MdcQ== 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=sIjvi2ONOFeBeVuRiGtsd7aQNLczbj8OwDdnK8wAXKw=; b=4YYqWQJdrzHNum0LCGrjyNUrGV/dvqq+/i0U5BbjxBgW05gevJy/t9Ws+0AfFuSEqu PsQwTX11tDWZENMn4IDKrw/xxOgVAyidecNOT/6Q/CaVFENQimziOEr/AOR0MMZxEnqP eLY6IRvT2SfgPafgxDlzRaQxdYBMzbdMc9/uqhVXY6w1SucE+NYxJpiYuEKKKX9rdjKi dQS6D2jpwEJcL0imgFjgOMC/YwsOU7eNPvPPD4P0UBSX24lAkAFBtQH3QMI1JAcEJHxm 2njmpsDoZAV1is8DmM6GIPeOWjoJQgT4FNNlKbZLLaQi1rio9BpUPKHyQdGN+CDfeHu6 18XA== X-Gm-Message-State: AOAM532efQ28DiZlfTxuFGFLN8+r95/rSxypjU2ZyjeCIlnmTUYlqPU/ 6mFqjVuEry0Bogke3T0T1ljpLYoq7rY= X-Received: by 2002:a17:90b:1c88:b0:1b8:a77e:c9cb with SMTP id oo8-20020a17090b1c8800b001b8a77ec9cbmr8048314pjb.205.1651781153629; Thu, 05 May 2022 13:05:53 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::4:29a5]) by smtp.gmail.com with ESMTPSA id bh4-20020a170902a98400b0015e8d4eb1c9sm46022plb.19.2022.05.05.13.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 May 2022 13:05:52 -0700 (PDT) Sender: Tejun Heo Date: Thu, 5 May 2022 10:05:51 -1000 From: Tejun Heo To: Imran Khan Cc: viro@zeniv.linux.org.uk, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/5] kernfs: Replace global kernfs_open_file_mutex with hashed mutexes. Message-ID: References: <20220428055431.3826852-1-imran.f.khan@oracle.com> <20220428055431.3826852-6-imran.f.khan@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220428055431.3826852-6-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:31PM +1000, Imran Khan wrote: > +static void __init kernfs_mutex_init(void) > +{ > + int count; > + > + for (count = 0; count < NR_KERNFS_LOCKS; count++) > + mutex_init(&kernfs_locks->open_file_mutex[count]); > +} Does this need to be a separate function? > +static void __init kernfs_lock_init(void) > +{ > + kernfs_locks = kmalloc(sizeof(struct kernfs_global_locks), GFP_KERNEL); > + WARN_ON(!kernfs_locks); > + > + kernfs_mutex_init(); > +} > + > void __init kernfs_init(void) > { > kernfs_node_cache = kmem_cache_create("kernfs_node_cache", Other than that minor nitpick, Acked-by: Tejun Heo Thanks. -- tejun