public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Michel Lespinasse <walken@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	David Howells <dhowells@redhat.com>,
	Salman Qazi <sqazi@google.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rwlock_t unfairness and tasklist_lock
Date: Sat, 12 Jan 2013 18:46:07 +0100	[thread overview]
Message-ID: <20130112174607.GB22338@redhat.com> (raw)
In-Reply-To: <20130112033346.GA11712@google.com>

On 01/11, Michel Lespinasse wrote:
>
> So I looked again at getpriority() since that's what I had used for my
> DOS test code, and it looks like everything there is already protected
> by RCU or smaller granularity locks and refcounts. Patch attached to
> remove this tasklist_lock usage.

And probably the change in getpriority() is fine, but ...

> @@ -189,7 +189,6 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)
>  		niceval = 19;
>
>  	rcu_read_lock();
> -	read_lock(&tasklist_lock);
>  	switch (which) {
>  		case PRIO_PROCESS:
>  			if (who)
> @@ -226,7 +225,6 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)
>  			break;
>  	}
>  out_unlock:
> -	read_unlock(&tasklist_lock);

you also changed setpriority(), this should be documented at least ;)

OK. Even without this change, say, sys_setpriority(PRIO_PGRP) can obviously
race with fork(), so this change probably is not bad.

Oleg.


      reply	other threads:[~2013-01-12 17:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-09  4:03 rwlock_t unfairness and tasklist_lock Michel Lespinasse
2013-01-09 17:49 ` Oleg Nesterov
2013-01-09 23:20   ` Michel Lespinasse
2013-01-12 17:31     ` Oleg Nesterov
2013-01-25  0:33       ` Michel Lespinasse
2013-01-11 14:34 ` Thomas Gleixner
2013-01-12  3:33   ` [PATCH] " Michel Lespinasse
2013-01-12 17:46     ` Oleg Nesterov [this message]

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=20130112174607.GB22338@redhat.com \
    --to=oleg@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sqazi@google.com \
    --cc=tglx@linutronix.de \
    --cc=walken@google.com \
    /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