From nobody Sat Feb 7 13:41:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 3587F2DFA54 for ; Mon, 2 Feb 2026 09:59:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770026352; cv=none; b=SzMJ6Qb/CmtbGsphqpxgD/tUE0pHhTT96wEPYc7u8iNxpiVLyTTvovhGyNQr0J3E41VvgRsXYKO5oFqSBi06I6fRSqHPSFH0z46teJKuTWMvmwqJb8P0ujc26atrKGd9vzpPg7h3UCi4opCIjTiupFKu8H+nnYID3yEPqXjnUkw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770026352; c=relaxed/simple; bh=pYrmUS0FJ3KhyfgMuD6dsWUKw2ni7zgqi+l5iUSO+YI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=lwVxj2enwZ7xClcHJb93YlUZ50QKg5S9aqsy52YIb1oBlj5kiYJGaMm7z7VxGe++xxIW1jzSR6gaLvXJR+qar2ZKibGcqKRAQTmDaxLxkH65WhH/Q4+Dzc+mbo7q3vAdRbRbHZmlY94eGgHJ91s+3YrvAQCzYJGcU8a0VCy2aCQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aVrG1kiF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aVrG1kiF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2276BC19421; Mon, 2 Feb 2026 09:59:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770026351; bh=pYrmUS0FJ3KhyfgMuD6dsWUKw2ni7zgqi+l5iUSO+YI=; h=From:To:Cc:Subject:Date:From; b=aVrG1kiFFSwpdF3bkJMYorq543+x56G7AEPqtBT0FmNNlt82+q/f1x8OYMKiwymiK aQNkql6FvZrDGDr955TemrJFbdeEkVZ37QS2o4mJZ1TVYww2zXFg4MNq2jxKNG6let ja7LR1pfWTlbWs8pXayc8KWzXhdCwUIOljxj+7v0BEpnSEcacTyQJvwrA606PJRTW2 zhgJpxRBq1Hnxpc/c6CrwvYKoR4I/5dnArRW85Q+CCtB/eUpfMZnBF4l1EZYZZUJ8D GBPEcmBSxOU9PRTD5gbLPYz1UGzuXx27w4yVVNWh3Mpy9aC7HfYfg6WQfPx2+xlvFo Ww3cezARQ+ORA== From: Arnd Bergmann To: Balbir Singh , Yang Yang , Wang Yaxin , Andrew Morton Cc: Arnd Bergmann , xu xin , Kun Jiang , linux-kernel@vger.kernel.org Subject: [PATCH] delayacct: fix uapi timespec64 definition Date: Mon, 2 Feb 2026 10:59:00 +0100 Message-Id: <20260202095906.1344100-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann The custom definition of 'struct timespec64' is incompatible with both the kernel's internal definition and the glibc type, at least on big-endian targets that have the tv_nsec field in a different place, and the definition clashes with any userspace that also defines a timespec64 structure. Running the header check with -Wpadding enabled produces this output that warns about the incorrect padding: usr/include/linux/taskstats.h:25:1: error: padding struct size to alignment= boundary with 4 bytes [-Werror=3Dpadded] Remove the hack and instead use the regular __kernel_timespec type that is meant to be used in uapi definitions. Fixes: 29b63f6eff0e ("delayacct: add timestamp of delay max") Signed-off-by: Arnd Bergmann --- include/uapi/linux/taskstats.h | 27 +++++++++------------------ kernel/delayacct.c | 6 ++++-- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/include/uapi/linux/taskstats.h b/include/uapi/linux/taskstats.h index a66b2d84a310..cc7fccd57979 100644 --- a/include/uapi/linux/taskstats.h +++ b/include/uapi/linux/taskstats.h @@ -18,16 +18,7 @@ #define _LINUX_TASKSTATS_H =20 #include -#ifdef __KERNEL__ -#include -#else -#ifndef _LINUX_TIME64_H -struct timespec64 { - __s64 tv_sec; /* seconds */ - long tv_nsec; /* nanoseconds */ -}; -#endif -#endif +#include =20 /* Format for per-task data returned to userland when * - a task exits @@ -251,14 +242,14 @@ struct taskstats { __u64 irq_delay_min; =20 /*v17: delay max timestamp record*/ - struct timespec64 cpu_delay_max_ts; - struct timespec64 blkio_delay_max_ts; - struct timespec64 swapin_delay_max_ts; - struct timespec64 freepages_delay_max_ts; - struct timespec64 thrashing_delay_max_ts; - struct timespec64 compact_delay_max_ts; - struct timespec64 wpcopy_delay_max_ts; - struct timespec64 irq_delay_max_ts; + struct __kernel_timespec cpu_delay_max_ts; + struct __kernel_timespec blkio_delay_max_ts; + struct __kernel_timespec swapin_delay_max_ts; + struct __kernel_timespec freepages_delay_max_ts; + struct __kernel_timespec thrashing_delay_max_ts; + struct __kernel_timespec compact_delay_max_ts; + struct __kernel_timespec wpcopy_delay_max_ts; + struct __kernel_timespec irq_delay_max_ts; } __uapi_arch_align; =20 =20 diff --git a/kernel/delayacct.c b/kernel/delayacct.c index d58ffc63bcba..2e55c493c98b 100644 --- a/kernel/delayacct.c +++ b/kernel/delayacct.c @@ -18,7 +18,8 @@ do { \ d->type##_delay_max =3D tsk->delays->type##_delay_max; \ d->type##_delay_min =3D tsk->delays->type##_delay_min; \ - d->type##_delay_max_ts =3D tsk->delays->type##_delay_max_ts; \ + d->type##_delay_max_ts.tv_sec =3D tsk->delays->type##_delay_max_ts.tv_sec= ; \ + d->type##_delay_max_ts.tv_nsec =3D tsk->delays->type##_delay_max_ts.tv_ns= ec; \ tmp =3D d->type##_delay_total + tsk->delays->type##_delay; \ d->type##_delay_total =3D (tmp < d->type##_delay_total) ? 0 : tmp; \ d->type##_count +=3D tsk->delays->type##_count; \ @@ -175,7 +176,8 @@ int delayacct_add_tsk(struct taskstats *d, struct task_= struct *tsk) =20 d->cpu_delay_max =3D tsk->sched_info.max_run_delay; d->cpu_delay_min =3D tsk->sched_info.min_run_delay; - d->cpu_delay_max_ts =3D tsk->sched_info.max_run_delay_ts; + d->cpu_delay_max_ts.tv_sec =3D tsk->sched_info.max_run_delay_ts.tv_sec; + d->cpu_delay_max_ts.tv_nsec =3D tsk->sched_info.max_run_delay_ts.tv_nsec; tmp =3D (s64)d->cpu_delay_total + t2; d->cpu_delay_total =3D (tmp < (s64)d->cpu_delay_total) ? 0 : tmp; tmp =3D (s64)d->cpu_run_virtual_total + t3; --=20 2.39.5