The patch titled Process events: Fix biarch compatibility has been added to the -mm tree. Its filename is task-watchers-refactor-process-events-fix.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: Process events: Fix biarch compatibility From: Matt Helsley <matthltc@xxxxxxxxxx> Switch timestamp to two 32-bit scalars instead of two long fields of a timespec struct. This fixes an issue with biarch systems where the kernel was sending two 64-bit fields and a naive 32-bit userspace program was expecting two 32-bit fields. Naive userspace applications that used the timespec directly are broken. This allows more of the naieve apps to work correctly and all apps that are correct to continue to work. I submitted a different solution as an RFC earlier and have since switched to the solution recommended by Evgeniy Polyakov. Compiles with linux-2.6.17-mm6, boots, and tested with and without -m32 on x86-64. Signed-off-by: Matt Helsley <matthltc@xxxxxxxxxx> Cc: Evgeniy Polyakov <johnpol@xxxxxxxxxxx> Cc: Guillaume Thouvenin <guillaume.thouvenin@xxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/connector/cn_proc.c | 10 ++++++++-- include/linux/cn_proc.h | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff -puN drivers/connector/cn_proc.c~task-watchers-refactor-process-events-fix drivers/connector/cn_proc.c --- a/drivers/connector/cn_proc.c~task-watchers-refactor-process-events-fix +++ a/drivers/connector/cn_proc.c @@ -104,6 +104,7 @@ static void cn_proc_ack(int err, int rcv struct cn_msg *msg; struct proc_event *ev; __u8 buffer[CN_PROC_MSG_SIZE]; + struct timespec ts; if (atomic_read(&proc_event_num_listeners) < 1) return; @@ -111,7 +112,9 @@ static void cn_proc_ack(int err, int rcv msg = (struct cn_msg*)buffer; ev = (struct proc_event*)msg->data; msg->seq = rcvd_seq; - ktime_get_ts(&ev->timestamp); + ktime_get_ts(&ts); + ev->timestamp_sec = ts.tv_sec; + ev->timestamp_nsec = ts.tv_nsec; ev->cpu = -1; ev->what = PROC_EVENT_NONE; ev->event_data.ack.err = err; @@ -157,6 +160,7 @@ static void cn_proc_mcast_ctl(void *data static int cn_proc_watch_task(struct notifier_block *nb, unsigned long val, void *t) { + struct timespec ts; struct task_struct *task = t; struct cn_msg *msg; struct proc_event *ev; @@ -191,7 +195,9 @@ static int cn_proc_watch_task(struct not if (rc != NOTIFY_OK) return rc; get_seq(&msg->seq, &ev->cpu); - ktime_get_ts(&ev->timestamp); /* get high res monotonic timestamp */ + ktime_get_ts(&ts); /* get high res monotonic timestamp */ + ev->timestamp_sec = ts.tv_sec; + ev->timestamp_nsec = ts.tv_nsec; memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); msg->ack = 0; /* not used */ msg->len = sizeof(*ev); diff -puN include/linux/cn_proc.h~task-watchers-refactor-process-events-fix include/linux/cn_proc.h --- a/include/linux/cn_proc.h~task-watchers-refactor-process-events-fix +++ a/include/linux/cn_proc.h @@ -57,7 +57,8 @@ struct proc_event { PROC_EVENT_EXIT = 0x80000000 } what; __u32 cpu; - struct timespec timestamp; + __u32 timestamp_sec; + __u32 timestamp_nsec; union { /* must be last field of proc_event struct */ struct { __u32 err; _ Patches currently in -mm which might be from matthltc@xxxxxxxxxx are task-watchers-task-watchers.patch task-watchers-register-process-events-task-watcher.patch task-watchers-refactor-process-events.patch task-watchers-refactor-process-events-fix.patch task-watchers-make-process-events-configurable-as.patch task-watchers-allow-task-watchers-to-block.patch task-watchers-register-audit-task-watcher.patch task-watchers-register-per-task-delay-accounting.patch task-watchers-register-profile-as-a-task-watcher.patch task-watchers-add-support-for-per-task-watchers.patch task-watchers-register-semundo-task-watcher.patch task-watchers-register-per-task-semundo-watcher.patch ipc-replace-kmalloc-and-memset-in-get_undo_list-with-kzalloc.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html