mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Julian Anastasov <ja@ssi.bg>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Oleg Nesterov <oleg@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched: Introduce TASK_NOLOAD and TASK_IDLE
Date: Mon, 11 May 2015 17:11:09 +1000	[thread overview]
Message-ID: <20150511171109.46e07c67@notabene.brown> (raw)
In-Reply-To: <alpine.LFD.2.11.1505090910060.1671@ja.home.ssi.bg>

[-- Attachment #1: Type: text/plain, Size: 1993 bytes --]

On Sat, 9 May 2015 11:49:01 +0300 (EEST) Julian Anastasov <ja@ssi.bg> wrote:

> 
> 	Hello,
> 
> On Fri, 8 May 2015, Peter Zijlstra wrote:
> 
> > Subject: sched: Introduce TASK_NOLOAD and TASK_IDLE
> > From: Peter Zijlstra <peterz@infradead.org>
> > Date: Fri May 8 14:23:45 CEST 2015
> > 
> > Currently people use TASK_INTERRUPTIBLE to idle kthreads and wait for
> > 'work' because TASK_UNINTERRUPTIBLE contributes to the loadavg. Having
> > all idle kthreads contribute to the loadavg is somewhat silly.
> > 
> > Now mostly this works OK, because kthreads have all their signals
> > masked. However there's a few sites where this is causing problems and
> > TASK_UNINTERRUPTIBLE should be used, except for that loadavg issue.
> > 
> > This patch adds TASK_NOLOAD which, when combined with
> > TASK_UNINTERRUPTIBLE avoids the loadavg accounting.
> > 
> > As most of imagined usage sites are loops where a thread wants to
> > idle, waiting for work, a helper TASK_IDLE is introduced.
> 
> 	After checking our code in net/netfilter/ipvs/ip_vs_sync.c,
> sync_thread_master(), we may also need some wrappers:
> 
> - schedule_timeout_idle (instead of schedule_timeout call):
> 	__set_current_state(TASK_IDLE);
> 	return schedule_timeout(timeout);
> 
> 	- we here are really idle, so "N" looks ok

yes, I would want
 wait_event_idle_timeout() and wait_event_idle()

but I'll be happy to take whatever I can get :-)

Thanks,
NeilBrown


> 
> - pair of __wait_event_idle(wq, condition) and
> 	wait_event_idle(wq, condition) macros
> 
> 	- we here are write-blocked for socket, not sure
> 	if this blocked vs idle difference is useful to
> 	represent, in new bit for this blocked state "B"=2048,
> 	with 2 TASK_NOLOAD variants: N(idle) and B(blocked,
> 	2|1024|2048, eg. for read-blocked or write-blocked).
> 	It will need additional argument 'state'/'blocked' for 
> 	*wait_event_idle().
> 
> Regards
> 
> --
> Julian Anastasov <ja@ssi.bg>


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

  reply	other threads:[~2015-05-11  7:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08 12:47 Peter Zijlstra
2015-05-09  8:49 ` Julian Anastasov
2015-05-11  7:11   ` NeilBrown [this message]
2015-05-11 14:22   ` Peter Zijlstra
2015-05-11 19:34     ` Julian Anastasov
2015-05-12 12:25       ` Peter Zijlstra
2015-05-13  7:22         ` Julian Anastasov

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=20150511171109.46e07c67@notabene.brown \
    --to=neilb@suse.de \
    --cc=ja@ssi.bg \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --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

Powered by JetHome