linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: matthltc@us.ibm.com, rjw@sisk.pl, paul@paulmenage.org,
	containers@lists.linux-foundation.org,
	linux-pm@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/6] freezer: kill unused set_freezable_with_signal()
Date: Mon, 5 Sep 2011 11:33:15 +0900	[thread overview]
Message-ID: <20110905023315.GB9807@htj.dyndns.org> (raw)
In-Reply-To: <20110904184626.GA30101@redhat.com>

Hello, Oleg.

On Sun, Sep 04, 2011 at 08:46:26PM +0200, Oleg Nesterov wrote:
> > @@ -72,10 +72,6 @@ bool __refrigerator(bool check_kthr_stop)
> >  		schedule();
> >  	}
> >
> > -	spin_lock_irq(&current->sighand->siglock);
> > -	recalc_sigpending(); /* We sent fake signal, clean it up */
> > -	spin_unlock_irq(&current->sighand->siglock);
> > -
> 
> Why? This recalc_sigpending() makes sense imho. Otherwise the user-space
> tasks (almost) always return with TIF_SIGPENDING. May be we can do this
> under "if (PF_KTRHREAD)".

PF_KTHREAD no longer gets TIF_SIGPENDING set, so...

> For example. Suppose the user-space task does wait_event_freezable()...
> 
> Hmm. OTOH, wait_event_freezable() looks wrong anyway... So probably
> this doesn't matter. ptrace_stop/get_signal_to_deliver doesn't need
> this, probably we do not care about the other callers.

Can you elaborate on it being wrong?  Do you mean the possibility of
leaking spurious TIF_SIGPENDING?

> It seems, a lot of get_signal_to_deliver() calles also call
> try_to_freeze() for no reason.

Yeap, it doesn't really matter.  In most cases userland tasks would
get parked in the signal delivery path anyway and if a task is deep in
the kernel, it should and usually does hit syscall restart path.
Except for few special cases (maybe some of unfailable NFS calls),
there'userland tasks shouldn't take try_to_freeze() path outside of
signal delivery / job control path.

Also, in general, I don't think it's a good idea to add non-trivial
optimization like above to code path which is as cold as it gets
without any backing data.  The PM freezer used to busy loop until all
tasks enter refrigerator.  Nobody cares whether some tasks enter
signal delivery path one more time.

> So, yes, I am starting to think this change is fine too ;)

Yeay. :)

Thanks.

-- 
tejun

  reply	other threads:[~2011-09-05  2:33 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-02 18:27 [PATCHSET pm-freezer] freezer: fixes & simplifications Tejun Heo
2011-09-02 18:27 ` [PATCH 1/6] cgroup_freezer: fix freezer->state setting bug in freezer_change_state() Tejun Heo
2011-09-04 18:02   ` Oleg Nesterov
2011-09-04 18:11     ` Tejun Heo
2011-09-04 18:20       ` Oleg Nesterov
2011-09-02 18:27 ` [PATCH 2/6] freezer: set PF_NOFREEZE on a dying task right before TASK_DEAD " Tejun Heo
2011-09-02 18:27 ` [PATCH 3/6] freezer: restructure __refrigerator() Tejun Heo
2011-09-02 18:27 ` [PATCH 4/6] freezer: use lock_task_sighand() in fake_signal_wake_up() Tejun Heo
2011-09-02 18:27 ` [PATCH 5/6] freezer: remove unused @sig_only from freeze_task() Tejun Heo
2011-09-02 18:27 ` [PATCH 6/6] freezer: kill unused set_freezable_with_signal() Tejun Heo
2011-09-04 18:46   ` Oleg Nesterov
2011-09-05  2:33     ` Tejun Heo [this message]
2011-09-05  2:35       ` Tejun Heo
2011-09-05 16:21         ` Oleg Nesterov
2011-09-05 16:20       ` Oleg Nesterov
2011-09-06  3:28         ` Tejun Heo
2011-09-06 15:18           ` Oleg Nesterov
2011-09-06 15:25             ` Oleg Nesterov
2011-09-06 15:53               ` Tejun Heo
2011-09-07 18:21                 ` [PATCH 0/1] freezer: fix wait_event_freezable/__thaw_task races Oleg Nesterov
2011-09-07 18:22                   ` [PATCH 1/1] " Oleg Nesterov
2011-09-08  1:05                     ` Tejun Heo
2011-09-08 17:59                       ` Oleg Nesterov
2011-09-11  1:54                         ` Tejun Heo
2011-09-11 18:29                           ` Oleg Nesterov
2011-09-11 18:41                             ` Oleg Nesterov
2011-09-08 18:01           ` [PATCH 6/6] freezer: kill unused set_freezable_with_signal() Matt Helsley
2011-09-11  1:37             ` Tejun Heo
2011-09-04 18:48 ` [PATCHSET pm-freezer] freezer: fixes & simplifications Oleg Nesterov

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=20110905023315.GB9807@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=matthltc@us.ibm.com \
    --cc=oleg@redhat.com \
    --cc=paul@paulmenage.org \
    --cc=rjw@sisk.pl \
    /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;
as well as URLs for NNTP newsgroup(s).