From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) (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 2C85921D599 for ; Tue, 17 Mar 2026 02:25:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.97.179.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773714325; cv=none; b=D4EQ4dkvvfK/gq4bBGacEKBBaZNTUVqk2YWYcLZg9hWQkdwdvSLmj+CG6dikwXjUtHijP4stCz0vHP+DiJOvppOmAs0bdmSjk/M+dXbEwmM+ASc+fSdlLKbTs4R+ivXUrrRZKrYuNhb30+NzSEYbsStqeDZEzU4FmY0hkdr3eI0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773714325; c=relaxed/simple; bh=9ljgh+Solv83ILIOz6NUGSI5ktB0wcW/bQIxo40Nk4U=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=f6XV4AagbhdONwBHoS6cFXAPcQVjoZ8yQvZi7WWXVbua2FyIQuJldpyaj276IKspeBdyzHhGDnsXw68VdgR5TwegyOiZvtlLMTbTWeGQQRjfWVRAn0dJ3ReW4rw7KpxwLbesQ3GxGozPaY8P4Fxjb3SGKI5T4Ol2jPOLeM5K7dE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com; spf=pass smtp.mailfrom=igalia.com; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b=Qn/1cGcd; arc=none smtp.client-ip=213.97.179.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=igalia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="Qn/1cGcd" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=L8q6eX9HOH7XnH6A5gPEtaLU7BeNkXkAzyGQT3yEt+s=; b=Qn/1cGcd08dwek2+1OCiA4k5Db Gpf9cz+H6yjlHfLlX5EQRDdhB5sjckIUJfDrapHQNdR5oAKMU1m+1epFPOkf50b59EtHlq7R+nGoi EoT7OEFRuOs+l0zmkjzWZgPtkcfBiMNjOzxoGngz7RtF97wGT5F/K5pMl1ljBiSKfU7ecdm0vsA7I Kcu+tpq5DqmEF1dnB4Ao12VYXyeotNysaK2sW3sANIHOqZVcsSRh0gqMociyrvgEgGZbhKfw44Dsa mQlGY4qeGAvxnAANfAx0WPNTX0MFLaIgIboQCnVSqVP4ris3omET+c0iNFAnQ97Y5TsjGsgd3Uuno 32GQ1IGg==; Received: from [187.57.51.179] (helo=[192.168.15.100]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1w2K6i-00GtYO-1O; Tue, 17 Mar 2026 03:24:32 +0100 Message-ID: <1c1016c4-83d2-4ddb-9f8d-129ee2022795@igalia.com> Date: Mon, 16 Mar 2026 23:24:25 -0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [patch 1/8] futex: Move futex task related data into a struct To: Thomas Gleixner Cc: Mathieu Desnoyers , Sebastian Andrzej Siewior , Carlos O'Donell , Peter Zijlstra , Florian Weimer , Rich Felker , Torvald Riegel , Darren Hart , Ingo Molnar , Davidlohr Bueso , Arnd Bergmann , "Liam R . Howlett" , LKML References: <20260316162316.356674433@kernel.org> <20260316164951.004423818@kernel.org> Content-Language: en-US From: =?UTF-8?Q?Andr=C3=A9_Almeida?= In-Reply-To: <20260316164951.004423818@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Em 16/03/2026 14:12, Thomas Gleixner escreveu: > Having all these members in task_struct along with the required #ifdeffery > is annoying, does not allow efficient initializing of the data with > memset() and makes extending it tedious. > > Move it into a data structure and fix up all usage sites. > > Signed-off-by: Thomas Gleixner [...] > + > +#ifdef CONFIG_FUTEX > +#include > +#include > + > +struct compat_robust_list_head; > +struct futex_pi_state; > +struct robust_list_head; > + > +/** > + * struct futex_ctrl - Futex related per task data maybe futex_task_data to match futex_mm_data? > + * @robust_list: User space registered robust list pointer > + * @compat_robust_list: User space registered robust list pointer for compat tasks to avoid kernel-doc warnings: @pi_state_list: List of PI mutexes holded by this task @pi_state_cache: Copy of the PI state > + * @exit_mutex: Mutex for serializing exit > + * @state: Futex handling state to handle exit races correctly > + */ > +struct futex_ctrl { > + struct robust_list_head __user *robust_list; > +#ifdef CONFIG_COMPAT > + struct compat_robust_list_head __user *compat_robust_list; > +#endif > + struct list_head pi_state_list; > + struct futex_pi_state *pi_state_cache; > + struct mutex exit_mutex; > + unsigned int state; > +};