From: Pavel Emelyanov <xemul-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
To: Andrey Vagin <avagin-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
criu-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Roland McGrath <roland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Oleg Nesterov <oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
"Paul E. McKenney"
<paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Dave Jones <davej-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
"Michael Kerrisk (man-pages)"
<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Linus Torvalds
<torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
Pedro Alves <palves-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] ptrace: add ability to retrieve signals without removing from a queue (v2)
Date: Mon, 25 Feb 2013 14:13:43 +0400 [thread overview]
Message-ID: <512B3957.1020505@parallels.com> (raw)
In-Reply-To: <1361786813-14652-1-git-send-email-avagin-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
> + 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
WARNING: multiple messages have this Message-ID (diff)
From: Pavel Emelyanov <xemul@parallels.com>
To: Andrey Vagin <avagin@openvz.org>
Cc: linux-kernel@vger.kernel.org, criu@openvz.org,
linux-api@vger.kernel.org, Roland McGrath <roland@redhat.com>,
Oleg Nesterov <oleg@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
David Howells <dhowells@redhat.com>,
Dave Jones <davej@redhat.com>,
"Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Pedro Alves <palves@redhat.com>
Subject: Re: [PATCH] ptrace: add ability to retrieve signals without removing from a queue (v2)
Date: Mon, 25 Feb 2013 14:13:43 +0400 [thread overview]
Message-ID: <512B3957.1020505@parallels.com> (raw)
In-Reply-To: <1361786813-14652-1-git-send-email-avagin@openvz.org>
> + 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
next prev parent reply other threads:[~2013-02-25 10:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-25 10:06 [PATCH] ptrace: add ability to retrieve signals without removing from a queue (v2) Andrey Vagin
2013-02-25 10:06 ` Andrey Vagin
[not found] ` <1361786813-14652-1-git-send-email-avagin-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
2013-02-25 10:13 ` Pavel Emelyanov [this message]
2013-02-25 10:13 ` Pavel Emelyanov
[not found] ` <512B3957.1020505-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2013-02-25 10:46 ` Andrey Wagin
2013-02-25 10:46 ` Andrey Wagin
2013-02-25 22:12 ` Andrew Morton
2013-02-25 22:12 ` Andrew Morton
[not found] ` <20130225141234.99b76738.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2013-02-25 22:28 ` Michael Kerrisk (man-pages)
2013-02-25 22:28 ` Michael Kerrisk (man-pages)
[not found] ` <CAKgNAkhoK4KQ-5PC+C=g1i+J7WQsdvOWFiJ9PiqD26EdCZW0OA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-25 22:37 ` Andrew Morton
2013-02-25 22:37 ` Andrew Morton
2013-02-26 7:33 ` Andrey Wagin
2013-02-26 7:33 ` Andrey Wagin
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=512B3957.1020505@parallels.com \
--to=xemul-bzqdu9zft3wakbo8gow8eq@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=avagin-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org \
--cc=criu-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org \
--cc=davej-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=palves-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
--cc=roland-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.