All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Andrew Morton <akpm@osdl.org>, Alan Cox <alan@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] do_acct_process: don't take tty_mutex
Date: Tue, 24 Oct 2006 11:48:15 +0200	[thread overview]
Message-ID: <1161683295.24143.12.camel@taijtu> (raw)
In-Reply-To: <20061023135644.GA1501@oleg>

On Mon, 2006-10-23 at 17:56 +0400, Oleg Nesterov wrote:
> Depends on
> 	tty-signal-tty-locking.patch
> 
> No need to take the global tty_mutex, signal->tty->driver can't go away
> while we are holding ->siglock.
> 
> Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl

> --- rc2-mm2/kernel/acct.c~	2006-10-22 19:28:17.000000000 +0400
> +++ rc2-mm2/kernel/acct.c	2006-10-23 17:09:12.000000000 +0400
> @@ -484,12 +484,9 @@ static void do_acct_process(struct file 
>  	ac.ac_ppid = current->parent->tgid;
>  #endif
>  
> -	mutex_lock(&tty_mutex);
> -	tty = get_current_tty();
> -	ac.ac_tty = tty ? old_encode_dev(tty_devnum(tty)) : 0;
> -	mutex_unlock(&tty_mutex);
> -
>  	spin_lock_irq(&current->sighand->siglock);
> +	tty = current->signal->tty;
> +	ac.ac_tty = tty ? old_encode_dev(tty_devnum(tty)) : 0;
>  	ac.ac_utime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_utime)));
>  	ac.ac_stime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_stime)));
>  	ac.ac_flag = pacct->ac_flag;
> 


      reply	other threads:[~2006-10-24  9:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-23 13:56 [PATCH] do_acct_process: don't take tty_mutex Oleg Nesterov
2006-10-24  9:48 ` Peter Zijlstra [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=1161683295.24143.12.camel@taijtu \
    --to=a.p.zijlstra@chello.nl \
    --cc=akpm@osdl.org \
    --cc=alan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@tv-sign.ru \
    /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.