Re: [PATCH] ptrace: add ability to retrieve signals without removingfrom a queue (v2)

From: Pavel Emelyanov
Date: Mon Feb 25 2013 - 05:14:21 EST


> + for (i = 0; i < arg.nr; i++) {
> + off = arg.off + i;
> +
> + spin_lock_irq(&child->sighand->siglock);
> + list_for_each_entry(q, &pending->list, list) {
> + if (!off--) {
> + copy_siginfo(&info, &q->info);
> + break;
> + }
> + }
> + spin_unlock_irq(&child->sighand->siglock);

What's the point of arg.nr if you for every single siginfo drop the lock
and perform linear search anyway?

Thanks,
Pavel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/