public inbox for
 help / color / mirror / Atom feed
From: "wcohen at redhat dot com" <>
Subject: [Bug runtime/30831] New: The do_each_thread macro has been removed from newest  linux 6.6 kernels
Date: Thu, 07 Sep 2023 17:46:44 +0000	[thread overview]
Message-ID: <> (raw)

            Bug ID: 30831
           Summary: The do_each_thread macro has been removed from newest
                    linux 6.6 kernels
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: wcohen at redhat dot com
  Target Milestone: ---

When working with the newest linux 6.6 kernels in Fedora Rawhide scripts do not
compile because do_each_thread no longer exists in the kernel:

$ uname -a
Linux rawhide 6.6.0-0.rc0.20230905git3f86ed6ec0b3.7.fc40.x86_64 #1 SMP
PREEMPT_DYNAMIC Tue Sep  5 14:23:00 UTC 2023 x86_64 GNU/Linux
$ ../install/bin/stap -p4 -e 'probe begin {printf("hi!\n");exit()}'
In file included from
In function ‘stap_start_task_finder’:
error: implicit declaration of function ‘do_each_thread’; did you mean
‘for_each_thread’? [-Werror=implicit-function-declaration]
 1721 |         do_each_thread(grp, tsk) {
      |         ^~~~~~~~~~~~~~
      |         for_each_thread
error: expected ‘;’ before ‘{’ token
 1721 |         do_each_thread(grp, tsk) {
      |                                 ^~
      |                                 ;
In function ‘stap_task_finder_post_init’:
error: expected ‘;’ before ‘{’ token
 1868 |         do_each_thread(grp, tsk) {
      |                                 ^~
      |                                 ;
In file included from
In function ‘_stp_task_struct_valid’:
error: expected ‘;’ before ‘{’ token
  107 |   do_each_thread(grp, tsk) {
      |                           ^~
      |                           ;
cc1: all warnings being treated as errors
make[1]: *** [scripts/
/tmp/stapFRPbtc/stap_c1555c4c3e68d9141933830206b88dd6_1339_src.o] Error 1
make: *** [Makefile:2047: /tmp/stapFRPbtc] Error 2
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]

This is caused by kernel git commit 5ffd2c37cb7a53d52099e5ed1fd7ccbc9e358791

Author: Oleg Nesterov <>  2023-08-17 12:37:08
Committer: Andrew Morton <>  2023-08-21 16:46:25
Parent: cdaac8e7e5a059f9b5e816cda257f08d0abffacd (nilfs2: fix WARNING in
mark_buffer_dirty due to discarded buffer reuse)
Child:  3d0b71398490fbf68f9c5766b6dce71eb89c4da0 (kstrtox: consistently use
Branches: master, remotes/origin/master
Follows: v6.5-rc4

    kill do_each_thread()

    Eric has pointed out that we still have 3 users of do_each_thread().
    Change them to use for_each_process_thread() and kill this helper.

    There is a subtle change, after do_each_thread/while_each_thread g == t ==
    &init_task, while after for_each_process_thread() they both point to
    nowhere, but this doesn't matter.

    > Why is for_each_process_thread() better than do_each_thread()?

    Say, for_each_process_thread() is rcu safe, do_each_thread() is not.

    And certainly

        for_each_process_thread(p, t) {
                do_something(p, t);

    looks better than

        do_each_thread(p, t) {
                do_something(p, t);
        } while_each_thread(p, t);

    And again, there are only 3 users of this awkward helper left.  It should
    have been killed years ago and in fact I thought it had already been
    killed.  It uses while_each_thread() which needs some changes.

    Signed-off-by: Oleg Nesterov <>
    Reviewed-by: Kees Cook <>
    Cc: "Christian Brauner (Microsoft)" <>
    Cc: Eric W. Biederman <>
    Cc: Jiri Slaby <> # tty/serial
    Signed-off-by: Andrew Morton <>

You are receiving this mail because:
You are the assignee for the bug.

             reply	other threads:[~2023-09-07 17:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-07 17:46 wcohen at redhat dot com [this message]
2023-09-07 19:23 ` [Bug runtime/30831] Systemtap scripts fail to compile on " wcohen at redhat dot com
2023-09-08  2:49 ` wcohen at redhat dot com
2023-09-18 13:46 ` wcohen at redhat dot com
2023-09-18 13:51 ` wcohen at redhat dot com
2023-09-27 14:24 ` wcohen at redhat dot com
2023-09-27 20:03 ` wcohen at redhat dot com
2023-11-23 15:16   ` Tetsuo Handa
2023-12-13 14:47     ` William Cohen
2023-12-17 10:41       ` Tetsuo Handa

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* 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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).