From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 528A6346FC0 for ; Fri, 26 Jun 2026 15:36:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782488196; cv=none; b=suCA54kvlkwP2PZIElSVK+oZbJW0f4aLOqA7n8KELOdvLjYKxmC9bK7xX3atsGXQAqkURCxdGY1KJafJqrxOfbtb/nAUjpIpevRWbhNvEXPw909Sy16navqpKRhecs3We76qn2kJ/dT9zdAuRAx9kaN+vtRRLicsLUeQapC01q4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782488196; c=relaxed/simple; bh=XpErQYep/sEYaSMh6bYN8xvmBlCShL1TZsxRcX0CzMo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=ce9y1hNLdr90P71kkTtt6DCkcaBPMV/HsWgVb7kGV6uUxuQ4CCo+RhzPip+rHpqZekSgh6avYRsaDbDgR1THbsHe8oUN5OrVNuiy90ndDOS0qzYwS2KmpzEDv62CgWMdEPTk8r07dtCSztvsJeyMv+UY9DX35aAbFy/qzRE4Mkw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=e16YmHLA; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="e16YmHLA" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-46cbe01d4b6so622373f8f.2 for ; Fri, 26 Jun 2026 08:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782488194; x=1783092994; darn=vger.kernel.org; h=mime-version:content-transfer-encoding:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x3wju1nuJQQNOozjS4LCACsNlNv1GsNdXvUWGNBenTE=; b=e16YmHLAWAnFZBnbC8jGevCEtqszVQqblCDqjau8MfOz7Ys6XiStx0Fuf89XIh+6hs HZVNj54D8E5bld4haWxdNW9RmiNLwmsX+JvwWITHzUlpXXFu0E/NiNQp8sn++Z8sj+ot L7O3rDV8Jb8En7MrC6CMrm8zZcB1NXEfABS59AwlNa0ko5ApJYxs+LXlvA1xocBFqNlU FtBwiY+reNBBDCLpxAOtyqK4bkbIAHNRdzRfyIFtvbcGNenoXUe79zE5kyBcI1UmlLiY b6QlcD8gdO8WCqdNnYE6g2QhMM+Tiy5FQS0PsrdpsG4vUuUaerW7m7Xj/JaFrvVl40Mg DBNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782488194; x=1783092994; h=mime-version:content-transfer-encoding:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=x3wju1nuJQQNOozjS4LCACsNlNv1GsNdXvUWGNBenTE=; b=rC24h0n4sCKR22EGhnGZistEaVVo0jEECDoV6cdJoDWXVRSJhiILbtSapcSSW+ft8A CDcE9XGwaZiIuDsasDu4VBMPxjNqM8S13nRa4pXy8FoBaoGdlhWud5kwzbVxMMUL294J I0Ek9ZXKO/HWYSyMF8hNBYXK8DwhGKATp+nfYErB+9Op/KZD5rVXifTGFl+ZrsIoBfR/ cgBCIiUImuqlQJK3B7deqpVLSXFcZdvyet4AOfA8uw28Mc7+k9K6vu9jm9JYXwMGanBn qPqvnWxt1ETVyjlr0kxZ4P0ScPXk/l0RJ3KJYJudSUgHuBWtPNORW4kwsxvYt2oZJYjP 8HIQ== X-Forwarded-Encrypted: i=1; AHgh+Rq3bpGixTHq7pNQZGR9kn+gyb7E58Y+5RUrmmYc4zWHrCW0gtFghewVu+Fma+HPi48fUMiYcEnP6dJfpw4=@vger.kernel.org X-Gm-Message-State: AOJu0Yx/EW4pEjlEoUwFyamA6JiIwSKReswoVzBtzoNelaIEtHy4d0DF qCdXAhJHfFUAjJac2L4Q4XzN5DGS8xlnsU+Lv9vVerR9/Xq13qF4/VU= X-Gm-Gg: AfdE7cnFhLANNpeS/15jor2TcLsHg0opjybg1eWgx9hdakQIndpFDbejSpxlhrp+zVq Ghzdsa7s5ao1E67pG9YLDssuGdCRxFAtHmpZB2UXdSeEV9I+UH42Lmn+V5g3+zboE8YNwemZjKM vS6M5VWDwVP0wCxBC0CobX94sT3G9fmmy9pE6b347r1NDOn1EzjTCGZQ/fqkP90onx+ZiwB2i84 Jx3PFfBSR+v1R0PZvNUNTbSv5pKaT50SAT4Ktrc1KgblWZQf2eascuJhvDR3JkWFDuMwD+ElOip IkQUCUjnGZb0dKjdyjrIYS9UA41qfrws4tEwqcU2wCU2ben/k+qxn394FDceBnhnV944a2pwL/x SblBcmiH4ZQeLXs40eeH+wxCrtUM/IEAfnJNpV9xmsfbz3xp6bU2648oCuwnah+pd0JVGT3VgAk mvrmiffMFr8n2e0IJ7RVqi1gikPds= X-Received: by 2002:a05:6000:41c9:b0:461:fefc:251 with SMTP id ffacd0b85a97d-46dc263b112mr12847506f8f.29.1782488193544; Fri, 26 Jun 2026 08:36:33 -0700 (PDT) Received: from kali (88-170-213-78.subs.proxad.net. [88.170.213.78]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-46c1b754471sm24974281f8f.0.2026.06.26.08.36.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 08:36:32 -0700 (PDT) From: Tristan Madani To: Andrew Morton Cc: Tetsuo Handa , Ingo Molnar , Dave Hansen , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Tristan Madani Subject: Re: [PATCH v2] profiling: don't free prof_cpu_mask on init failure Date: Fri, 26 Jun 2026 15:36:31 -0000 Message-ID: <178248819183.3242446.8706480116416421586@gmail.com> In-Reply-To: <20260624181113.8b2aacf9b1466205c8f2cf05@linux-foundation.org> References: <20260621192324.2062795-1-tristmd@gmail.com> <20260622000022.3375262-1-tristmd@gmail.com> <20260624181113.8b2aacf9b1466205c8f2cf05@linux-foundation.org> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 24 Jun 2026 18:11:13 -0700 Andrew Morton wrote: > Confused. Current mainline has no free_cpumask_var() here? Correct -- Tetsuo's 7c51f7bbf057 ("profiling: remove prof_cpu_mask") removed the variable and all its references in v6.11. This patch is for 6.1.y and 6.6.y where the old error-path free is still present. > If we're to deliberately leak the mask here then let's have a little > comment explaining the reasoning, so we don't later receive "profiling: > fix memory leak" patches. Good point. I can send v3 with: - a comment above the return explaining the deliberate leak - corrected Fixes tag (c309b917cab5, per Tetsuo's review) - stable-only framing in the commit message Alternatively, Cc stable on 7c51f7bbf057 would also fix this, though that commit removes prof_cpu_mask entirely, adds mutex serialization in ksysfs.c, and drops the hotplug online callback (2 files, +13/-40). Happy to go either way. Tristan