From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1FEAC369A2 for ; Fri, 11 Apr 2025 22:24:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6B0F1680031; Fri, 11 Apr 2025 18:24:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 65D6E680024; Fri, 11 Apr 2025 18:24:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 489B1680031; Fri, 11 Apr 2025 18:24:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 25A49680024 for ; Fri, 11 Apr 2025 18:24:46 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 6793D8090F for ; Fri, 11 Apr 2025 22:24:47 +0000 (UTC) X-FDA: 83323193814.22.8E12651 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by imf20.hostedemail.com (Postfix) with ESMTP id 5DBB81C0007 for ; Fri, 11 Apr 2025 22:24:43 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=DJ+2f7tq; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf20.hostedemail.com: domain of dan.j.williams@intel.com designates 192.198.163.18 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1744410284; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2dxo8nxj1vN6RzppbEUnec8fk6xsx8VYQyqkf4wciAw=; b=JOyLC3O5SuedNKyJ6cf8cLT1O7XnBXSyk/myqY/bpNmFYad3cRMCE4YzDKLj++UfqTCH2S wop4XGWuPE8AL9OrrumvqJ0qrqnxq8UwnsuI3Kc5S6MB1D9F/3bRmspdC/vH/+hKuEciZp xpKe9wkp0EKCKpQnFNuMYuitWqufn7I= ARC-Authentication-Results: i=2; imf20.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=DJ+2f7tq; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf20.hostedemail.com: domain of dan.j.williams@intel.com designates 192.198.163.18 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1744410284; a=rsa-sha256; cv=fail; b=W/d7RrxNeAG4Nfw3M7qerPcUSXWc6eM/0vEIQBMz+st9hrcaE1NZuvcKmF67YZOEOKHAi2 r2M7Lc36ZQSX0oADWjLHWlRmSw6JDrigUe8h0bkgEcHSbsnLX1DI9rHvoEMiXwhR+7bqlp TYt339bNWYoquxvBwTwX8ZrkJqruojA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744410283; x=1775946283; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=p+Eaile4YymwXI/DfiLGTZa0+SxiUa+sCpANiLrYXlk=; b=DJ+2f7tqDrXG7aIghv28DOeKaZRmshWNpEcKuCbY53C7p6EzKk8EmCOY 38okoTZoHki4VWNSefC7/l5Sq5XOc3uP3TBONVsc8GqdamE/S2fl6aenl pjuTJldJs34vTFf7KiN+FuXMuaZRu5DxHAGfEuGDwrOsOmuUkHKA8lSLF qvyEW3IHo3bLLLIY9wE0x/WgYykuwP/c/TOz6PYqTuCcXyltzBOoVHEtL wXF1Mf1NB+ZxCsL2qXTEDXaQc+2TnHgD51e2CO+GA6KD0Lazkq0ClgZr6 X8OrjCL0QniCY+9DwO+DJ+GGihMB5uUJrXs5iohuc1wf3VShblKhmGFDv g==; X-CSE-ConnectionGUID: 9a98+ZKYQXuGqDeGbV0ZXg== X-CSE-MsgGUID: qJVZypgsTcKRXgiD5dQODA== X-IronPort-AV: E=McAfee;i="6700,10204,11401"; a="45211469" X-IronPort-AV: E=Sophos;i="6.15,206,1739865600"; d="scan'208";a="45211469" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2025 15:24:41 -0700 X-CSE-ConnectionGUID: RuM1eQhyQsKThue2F0PeHg== X-CSE-MsgGUID: mHZvFWEfTEyblK3DbYtvlA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,206,1739865600"; d="scan'208";a="134060209" Received: from orsmsx901.amr.corp.intel.com ([10.22.229.23]) by fmviesa005.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2025 15:24:41 -0700 Received: from ORSMSX901.amr.corp.intel.com (10.22.229.23) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Fri, 11 Apr 2025 15:24:40 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14 via Frontend Transport; Fri, 11 Apr 2025 15:24:40 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.49) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.44; Fri, 11 Apr 2025 15:24:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=j/GpHG+yEY11jbhTWz9emk7j4WeeGUgdA6cnlkufwb5o8sqVFDLmGKTskn8sti5avj+5u+JtCjj278qJD2jpc44dYHqhqOlAGbjulMsKbY8PlSABcCaSV8g1Sz2/vIEpBEAu/qEHWVhqwgrKKJnwB+F8JPWHGp5nuvm4D8VMyWp4q42m32PGxEUBt8N9Kj9jvHdjHsku6rtrC7j3Ne30ANeuBjm6TGgdmInHChod0JRm8Zm7+XjKo3yvDTQcjVUBkbEPLgAuWlPP9N2ec9kWhUFV+sfeOtC57OeHx8iJdA39jARJtq50z90AnQi3COSxvEPDUeU9DybCJ6fmMTImVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2dxo8nxj1vN6RzppbEUnec8fk6xsx8VYQyqkf4wciAw=; b=UNnVaF48lF+CfCV4wpM4kNlG69r+oZL2fok03VfDzA6Ip6xIGn5hkdMGv5pf7/Cvfoz3t4EdfdvvtTxTqtfTR3CbdWhs9eF/Z1SfZoZ5wWPI8R4HDGAAXeHMnpDCNK5ZaVQH4xxzRbCnqHyXTMqPDrPlx8uJcetQs/e7XchlnH10wehd2SkaTWmrQ5dac93G56LvEZiuloEqr6VpIAXvyI1iN/3BPIdkXclOKWxmoD2wIbXR36JDjw7awU9SfnYMYZ16BkLM0wPGG+bNpydh/PcdKLygSLQnGzz1PcIk/JKBdYH6GUk2w+KPPDCR10H593Pcom4mTfKHTZtRBXmUrw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from PH8PR11MB8107.namprd11.prod.outlook.com (2603:10b6:510:256::6) by CH3PR11MB7676.namprd11.prod.outlook.com (2603:10b6:610:127::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8632.27; Fri, 11 Apr 2025 22:24:05 +0000 Received: from PH8PR11MB8107.namprd11.prod.outlook.com ([fe80::6b05:74cf:a304:ecd8]) by PH8PR11MB8107.namprd11.prod.outlook.com ([fe80::6b05:74cf:a304:ecd8%3]) with mapi id 15.20.8606.033; Fri, 11 Apr 2025 22:24:05 +0000 Date: Fri, 11 Apr 2025 15:24:01 -0700 From: Dan Williams To: Rakie Kim , Dan Williams CC: , , , , , , , , , , , , , Subject: Re: [PATCH v7 2/3] mm/mempolicy: Prepare weighted interleave sysfs for memory hotplug Message-ID: <67f99681d3e60_720529435@dwillia2-xfh.jf.intel.com.notmuch> References: <20250411072135.588-1-rakie.kim@sk.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20250411072135.588-1-rakie.kim@sk.com> X-ClientProxiedBy: MW2PR16CA0060.namprd16.prod.outlook.com (2603:10b6:907:1::37) To PH8PR11MB8107.namprd11.prod.outlook.com (2603:10b6:510:256::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH8PR11MB8107:EE_|CH3PR11MB7676:EE_ X-MS-Office365-Filtering-Correlation-Id: 6095350a-7423-46ba-1a81-08dd794791a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?O5ycxYsLCEaP8c4tDqbXJGL8vcC+qTo4tM6O3Nyq8SfpHwXXoDOlcd4FDnqr?= =?us-ascii?Q?qZ6AXAGh1qG2iMT24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i384M3Y?= =?us-ascii?Q?EkbE/Jt/ID4az2ggTERG8wpzJNI0rfY8STUtIvOK4+O9RLMnExnq57i8VEBV?= =?us-ascii?Q?PMe17UwgUke8MzxwfxfLDNnEnklrb5ocD2ECS0bCnR4Q5sXfVm7fG4XTLwFy?= =?us-ascii?Q?CAkwG+FrXEq0ijkF/pqBHb/S/KMT0auSA/9r+0tbpqWoKG9PUwkLL+gXxKCt?= =?us-ascii?Q?mzKCWALg4iINkfWdP5wOb7qXJuHMjDI2ylhd1vDgsvg//RdhoDNi1FPnHLiu?= =?us-ascii?Q?pJhKKHWs+Cft/L0/oBcHaISKcsG/LRcBiHTQqryIhIPh2i/yGZvVxJzXyb7Q?= =?us-ascii?Q?3xP32XJj0mCyvVD7kWgwRN5RKo8QbxKWFJIq613rPqmaOy7/pcvWknDZft+p?= =?us-ascii?Q?SYzUaJaPM44+BHW7HYWNhiHoudNBbeJwWVSHWuKh+kXWNiCLXUJM3MzWLh9n?= =?us-ascii?Q?NRpd7eg0ai9b/Z+jz2rowqHl8+b1tFmB/sFHAxaCM78q1JbQGreQ2Pu/Q/9i?= =?us-ascii?Q?7Le+WkgVLbw=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR11MB8107.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?0Xc9ZxVsWCl7MjvgexDMBLY2HeBjteRljELDe5ixZYhhkSOQNJwQhcZ2eGWo?= =?us-ascii?Q?qMumQaeMDqEq82ZjDkU81sv4QJyIvokSEey01kTeqLO+GNoUFRx9kSbnan1V?= =?us-ascii?Q?KkNYqDpuP68T1RI5hxT8iC/F/DG06o0ctDxLXAYDoWpb7u1yfI+QNQKHD13A?= =?us-ascii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rGk/XHezMRSA/byH9N?= =?us-ascii?Q?CIzP+HMtYdBzomg6Tch5bMXsyc/fYrJdfuIiw6WqRq4DamZAwdJpyfc8zq3r?= =?us-ascii?Q?LuwnT7d29nq//s376l0thQrNqJov/GygEHKrfLRbiqp+o/HtSqYRJ91dBcQi?= =?us-ascii?Q?WJdKkEvnmUV16GVd5zbpOR59P82430hWWWsypQjKvOazZ//x95X3ndd8007s?= =?us-ascii?Q?YcVdRVLVQWlaj6fconVwphfXpt3NQYBOiJWR0Jg4Q7+vMB2oetI/lsVXWbBB?= =?us-ascii?Q?tbg584a/oIYsoF4wjThXqVpMMR7Gl1lmBqI+RWvof66SifUAUQAOmuwvi6wk?= =?us-ascii?Q?fS0ZtJ3L2Zm+l3VFl17ERz+T/bKlknzECFwgrkg5fmWEmM9D1GlXBALZrlRw?= =?us-ascii?Q?u/VUFsQw22ac9o6MSM8fIJC8t+dCRQrryJgudw6Qq4RQ3oRrIhE21GJhyg0t?= =?us-ascii?Q?JmksTSkb5hpJoAm6GVEu58l2Tbz5XUGaSvwfan/dXLhd1Kq9zafq/p43wL83?= =?us-ascii?Q?73IWR/nM0yiPr/tOUTE03mr5PMp5LVtPK7TN0GwLwBokP9OcdldIzusgqS8V?= =?us-ascii?Q?7A=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 6095350a-7423-46ba-1a81-08dd794791a0 X-MS-Exchange-CrossTenant-AuthSource: PH8PR11MB8107.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2025 22:24:05.1602 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4qid4gQER28czJwnqGeelgB0DTFnJtbXJKZVgot5r2DqlH4aaZ+eX61VMiNA+x7ssjnlyK8FiNU4vzdioGEjtZy7MV4WxLKaGuPM3PE7VqU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB7676 X-OriginatorOrg: intel.com X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 5DBB81C0007 X-Stat-Signature: zmq4f94g53pj7sqg46yifhr4xnk5o7gq X-Rspam-User: X-HE-Tag: 1744410283-355653 X-HE-Meta: U2FsdGVkX190Quk1ByW3RwElds1wipRQtmmzGqwAyiCYQwcruJbQVaYdzGlDWEUlv4QIDY+qzWEoIKUviJHVS8E9qy2M9aV6LwBqciGj5k+98LALQksGFvVSRWy3wY5Lzfme1CSvaQGQWxfEdMl/XbRO/5G1GcHALK3sOm6sg3X70dxfSTH0evjlmcwhG5VvSbDT2vRWJlrG0pAmHgzrPyyK+O3CQqpSgfiTl23r8N+c7PvNPBAXF36/yMrNpjbsEIj9co+CH5ZTE+PKQ6jv2DMKAhR0Sm9t9v3aR7X9Zf+GnVfKog8Ael0jtiN01jjCOb4QmC+55ZV/lJH2eVRBW6z2I20PTfBNDtHnBQeeE02ylNvTvbc2zxeTNx0W7LGexsPSInhzFe0tApXx+97NEggpBmVCZiwJPJnMhYUqTxtBxJu3ZYxrwU8rofFPKivo/CHnlxVWK8o6CgVVZa2rt3Y70TzVzJCypQ2qchnE1tEFaerSolNBxZKmthR6e4nZn7AFmFq4a8Vr+VPTXxhuTGKI2N73pXIjkCxfu1Eg1niYPW1gq00dq1JGzZTgHGbuMS2PJg7wkSQkEZGMe42nMnQLtFgfklGuKxv9rvm30+isqZl5fzERrnE5qVsjO15xj6k4LrfMVUkxOJgV+W6DzGqr5f/UfeE+vzlzSSMnGfhjAXYKfvvc7eXffJmi/AAJIl1ryUi9mspxvj/T3btAfLLQVeatc5ITxUmb+54Hx9gS8y2fVAESd6uZNyBcqAqWoo464/CUw58reLVpIhk5P+U5D9hYi2klp/VewYE2kBHLCqR9jO69ixAbh28hmlGtUe44K8q+qm39EH4FfK9/4h2S2kGX/9kcmRCQonBzEcUHhV5Xji2SaxBnI/qC+0tx2RypjuOl3RtNJuywKtVaqpBGf2MwVs9Vrpy4jvTLn9RY3GcBX0Jy4VP+ipG6KePXv1ozxFr5rj8a5e7wD3n 6KkyW0pD VZZvzHt8VGP6cN+YwySU5Jv4lXwYmLNSfxYfuoHQ9QnHwELU8b8lJxj8l51DpLXyPN/eRAdxPhBWQDNdSazhh937cNfq1pOR0nWGuZETnrQGoKOe0UGf6qCwz6NPg5upnDlrG/v9aIfbCdHhDiA8wSsb2rUxOCyvr5bn7A7NGOnLTNnomwyR3GpTMKMWLx/KaH12puS+dX0pYkwPpX1qN9nTbP5OoAMxqlp1c+Jym7GXkYGrFGW61tLVWwK28d53bbFg9NqnoijNbzBmz3kL1yphEuB7nE+MKNN8gwys2ORrVZr2P4L7o8GMLLMG0Lm9X3d4kM0mqAlUDUahO+NVVg2gPDYMYg7LFeOHfiBqOxqQYz7ReL25vEjKaunrjMM4NFu62vgmj2O4UBSDU3gHRnEGJpBum1/TEip7Kxfd7LLe2cjC/iH0v/UFykuwuHTfIfjvScgIMXlNwSHURju/gVhzEj2+TMk+3v6P9Vo1SuUWchrQgRxTkYjTyrv8/EbVgxyp0pQ7tPImCq3ttGK5oKLy/bQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Rakie Kim wrote: > On Tue, 8 Apr 2025 20:54:48 -0700 Dan Williams wrote: > > Dan Williams wrote: > > > > > > > > +struct sysfs_wi_group { > > > > + struct kobject wi_kobj; > > > > + struct iw_node_attr *nattrs[]; > > > > +}; > > > > + > > > > +static struct sysfs_wi_group *wi_group; > > > > + > > > > static ssize_t node_show(struct kobject *kobj, struct kobj_attribute *attr, > > > > char *buf) > > > > { > > > > @@ -3461,27 +3468,24 @@ static ssize_t node_store(struct kobject *kobj, struct kobj_attribute *attr, > > > > return count; > > > > } > > > > > > > > -static struct iw_node_attr **node_attrs; > > > > - > > > > -static void sysfs_wi_node_release(struct iw_node_attr *node_attr, > > > > - struct kobject *parent) > > > > +static void sysfs_wi_node_delete(int nid) > > > > { > > > > - if (!node_attr) > > > > + if (!wi_group->nattrs[nid]) > > > > return; > > > > - sysfs_remove_file(parent, &node_attr->kobj_attr.attr); > > > > - kfree(node_attr->kobj_attr.attr.name); > > > > - kfree(node_attr); > > > > + > > > > + sysfs_remove_file(&wi_group->wi_kobj, > > > > + &wi_group->nattrs[nid]->kobj_attr.attr); > > > > > > This still looks broken to me, but I think this is more a problem that > > > was present in the original code. > > > > > > At this point @wi_group's reference count is zero because > > > sysfs_wi_release() has been called. However, it can only be zero if it has > > > properly transitioned through kobject_del() and final kobject_put(). It > > > follows that kobject_del() arranges for kobj->sd to be NULL. That means > > > that this *should* be hitting the WARN() in kernfs_remove_by_name_ns() > > > for the !parent case. > > > > > > So, either you are not triggering that path, or testing that path, but > > > sys_remove_file() of the child attributes should be happening *before* > > > sysfs_wi_release(). > > > > > > Did I miss something? > > > > I think the missing change is that sysfs_wi_node_add() failures need to > > be done with a sysfs_wi_node_delete() of the added attrs *before* the > > kobject_del() of @wi_group. > > Hi Dan, > > Thank you for pointing out this issue. > > As you suggested, I believe the most appropriate way to handle this is > to incorporate your feedback into Patch 1 > (mm/mempolicy: Fix memory leaks in weighted interleave sysfs). > > To ensure that sysfs_remove_file() is called before kobject_del(), I > have restructured the code as follows: > > > static void sysfs_wi_release(struct kobject *wi_kobj) > { > int nid; > > for (nid = 0; nid < nr_node_ids; nid++) > sysfs_wi_node_delete(node_attrs[nid], wi_kobj); > -> ERROR: sysfs_remove_file called here > kfree(node_attrs); > kfree(wi_kobj); > } > > > static void sysfs_wi_node_delete_all(struct kobject *wi_kobj) > { > int nid; > > for (nid = 0; nid < nr_node_ids; nid++) > sysfs_wi_node_delete(node_attrs[nid], wi_kobj); At this point the nodes were live which means userspace could have triggered an iw_table update. So I would expect that after all node files have been deleted then this function frees the iw_table. > -> sysfs_remove_file called here Call iw_table_free() after the loop, where that is something like below (untested!): diff --git a/mm/mempolicy.c b/mm/mempolicy.c index b28a1e6ae096..88538f23c7d4 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -3430,6 +3430,28 @@ static ssize_t node_show(struct kobject *kobj, struct kobj_attribute *attr, return sysfs_emit(buf, "%d\n", weight); } +static void iw_table_install(static u8 *new, struct iw_node_attr *node_attr, u8 weight) +{ + u8 *old; + + mutex_lock(&iw_table_lock); + old = rcu_dereference_protected(iw_table, + lockdep_is_held(&iw_table_lock)); + if (old && new) + memcpy(new, old, nr_node_ids); + if (new) + new[node_attr->nid] = weight; + rcu_assign_pointer(iw_table, new); + mutex_unlock(&iw_table_lock); + synchronize_rcu(); + kfree(old); +} + +static void iw_table_free(void) +{ + iw_table_install(NULL, NULL, 0); +} + static ssize_t node_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { @@ -3447,17 +3469,8 @@ static ssize_t node_store(struct kobject *kobj, struct kobj_attribute *attr, new = kzalloc(nr_node_ids, GFP_KERNEL); if (!new) return -ENOMEM; + iw_table_install(new, node_attr, weight); - mutex_lock(&iw_table_lock); - old = rcu_dereference_protected(iw_table, - lockdep_is_held(&iw_table_lock)); - if (old) - memcpy(new, old, nr_node_ids); - new[node_attr->nid] = weight; - rcu_assign_pointer(iw_table, new); - mutex_unlock(&iw_table_lock); - synchronize_rcu(); - kfree(old); return count; } @@ -3550,15 +3563,6 @@ static int add_weighted_interleave_group(struct kobject *root_kobj) static void mempolicy_kobj_release(struct kobject *kobj) { - u8 *old; - - mutex_lock(&iw_table_lock); - old = rcu_dereference_protected(iw_table, - lockdep_is_held(&iw_table_lock)); - rcu_assign_pointer(iw_table, NULL); - mutex_unlock(&iw_table_lock); - synchronize_rcu(); - kfree(old); kfree(node_attrs); kfree(kobj); } > } > > static void sysfs_wi_release(struct kobject *wi_kobj) > { > kfree(node_attrs); > kfree(wi_kobj); > } > > In addition, I call sysfs_wi_node_delete_all() before kobject_del() > during error handling: > > +err_cleanup_kobj: > + sysfs_wi_node_delete_all(wi_kobj); > kobject_del(wi_kobj); > > I believe this resolves the issue you raised. Yes, along with the iw_table_free() change because while it is not a leak, it is awkward that mempolicy_kobj_release arranges to keep iw_table allocated long past the time the node attributes have been deleted and shutdown in sysfs. > That said, I have a follow-up question. With this structure, when the > system is shutting down, sysfs_remove_file() will not be called. Based > on my review of other kernel subsystems, it seems that sysfs_remove_file() > is only called during module_exit() in driver code, and not in other > built-in subsystems. Correct. > Is this an acceptable practice? If you happen to know the expected > behavior in such cases, I would appreciate your insights. Yes, there are plenty of examples of sysfs infrastructure that gets set up, but never torn down for the life of the kernel. The goal here is to make the error unwind path correct and make the code clean for potentially deleting mempolicy_kobj infrastructure in the future, but it is otherwise ok if the only patch that calls kobject_del() for an object is the error unwind path. > > Below is the full content of the updated Patch 1. > @@ -3463,8 +3463,8 @@ static ssize_t node_store(struct kobject *kobj, struct kobj_attribute *attr, > > static struct iw_node_attr **node_attrs; > > -static void sysfs_wi_node_release(struct iw_node_attr *node_attr, > - struct kobject *parent) > +static void sysfs_wi_node_delete(struct iw_node_attr *node_attr, > + struct kobject *parent) > { > if (!node_attr) > return; > @@ -3473,13 +3473,16 @@ static void sysfs_wi_node_release(struct iw_node_attr *node_attr, > kfree(node_attr); > } > > -static void sysfs_wi_release(struct kobject *wi_kobj) > +static void sysfs_wi_node_delete_all(struct kobject *wi_kobj) > { > - int i; > + int nid; > > - for (i = 0; i < nr_node_ids; i++) > - sysfs_wi_node_release(node_attrs[i], wi_kobj); > + for (nid = 0; nid < nr_node_ids; nid++) > + sysfs_wi_node_delete(node_attrs[nid], wi_kobj); > +} > > +static void sysfs_wi_release(struct kobject *wi_kobj) > +{ > kfree(node_attrs); > kfree(wi_kobj); > } > @@ -3547,13 +3550,14 @@ static int add_weighted_interleave_group(struct kobject *root_kobj) > err = add_weight_node(nid, wi_kobj); > if (err) { > pr_err("failed to add sysfs [node%d]\n", nid); > - goto err_del_kobj; > + goto err_cleanup_kobj; > } > } > > return 0; > > -err_del_kobj: > +err_cleanup_kobj: > + sysfs_wi_node_delete_all(wi_kobj); > kobject_del(wi_kobj); > err_put_kobj: > kobject_put(wi_kobj); > > Thank you again for your helpful feedback. Hey, thanks for the patience to get this all fixed up properly.