Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp877617lqb; Wed, 29 May 2024 13:20:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXCWT/LZRfK2jMO6n1KWm9b1rRZ2+tDR58pBpeILgA1ekW4Ht87vL0BAEL9d3p50KbJ4s+5xswDUS8nYhpv7BxuQ7Ggjc5WvPNLf2yyoQ== X-Google-Smtp-Source: AGHT+IGC/NO3IWRbjsncxQqnTnALgu4lEIRF8cNHEeFPvR9RbvJCkDmQntY0TWy2g9Dawg7Rv2nT X-Received: by 2002:a05:6214:d65:b0:6ad:657d:9d47 with SMTP id 6a1803df08f44-6ad9f95e865mr59866766d6.14.1717014041297; Wed, 29 May 2024 13:20:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717014041; cv=pass; d=google.com; s=arc-20160816; b=D6We/0/wL5GZFEF90UaCiCp2En11aMrC7ljDLuOQOh0/A4H0ayHnELhMPlRywU2RZq A755GfU8BJ6671Nc273a21VHzQJ31eGcXZj2qI2AUUS/Z8nePeHft59P+ZOmx+6ve5B+ nzqW4+IojOmfrNkBwPQpj1KTx4UnA+soGAf6PVsVFl/FqVwMVj4mlokh5GdQDfmzkDTt dv2knVnwjQQ7c7bO7XeoYT+8K+4Af+B4O8c6lUGcolFRF7arNyVKs6HwRwravh9gAijc MIpSUUXotIcaK4ScS8/QGEieDx1li8G7Zg6yPDOHjQLCMFX8jDQ7Dn/e0+COfEes0XLO +FMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=afZfmhbfqcr58ktMmmggutk+6DkmOyf1Tyjk+u60Muc=; fh=/NRChfApgyB8Mlk4Jy2QHDFe/LInU+wLCp+fFhX5/7E=; b=p86wabR7dtQ2S4UjyldzsQyBC1MZL8Fszy+XOwfWm8XFDK0wyTrrOX4nIL8URzYXMn rL0NapNSImJazqBMh0SzBdoMM0v+hvYoHyztPTDjhaSW7NZokY45ti8X5o4d2oeDgUXX Ri1wraQEw65CQlM8W1yUMqEQnackPJiK63uVF52+Y1eMRv8gmbTq6jpzo5kMAQqM6RhJ Th54YEGxc64cWLYWOYqTTHzTm+CdCg8iRT0F7RVcu7aR1h1gj+8/2Ju4LBWMzXLjB4y+ SGxVPXtgzYXjwjIFKE1A5B7A5tvHIc/qPyX8AgoW7+05WfGmfOMk3TS5wxESdY73ATqr It3A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D2+SaGAz; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-194650-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ad79d127adsi95084946d6.354.2024.05.29.13.20.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 13:20:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194650-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D2+SaGAz; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-194650-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0CE351C212DE for ; Wed, 29 May 2024 20:20:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 470F41C68A6; Wed, 29 May 2024 20:20:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="D2+SaGAz" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1048714534D for ; Wed, 29 May 2024 20:20:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717014034; cv=none; b=dWZx6r9zovFPJKHDuC6N9X9suzjyuISjjzkOPnsAYdVOzkF/RQWj+GXx9ZFVgAhjUh7Lmj5QMNN0RC/g2c422K62X1resSZb435nCxCMMVQpT2CxUChqeliyl9eqyvuVNgZN9CZIoMeH7cPSC9mY7+tf+tt2qyGgIubSgkk+H3w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717014034; c=relaxed/simple; bh=/Y28hbBOtK57TCN8FXJojnbsAgLCRqTn2Drt1yM5zRk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=h5iWu9gSl1g3b6Z2JSxYxw6rUoeIXm55eAj+ngIIZwscOx+IbBqGqnpXA1z7xCLtG/ZusyrU356awlKRFBVBmb2rnaK78rupi3WYKYYjcJxkdDzXuiTuen9boAnmnooH4kdWsISNOHzCX169objWFYmkKFxF+3T/nNUadEy9MrM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=D2+SaGAz; arc=none smtp.client-ip=192.198.163.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717014033; x=1748550033; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=/Y28hbBOtK57TCN8FXJojnbsAgLCRqTn2Drt1yM5zRk=; b=D2+SaGAz2mOidEqCJQUguG9ePhtcKSBqRxNY2DCKr1nAAz7vm5R4A0ja GgC7K+/clBgK44pRAFudh+VcSjk3fJNxWg/8nsqT6KVPzapi5pN99HMyl Q72CVLb5+9DtYVKMTxmNSmtI339JnU3I+cqZkrlSREFh12A75CtYeWs1r cpqempUxkdh8DyDyXz+4FNVvoknqpeJ2RGsuFxbJqcTrlJgTAi8ow/Xr6 UVxzfmDnvE0ugHyq333ezxXbcD6ZSC5FtRIEHdxe75DRPK3Hbyn8G+cuQ qGIE6huLq8QfMTK/29AZb26fUcgpMqmDtkQDqemdHXRXpdvdgnN1z1sFr A==; X-CSE-ConnectionGUID: CKls1mXVSjeTfAAQvOqdqQ== X-CSE-MsgGUID: SfMmIQxvTS+CQXp1PlC5qQ== X-IronPort-AV: E=McAfee;i="6600,9927,11087"; a="13264775" X-IronPort-AV: E=Sophos;i="6.08,199,1712646000"; d="scan'208";a="13264775" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2024 13:20:32 -0700 X-CSE-ConnectionGUID: Iy6SnbodRKy2moBrJcINAw== X-CSE-MsgGUID: IgGj007RROOYQ0mR+V+6RQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,199,1712646000"; d="scan'208";a="36104289" Received: from agluck-desk3.sc.intel.com ([172.25.222.70]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2024 13:20:32 -0700 Date: Wed, 29 May 2024 13:20:30 -0700 From: Tony Luck To: Reinette Chatre Cc: Fenghua Yu , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin , x86@kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: Re: [PATCH v19 00/20] Add support for Sub-NUMA cluster (SNC) systems Message-ID: References: <20240528222006.58283-1-tony.luck@intel.com> <08ca8fe7-9da6-41da-aad2-0081b789326c@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <08ca8fe7-9da6-41da-aad2-0081b789326c@intel.com> On Tue, May 28, 2024 at 03:55:29PM -0700, Reinette Chatre wrote: > Hi Tony, > > 13: Wordsmith commit into imperative. > > I looked at using kobject_has_children() to check for empty > > directory, but it needs a "struct kobject *" and all I have > > is "struct kernfs_node *". I'm now checking how many CPUs > > Consider how kobject_has_children() uses that struct kobject *. > Specifically: > return kobj->sd && kobj->sd->dir.subdirs > > It operates on kobj->sd, which is exactly what you have: struct kernfs_node. So right. My turn to grumble about other peoples choice of names. If that field was named "kn" instead of "sd" I would have spotted this too. > > remain in ci->shared_cpu_map to detect whether this is the > > last SNC node. > > hmmm, ok, will take a look ... but please finalize discussion of a patch series > before submitting a new series that rejects feedback without discussion and > does something completely different in new version. Reinette, So here's what rmdir_mondata_subdir_allrdtgrp() looks like using the subdirs check. It might need an update/better header comment. -Tony --- /* * Remove all subdirectories of mon_data of ctrl_mon groups * and monitor groups with given domain id. */ static void rmdir_mondata_subdir_allrdtgrp(struct rdt_resource *r, struct rdt_mon_domain *d) { struct rdtgroup *prgrp, *crgrp; struct kernfs_node *kn; char subname[32]; char name[32]; sprintf(name, "mon_%s_%02d", r->name, d->ci->id); if (r->mon_scope != RESCTRL_L3_CACHE) { /* * SNC mode: Unless the last domain is being removed must * just remove the SNC subdomain. */ sprintf(subname, "mon_sub_%s_%02d", r->name, d->hdr.id); } list_for_each_entry(prgrp, &rdt_all_groups, rdtgroup_list) { kn = kernfs_find_and_get(prgrp->mon.mon_data_kn, name); if (!kn) continue; if (kn->dir.subdirs <= 1) kernfs_remove(kn); else kernfs_remove_by_name(kn, subname); list_for_each_entry(crgrp, &prgrp->mon.crdtgrp_list, mon.crdtgrp_list) { kn = kernfs_find_and_get(crgrp->mon.mon_data_kn, name); if (!kn) continue; if (kn->dir.subdirs <= 1) kernfs_remove(kn); else kernfs_remove_by_name(kn, subname); } } }