From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2AAEF3858D35; Thu, 7 Sep 2023 17:46:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2AAEF3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694108805; bh=9n4t2cuPfrDTqPSIBb89sTBfLVoYinhxAzylLu+FekI=; h=From:To:Subject:Date:From; b=DcEj2ILfbPtMr/7yRqo7bgOK1QTiJWV5nkAz5/MsegrMG2p/QzAOyD+Ig+fzt8I7+ ehBBgbjrwXT8DNEYFLUhYnhsK2kO4S5oogvw1CgZnE3Jj9zRXfkjPn31VIzutNcrAI wdlx3n5O+ab0g2nVI/ltPJoELJcRmHu4EPHUOwag= From: "wcohen at redhat dot com" To: systemtap@sourceware.org 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 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: runtime X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: wcohen at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30831 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 /home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/task_fin= der.c:15, from /home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/runtime.= h:328, from /home/wcohen/systemtap_write/install/share/systemtap/runtime/runtime.h:26, from /tmp/stapFRPbtc/stap_c1555c4c3e68d9141933830206b88dd6_1339_src.c:21: /home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/task_fin= der2.c: In function =E2=80=98stap_start_task_finder=E2=80=99: /home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/task_fin= der2.c:1721:9: error: implicit declaration of function =E2=80=98do_each_thread=E2=80=99; d= id you mean =E2=80=98for_each_thread=E2=80=99? [-Werror=3Dimplicit-function-declaration] 1721 | do_each_thread(grp, tsk) { | ^~~~~~~~~~~~~~ | for_each_thread /home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/task_fin= der2.c:1721:33: error: expected =E2=80=98;=E2=80=99 before =E2=80=98{=E2=80=99 token 1721 | do_each_thread(grp, tsk) { | ^~ | ; /home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/task_fin= der2.c: In function =E2=80=98stap_task_finder_post_init=E2=80=99: /home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/task_fin= der2.c:1868:33: error: expected =E2=80=98;=E2=80=99 before =E2=80=98{=E2=80=99 token 1868 | do_each_thread(grp, tsk) { | ^~ | ; In file included from /home/wcohen/systemtap_write/install/share/systemtap/runtime/namespaces.h:1= 7, from /tmp/stapFRPbtc/stap_c1555c4c3e68d9141933830206b88dd6_1339_src.c:73: /home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/namespac= es.h: In function =E2=80=98_stp_task_struct_valid=E2=80=99: /home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/namespac= es.h:107:27: error: expected =E2=80=98;=E2=80=99 before =E2=80=98{=E2=80=99 token 107 | do_each_thread(grp, tsk) { | ^~ | ; cc1: all warnings being treated as errors make[1]: *** [scripts/Makefile.build:243: /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 _tolower()) Branches: master, remotes/origin/master Follows: v6.5-rc4 Precedes:=20 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 =3D= =3D t =3D=3D &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 shou= ld have been killed years ago and in fact I thought it had already been killed. It uses while_each_thread() which needs some changes. Link: https://lkml.kernel.org/r/20230817163708.GA8248@redhat.com 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 --=20 You are receiving this mail because: You are the assignee for the bug.=