mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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

  reply	other threads:[~2013-02-25 10:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25 10:06 Andrey Vagin
2013-02-25 10:13 ` Pavel Emelyanov [this message]
2013-02-25 10:46   ` Andrey Wagin
2013-02-25 22:12 ` Andrew Morton
2013-02-25 22:28   ` Michael Kerrisk (man-pages)
2013-02-25 22:37     ` Andrew Morton
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@parallels.com \
    --cc=akpm@linux-foundation.org \
    --cc=avagin@openvz.org \
    --cc=criu@openvz.org \
    --cc=davej@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=oleg@redhat.com \
    --cc=palves@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=roland@redhat.com \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®