From: kernel test robot <lkp@intel.com>
To: Christian Brauner <brauner@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev,
Christian Brauner <christianvanbrauner@gmail.com>,
Oleg Nesterov <oleg@redhat.com>
Subject: [brauner-vfs:work.pidfs.thread_group 4/8] fs/pidfs.c:213:14: warning: unused variable 'thread'
Date: Thu, 20 Mar 2025 21:54:00 +0800 [thread overview]
Message-ID: <202503202312.SmfIIwCj-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git work.pidfs.thread_group
head: d0a0cf0bc25c919225b65ae639aaeb05747974a3
commit: 65d0a567a7317093032cfd56cae7aa7417b03d17 [4/8] pidfs: improve multi-threaded exec and premature thread-group leader exit polling
config: i386-buildonly-randconfig-001-20250320 (https://download.01.org/0day-ci/archive/20250320/202503202312.SmfIIwCj-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250320/202503202312.SmfIIwCj-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503202312.SmfIIwCj-lkp@intel.com/
All warnings (new ones prefixed by >>):
fs/pidfs.c: In function 'pidfd_poll':
>> fs/pidfs.c:213:14: warning: unused variable 'thread' [-Wunused-variable]
213 | bool thread = file->f_flags & PIDFD_THREAD;
| ^~~~~~
vim +/thread +213 fs/pidfs.c
50f4f2d197e194 Christian Brauner 2024-02-12 206
50f4f2d197e194 Christian Brauner 2024-02-12 207 /*
50f4f2d197e194 Christian Brauner 2024-02-12 208 * Poll support for process exit notification.
50f4f2d197e194 Christian Brauner 2024-02-12 209 */
50f4f2d197e194 Christian Brauner 2024-02-12 210 static __poll_t pidfd_poll(struct file *file, struct poll_table_struct *pts)
50f4f2d197e194 Christian Brauner 2024-02-12 211 {
cb12fd8e0dabb9 Christian Brauner 2024-02-12 212 struct pid *pid = pidfd_pid(file);
50f4f2d197e194 Christian Brauner 2024-02-12 @213 bool thread = file->f_flags & PIDFD_THREAD;
50f4f2d197e194 Christian Brauner 2024-02-12 214 struct task_struct *task;
50f4f2d197e194 Christian Brauner 2024-02-12 215 __poll_t poll_flags = 0;
50f4f2d197e194 Christian Brauner 2024-02-12 216
50f4f2d197e194 Christian Brauner 2024-02-12 217 poll_wait(file, &pid->wait_pidfd, pts);
50f4f2d197e194 Christian Brauner 2024-02-12 218 /*
50f4f2d197e194 Christian Brauner 2024-02-12 219 * Depending on PIDFD_THREAD, inform pollers when the thread
50f4f2d197e194 Christian Brauner 2024-02-12 220 * or the whole thread-group exits.
65d0a567a73170 Christian Brauner 2025-03-19 221 *
65d0a567a73170 Christian Brauner 2025-03-19 222 * There are two corner cases to consider:
65d0a567a73170 Christian Brauner 2025-03-19 223 *
65d0a567a73170 Christian Brauner 2025-03-19 224 * (1) If a thread-group leader of a thread-group with
65d0a567a73170 Christian Brauner 2025-03-19 225 * subthreads exits prematurely, i.e., before all of the
65d0a567a73170 Christian Brauner 2025-03-19 226 * subthreads of the thread-group have exited then no
65d0a567a73170 Christian Brauner 2025-03-19 227 * notification will be generated for PIDFD_THREAD pidfds
65d0a567a73170 Christian Brauner 2025-03-19 228 * referring to the thread-group leader.
65d0a567a73170 Christian Brauner 2025-03-19 229 *
65d0a567a73170 Christian Brauner 2025-03-19 230 * The exit notification for the thread-group leader will be
65d0a567a73170 Christian Brauner 2025-03-19 231 * delayed until the last subthread of the thread-group
65d0a567a73170 Christian Brauner 2025-03-19 232 * exits.
65d0a567a73170 Christian Brauner 2025-03-19 233 *
65d0a567a73170 Christian Brauner 2025-03-19 234 * (2) If a subthread of a thread-group execs then the
65d0a567a73170 Christian Brauner 2025-03-19 235 * current thread-group leader will be SIGKILLed and the
65d0a567a73170 Christian Brauner 2025-03-19 236 * subthread will assume the struct pid of the now defunct
65d0a567a73170 Christian Brauner 2025-03-19 237 * old thread-group leader. No exit notification will be
65d0a567a73170 Christian Brauner 2025-03-19 238 * generated for PIDFD_THREAD pidfds referring to the old
65d0a567a73170 Christian Brauner 2025-03-19 239 * thread-group leader as they continue referring to the new
65d0a567a73170 Christian Brauner 2025-03-19 240 * thread-group leader.
50f4f2d197e194 Christian Brauner 2024-02-12 241 */
50f4f2d197e194 Christian Brauner 2024-02-12 242 guard(rcu)();
50f4f2d197e194 Christian Brauner 2024-02-12 243 task = pid_task(pid, PIDTYPE_PID);
50f4f2d197e194 Christian Brauner 2024-02-12 244 if (!task)
50f4f2d197e194 Christian Brauner 2024-02-12 245 poll_flags = EPOLLIN | EPOLLRDNORM | EPOLLHUP;
65d0a567a73170 Christian Brauner 2025-03-19 246 else if (task->exit_state && !delay_group_leader(task))
50f4f2d197e194 Christian Brauner 2024-02-12 247 poll_flags = EPOLLIN | EPOLLRDNORM;
50f4f2d197e194 Christian Brauner 2024-02-12 248
50f4f2d197e194 Christian Brauner 2024-02-12 249 return poll_flags;
50f4f2d197e194 Christian Brauner 2024-02-12 250 }
50f4f2d197e194 Christian Brauner 2024-02-12 251
:::::: The code at line 213 was first introduced by commit
:::::: 50f4f2d197e194ec0356962b99ca2b72e9a37bc8 pidfd: move struct pidfd_fops
:::::: TO: Christian Brauner <brauner@kernel.org>
:::::: CC: Christian Brauner <brauner@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-03-20 13:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202503202312.SmfIIwCj-lkp@intel.com \
--to=lkp@intel.com \
--cc=brauner@kernel.org \
--cc=christianvanbrauner@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oleg@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.