All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Christoph Lameter <cl@gentwo.org>,
	Sasha Levin <sasha.levin@oracle.com>,
	akpm@linux-foundation.org, Gilad Ben-Yossef <gilad@benyossef.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	John Stultz <johnstul@us.ibm.com>,
	Mike Frysinger <vapier@gentoo.org>,
	Minchan Kim <minchan.kim@gmail.com>,
	Hakan Akkan <hakanakkan@gmail.com>,
	Max Krasnyansky <maxk@qualcomm.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	hughd@google.com, viresh.kumar@linaro.org, hpa@zytor.com,
	mingo@kernel.org, Lai Jiangshan <laijs@cn.fujitsu.com>
Subject: Re: vmstat: On demand vmstat workers V8
Date: Tue, 29 Jul 2014 09:12:26 -0400	[thread overview]
Message-ID: <20140729131226.GS7462@htj.dyndns.org> (raw)
In-Reply-To: <20140729122303.GA3935@laptop>

(cc'ing Lai)

Hello,

On Tue, Jul 29, 2014 at 02:23:03PM +0200, Peter Zijlstra wrote:
> > It's because we don't distinguish work items which are per-cpu for
> > optimization and per-cpu for correctness and can't automatically flush
> > / cancel / block per-cpu work items when a cpu goes down.  I like the
> > idea of distingushing them but it's gonna take a lot of auditing.
> 
> Just force flush on unplug and fix those that complain. No auditing
> needed for that.

I'm not sure that's a viable way forward.  It's not like we can
readily trigger the problematic cases which can lead to long pauses
during cpu down.  Besides, we need the distinction at the API level,
which is the whole point of this.  The best way probably is converting
all the correctness ones (these are the minorities) over to
queue_work_on() so that the per-cpu requirement is explicit.

> > Any work item usage which requires per-cpu for correctness should
> > implement cpu down hook to flush in-flight work items and block
> > further issuance.  This hasn't changed from the beginning and was
> > necessary even before cmwq.
> 
> I think before cmwq we'd run into the broken affinity warning in the
> scheduler.

That and work items silently not executed if queued on a downed cpu.
IIRC, we also had quite a few broken ones which were per-cpu but w/o
cpu down handling which just happened to work most of the time because
queueing itself was per-cpu in most cases and we didn't do cpu
on/offlining as often back then.  During cmwq conversion, I just
allowed them as I didn't want to add cpu down hooks for all of the
many per-cpu workqueue usages.  The lack of the distinction between
the two sets has always been there.

I agree this can be improved, but at least for now, please add cpu
down hooks.  We need them right now and they'll be helpful when later
separating out the correctness ones.

Thanks.

-- 
tejun

WARNING: multiple messages have this Message-ID (diff)
From: Tejun Heo <tj@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Christoph Lameter <cl@gentwo.org>,
	Sasha Levin <sasha.levin@oracle.com>,
	akpm@linux-foundation.org, Gilad Ben-Yossef <gilad@benyossef.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	John Stultz <johnstul@us.ibm.com>,
	Mike Frysinger <vapier@gentoo.org>,
	Minchan Kim <minchan.kim@gmail.com>,
	Hakan Akkan <hakanakkan@gmail.com>,
	Max Krasnyansky <maxk@qualcomm.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	hughd@google.com, viresh.kumar@linaro.org, hpa@zytor.com,
	mingo@kernel.org, Lai Jiangshan <laijs@cn.fujitsu.com>
Subject: Re: vmstat: On demand vmstat workers V8
Date: Tue, 29 Jul 2014 09:12:26 -0400	[thread overview]
Message-ID: <20140729131226.GS7462@htj.dyndns.org> (raw)
In-Reply-To: <20140729122303.GA3935@laptop>

(cc'ing Lai)

Hello,

On Tue, Jul 29, 2014 at 02:23:03PM +0200, Peter Zijlstra wrote:
> > It's because we don't distinguish work items which are per-cpu for
> > optimization and per-cpu for correctness and can't automatically flush
> > / cancel / block per-cpu work items when a cpu goes down.  I like the
> > idea of distingushing them but it's gonna take a lot of auditing.
> 
> Just force flush on unplug and fix those that complain. No auditing
> needed for that.

I'm not sure that's a viable way forward.  It's not like we can
readily trigger the problematic cases which can lead to long pauses
during cpu down.  Besides, we need the distinction at the API level,
which is the whole point of this.  The best way probably is converting
all the correctness ones (these are the minorities) over to
queue_work_on() so that the per-cpu requirement is explicit.

> > Any work item usage which requires per-cpu for correctness should
> > implement cpu down hook to flush in-flight work items and block
> > further issuance.  This hasn't changed from the beginning and was
> > necessary even before cmwq.
> 
> I think before cmwq we'd run into the broken affinity warning in the
> scheduler.

That and work items silently not executed if queued on a downed cpu.
IIRC, we also had quite a few broken ones which were per-cpu but w/o
cpu down handling which just happened to work most of the time because
queueing itself was per-cpu in most cases and we didn't do cpu
on/offlining as often back then.  During cmwq conversion, I just
allowed them as I didn't want to add cpu down hooks for all of the
many per-cpu workqueue usages.  The lack of the distinction between
the two sets has always been there.

I agree this can be improved, but at least for now, please add cpu
down hooks.  We need them right now and they'll be helpful when later
separating out the correctness ones.

Thanks.

-- 
tejun

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2014-07-29 13:12 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-10 14:04 vmstat: On demand vmstat workers V8 Christoph Lameter
2014-07-10 14:04 ` Christoph Lameter
2014-07-11 13:20 ` Frederic Weisbecker
2014-07-11 13:20   ` Frederic Weisbecker
2014-07-11 13:56   ` Christoph Lameter
2014-07-11 13:56     ` Christoph Lameter
2014-07-11 13:58     ` Frederic Weisbecker
2014-07-11 13:58       ` Frederic Weisbecker
2014-07-11 15:17       ` Christoph Lameter
2014-07-11 15:17         ` Christoph Lameter
2014-07-11 15:19         ` Frederic Weisbecker
2014-07-11 15:19           ` Frederic Weisbecker
2014-07-11 15:22           ` Christoph Lameter
2014-07-11 15:22             ` Christoph Lameter
2014-07-14 20:10             ` Hugh Dickins
2014-07-14 20:10               ` Hugh Dickins
2014-07-14 20:51               ` Christoph Lameter
2014-07-14 20:51                 ` Christoph Lameter
2014-07-30  3:04         ` Lai Jiangshan
2014-07-30  3:04           ` Lai Jiangshan
2014-07-26  2:22 ` Sasha Levin
2014-07-26  2:22   ` Sasha Levin
2014-07-28 18:55   ` Christoph Lameter
2014-07-28 18:55     ` Christoph Lameter
2014-07-28 21:54     ` Andrew Morton
2014-07-28 21:54       ` Andrew Morton
2014-07-28 22:00       ` Sasha Levin
2014-07-28 22:00         ` Sasha Levin
2014-07-29 15:17       ` Christoph Lameter
2014-07-29 15:17         ` Christoph Lameter
2014-07-29  7:56     ` Peter Zijlstra
2014-07-29 12:05       ` Tejun Heo
2014-07-29 12:05         ` Tejun Heo
2014-07-29 12:23         ` Peter Zijlstra
2014-07-29 12:23           ` Peter Zijlstra
2014-07-29 13:12           ` Tejun Heo [this message]
2014-07-29 13:12             ` Tejun Heo
2014-07-29 15:10             ` Christoph Lameter
2014-07-29 15:10               ` Christoph Lameter
2014-07-29 15:14               ` Tejun Heo
2014-07-29 15:14                 ` Tejun Heo
2014-07-29 15:26                 ` Christoph Lameter
2014-07-29 15:26                   ` Christoph Lameter
2014-07-29 15:39                 ` Christoph Lameter
2014-07-29 15:39                   ` Christoph Lameter
2014-07-29 15:47                   ` Sasha Levin
2014-07-29 15:47                     ` Sasha Levin
2014-07-29 15:59                     ` Christoph Lameter
2014-07-29 15:59                       ` Christoph Lameter
2014-07-30  3:11                   ` Lai Jiangshan
2014-07-30  3:11                     ` Lai Jiangshan
2014-07-30 14:34                     ` Christoph Lameter
2014-07-30 14:34                       ` Christoph Lameter
2014-07-29 15:22             ` Christoph Lameter
2014-07-29 15:22               ` Christoph Lameter
2014-07-29 15:43               ` Sasha Levin
2014-07-29 15:43                 ` Sasha Levin
2014-08-04 21:37   ` Sasha Levin
2014-08-04 21:37     ` Sasha Levin
2014-08-05 14:51     ` Christoph Lameter
2014-08-05 14:51       ` Christoph Lameter
2014-08-05 22:25       ` Sasha Levin
2014-08-05 22:25         ` Sasha Levin
2014-08-06 14:12         ` Christoph Lameter
2014-08-06 14:12           ` Christoph Lameter
2014-08-07  1:50           ` Sasha Levin
2014-08-07  1:50             ` Sasha Levin
2014-07-30  2:57 ` Lai Jiangshan
2014-07-30  2:57   ` Lai Jiangshan
2014-07-30 14:45   ` Christoph Lameter
2014-07-30 14:45     ` Christoph Lameter
2014-07-31  0:52     ` Lai Jiangshan
2014-07-31  0:52       ` Lai Jiangshan

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=20140729131226.GS7462@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=fweisbec@gmail.com \
    --cc=gilad@benyossef.com \
    --cc=hakanakkan@gmail.com \
    --cc=hpa@zytor.com \
    --cc=hughd@google.com \
    --cc=johnstul@us.ibm.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maxk@qualcomm.com \
    --cc=minchan.kim@gmail.com \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=sasha.levin@oracle.com \
    --cc=tglx@linutronix.de \
    --cc=vapier@gentoo.org \
    --cc=viresh.kumar@linaro.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 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.