mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@suse.cz>
Cc: pm list <linux-pm@lists.linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>, Len Brown <lenb@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Matt Helsley <matthltc@us.ibm.com>,
	Cedric Le Goater <clg@fr.ibm.com>,
	Paul Menage <menage@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Alan Stern <stern@rowland.harvard.edu>
Subject: Re: [RFC][PATCH 1/2] Freezer: Introduce PF_FREEZER_NOSIG
Date: Wed, 7 May 2008 14:16:47 +0200	[thread overview]
Message-ID: <200805071416.48180.rjw@sisk.pl> (raw)
In-Reply-To: <20080507093621.GF13858@elf.ucw.cz>

On Wednesday, 7 of May 2008, Pavel Machek wrote:
> Hi!

Hi,

> > From: Rafael J. Wysocki <rjw@sisk.pl>
> > 
> > The freezer currently attempts to distinguish kernel threads from
> > user space tasks by checking if their mm pointer is unset and it
> > does not send fake signals to kernel threads.  However, there are
> > kernel threads, mostly related to networking, that behave like
> > user space tasks and may want to be sent a fake signal to be frozen.
> > 
> > Introduce the new process flag PF_FREEZER_NOSIG that will be set
> > by default for all kernel threads and make the freezer only send
> > fake signals to the tasks having PF_FREEZER_NOSIG unset.  Provide
> > the set_freezable_with_signal() function to be called by the kernel
> > threads that want to be sent a fake signal for freezing.
> > 
> > This patch should not change the freezer's observable behavior.
> > 
> > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> 
> ACK.

Thanks!

> > -static int has_mm(struct task_struct *p)
> > +static inline bool should_send_signal(struct task_struct *p)
> >  {
> > -	return (p->mm && !(p->flags & PF_BORROWED_MM));
> > +	return !(current->flags & PF_FREEZER_NOSIG);
> >  }
> >
> 
> Note that we used to tell kernel threads by ->mm, and now you assume
> that anything created by ktrheadd is kernel thread, ->mm or not.
> 
> I'm not sure if those can differ (->mm = NULL somewhere? Or ->mm =
> something somewhere else?).

It's done in analogy with PF_NOFREEZE, ie. everything that has
set PF_NOFREEZE by default also has PF_FREEZER_NOSIG set by default, so I
really don't expect any problems here.

> I guess this should go to -mm for a long test...

Yes, it should.

Thanks,
Rafael

  reply	other threads:[~2008-05-07 12:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-06 22:03 [RFC][PATCH 0/2] Freezer face lifting Rafael J. Wysocki
2008-05-06 22:05 ` [RFC][PATCH 1/2] Freezer: Introduce PF_FREEZER_NOSIG Rafael J. Wysocki
2008-05-07  0:38   ` [linux-pm] " Gautham R Shenoy
2008-05-07 12:11     ` Rafael J. Wysocki
2008-05-07  9:36   ` Pavel Machek
2008-05-07 12:16     ` Rafael J. Wysocki [this message]
2008-05-06 22:07 ` [RFC][PATCH 2/2] Freezer: Try to handle killable tasks Rafael J. Wysocki
2008-05-07  9:41   ` Pavel Machek
2008-05-07 13:57     ` Matthew Wilcox
2008-05-07 18:35       ` Rafael J. Wysocki
2008-05-07 13:53   ` Matthew Wilcox
2008-05-07 18:41     ` Rafael J. Wysocki
2008-05-19 22:59       ` Pavel Machek

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=200805071416.48180.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@linux-foundation.org \
    --cc=clg@fr.ibm.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=matthltc@us.ibm.com \
    --cc=menage@google.com \
    --cc=mingo@elte.hu \
    --cc=pavel@suse.cz \
    --cc=stern@rowland.harvard.edu \
    /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®