From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-184.mta0.migadu.com (out-184.mta0.migadu.com [91.218.175.184]) (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 EE51C23AB9D for ; Thu, 23 Apr 2026 07:30:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776929447; cv=none; b=c3yMG8S6AZN+hnlSIxlJO3IN1rqxNVfpJl/JNCiIZRzOkkvkIcsH/ZVfUXcIVhEjbR9qVONbp3qbYWMBWpDk0DYhCFMMBFPIaTeEm2R3R+NVbuRhO29h30UBaYtINbGNb80V/8CxzdAc9A8eB4ph/BNyXmdpkYuPVyOQAXKORKY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776929447; c=relaxed/simple; bh=mHUCjp+kqZqnB0EF4wWrvCj8r4U4/lMRoEt8ZFbCfsk=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=PwjztwHh24ZPuSXi41SkF9ZRgGqZI2a+49hRGnTbYBNI5+3hdjsj8Yhg4DMAjqLOqNZA1pqjQ0lexSNL3+dfFjOMzVoXxcthEsyMa1lQR4NRorZwu0pxFIcNQt7mWSFOf4PNy0MI5QHxsPx8Mj4PjQQpZB79vsAjiooAWKmc7Dw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=hPg/SWHK; arc=none smtp.client-ip=91.218.175.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="hPg/SWHK" Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1776929443; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wET/aI6Q00l0e18Giksd9CUm5IhxyaBpPGMad0SFwbc=; b=hPg/SWHKS2eloFAzMwNn5M6Cd9YHrAvXkq9+C9B1DmQsDfsFcj/KpFe+L64LGORdPi/g3F 0R/HpVwn+mK6vy8YoOffqhcCWS7UnljX5UWP9CzwJ50mlFO8dKfnrsmkqpeBdCpH8/MKAL PHF18bsQ+qTdRcjylqmq6MkwEE6bv6M= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.500.181\)) Subject: Re: [PATCH v5 05/12] smp: Alloc percpu csd data in smpcfd_prepare_cpu() only once X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20260422064022.3791652-6-zhouchuyi@bytedance.com> Date: Thu, 23 Apr 2026 15:29:55 +0800 Cc: tglx@linutronix.de, mingo@redhat.com, luto@kernel.org, peterz@infradead.org, paulmck@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, pbonzini@redhat.com, bigeasy@linutronix.de, clrkwllms@kernel.org, rostedt@goodmis.org, nadav.amit@gmail.com, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: <5E373C0D-EB29-4F57-9DB7-AD3BBD0CE0F0@linux.dev> References: <20260422064022.3791652-1-zhouchuyi@bytedance.com> <20260422064022.3791652-6-zhouchuyi@bytedance.com> To: Chuyi Zhou X-Migadu-Flow: FLOW_OUT > On Apr 22, 2026, at 14:40, Chuyi Zhou wrote: > > Later patch would enable preemption during csd_lock_wait() in > smp_call_function_many_cond(), which may cause access cfd->csd data that > has already been freed in smpcfd_dead_cpu(). > > One way to fix the above issue is to use the RCU mechanism to protect the > csd data and wait for all read critical sections to exit before freeing > the memory in smpcfd_dead_cpu(), but this could delay CPU shutdown. This > patch chooses a simpler approach: allocate the percpu csd on the UP side > only once and skip freeing the csd memory in smpcfd_dead_cpu(). > > Suggested-by: Sebastian Andrzej Siewior > Signed-off-by: Chuyi Zhou Acked-by: Muchun Song Thanks.