Re: [PATCH 6/7] psi: pressure stall information for CPU, memory, and IO

2018-05-14 Thread Peter Zijlstra
On Thu, May 10, 2018 at 09:41:32AM -0400, Johannes Weiner wrote: > So there is a reason I'm tracking productivity states per-cpu and not > globally. Consider the following example periods on two CPUs: > > CPU 0 > Task 1: | EXECUTING | memstalled | > Task 2: | runqueued | EXECUTING | > >

Re: [PATCH 6/7] psi: pressure stall information for CPU, memory, and IO

2018-05-09 Thread Peter Zijlstra
On Wed, May 09, 2018 at 12:46:18PM +0200, Peter Zijlstra wrote: > On Mon, May 07, 2018 at 05:01:34PM -0400, Johannes Weiner wrote: > > > @@ -2038,6 +2038,7 @@ try_to_wake_up(struct task_struct *p, unsigned int > > state, int wake_flags) > > cpu = selec

Re: [PATCH 7/7] psi: cgroup support

2018-05-09 Thread Peter Zijlstra
On Mon, May 07, 2018 at 05:01:35PM -0400, Johannes Weiner wrote: > --- a/kernel/sched/psi.c > +++ b/kernel/sched/psi.c > @@ -260,6 +260,18 @@ void psi_task_change(struct task_struct *task, u64 now, > int clear, int set) > task->psi_flags |= set; > > psi_group_update(_system, cpu,

Re: [PATCH 6/7] psi: pressure stall information for CPU, memory, and IO

2018-05-09 Thread Peter Zijlstra
On Mon, May 07, 2018 at 05:01:34PM -0400, Johannes Weiner wrote: > @@ -28,10 +28,14 @@ static inline int sched_info_on(void) > return 1; > #elif defined(CONFIG_TASK_DELAY_ACCT) > extern int delayacct_on; > - return delayacct_on; > -#else > - return 0; > + if

Re: [PATCH 6/7] psi: pressure stall information for CPU, memory, and IO

2018-05-09 Thread Peter Zijlstra
On Mon, May 07, 2018 at 05:01:34PM -0400, Johannes Weiner wrote: > @@ -2038,6 +2038,7 @@ try_to_wake_up(struct task_struct *p, unsigned int > state, int wake_flags) > cpu = select_task_rq(p, p->wake_cpu, SD_BALANCE_WAKE, wake_flags); > if (task_cpu(p) != cpu) { >

Re: [PATCH 6/7] psi: pressure stall information for CPU, memory, and IO

2018-05-09 Thread Peter Zijlstra
On Mon, May 07, 2018 at 05:01:34PM -0400, Johannes Weiner wrote: > +static void psi_clock(struct work_struct *work) > +{ > + dwork = to_delayed_work(work); > + group = container_of(dwork, struct psi_group, clock_work); > + > + > + /* Keep the clock ticking only when there is action

Re: [PATCH 6/7] psi: pressure stall information for CPU, memory, and IO

2018-05-09 Thread Peter Zijlstra
On Mon, May 07, 2018 at 05:01:34PM -0400, Johannes Weiner wrote: > +/** > + * psi_memstall_enter - mark the beginning of a memory stall section > + * @flags: flags to handle nested sections > + * > + * Marks the calling task as being stalled due to a lack of memory, > + * such as waiting for a

Re: [PATCH 6/7] psi: pressure stall information for CPU, memory, and IO

2018-05-09 Thread Peter Zijlstra
On Mon, May 07, 2018 at 05:01:34PM -0400, Johannes Weiner wrote: > diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h > index 15750c222ca2..1658477466d5 100644 > --- a/kernel/sched/sched.h > +++ b/kernel/sched/sched.h > @@ -919,6 +921,8 @@ DECLARE_PER_CPU_SHARED_ALIGNED(struct rq,

Re: [PATCH 6/7] psi: pressure stall information for CPU, memory, and IO

2018-05-09 Thread Peter Zijlstra
On Mon, May 07, 2018 at 05:01:34PM -0400, Johannes Weiner wrote: > + u64 some[NR_PSI_RESOURCES] = { 0, }; > + u64 full[NR_PSI_RESOURCES] = { 0, }; > + some[r] /= max(nonidle_total, 1UL); > + full[r] /= max(nonidle_total, 1UL); That's a bare 64bit divide.. that

Re: [PATCH 6/7] psi: pressure stall information for CPU, memory, and IO

2018-05-09 Thread Peter Zijlstra
On Mon, May 07, 2018 at 05:01:34PM -0400, Johannes Weiner wrote: > +static void psi_clock(struct work_struct *work) > +{ > + u64 some[NR_PSI_RESOURCES] = { 0, }; > + u64 full[NR_PSI_RESOURCES] = { 0, }; > + unsigned long nonidle_total = 0; > + unsigned long missed_periods; > +

Re: [PATCH 6/7] psi: pressure stall information for CPU, memory, and IO

2018-05-09 Thread Peter Zijlstra
On Mon, May 07, 2018 at 05:01:34PM -0400, Johannes Weiner wrote: > diff --git a/include/linux/psi_types.h b/include/linux/psi_types.h > new file mode 100644 > index ..b22b0ffc729d > --- /dev/null > +++ b/include/linux/psi_types.h > @@ -0,0 +1,84 @@ > +#ifndef _LINUX_PSI_TYPES_H >

Re: [PATCH 5/7] sched: loadavg: make calc_load_n() public

2018-05-09 Thread Peter Zijlstra
On Mon, May 07, 2018 at 05:01:33PM -0400, Johannes Weiner wrote: > +static inline unsigned long > +fixed_power_int(unsigned long x, unsigned int frac_bits, unsigned int n) > +{ > + unsigned long result = 1UL << frac_bits; > + > + if (n) { > + for (;;) { > +

Re: [PATCH] blk: optimization for classic polling

2018-02-21 Thread Peter Zijlstra
On Tue, Feb 20, 2018 at 12:37:07PM -1000, Jens Axboe wrote: > On 2/20/18 3:21 AM, Peter Zijlstra wrote: > > On Sun, May 30, 2083 at 09:51:06AM +0530, Nitesh Shetty wrote: > >> This removes the dependency on interrupts to wake up task. Set task > >> state as TASK_RUNNING

Re: [PATCH] blk: optimization for classic polling

2018-02-20 Thread Peter Zijlstra
On Sun, May 30, 2083 at 09:51:06AM +0530, Nitesh Shetty wrote: > This removes the dependency on interrupts to wake up task. Set task > state as TASK_RUNNING, if need_resched() returns true, > while polling for IO completion. > Earlier, polling task used to sleep, relying on interrupt to wake it

Re: random call_single_data alignment

2017-12-20 Thread Peter Zijlstra
On Wed, Dec 20, 2017 at 12:40:25PM -0700, Jens Axboe wrote: > On 12/20/17 12:10 PM, Jens Axboe wrote: > > For some reason, commit 966a967116e6 was added to the tree without > > CC'ing relevant maintainers, even though it's touching random subsystems. > > One example is struct request, a core

Re: [PATCH] Pass the task_struct explicitly to delayacct_blkio_end

2017-12-18 Thread Peter Zijlstra
On Fri, Dec 15, 2017 at 06:11:43PM +, Josh Snyder wrote: > Subject: [PATCH] Pass the task_struct explicitly to delayacct_blkio_end That subject is crap; it needs a subsystem prefix and it needs to describe what is done, not how its done. Something like: delayacct: Fix double accounting

Re: [PATCH 2/6] blk-mq: replace timeout synchronization with a RCU and generation based scheme

2017-12-14 Thread Peter Zijlstra
On Fri, Dec 15, 2017 at 10:12:50AM +0800, jianchao.wang wrote: > > That only makes it a little better: > > > > Task-A Worker > > > > write_seqcount_begin() > > blk_mq_rw_update_state(rq, IN_FLIGHT) > > blk_add_timer(rq) > > > >

Re: [PATCH 2/6] blk-mq: replace timeout synchronization with a RCU and generation based scheme

2017-12-14 Thread Peter Zijlstra
On Thu, Dec 14, 2017 at 09:42:48PM +, Bart Van Assche wrote: > On Thu, 2017-12-14 at 21:20 +0100, Peter Zijlstra wrote: > > On Thu, Dec 14, 2017 at 06:51:11PM +, Bart Van Assche wrote: > > > On Tue, 2017-12-12 at 11:01 -0800, Tejun Heo wrote: > > > >

Re: [PATCH 2/6] blk-mq: replace timeout synchronization with a RCU and generation based scheme

2017-12-14 Thread Peter Zijlstra
On Thu, Dec 14, 2017 at 06:51:11PM +, Bart Van Assche wrote: > On Tue, 2017-12-12 at 11:01 -0800, Tejun Heo wrote: > > + write_seqcount_begin(>gstate_seq); > > + blk_mq_rq_update_state(rq, MQ_RQ_IN_FLIGHT); > > + blk_add_timer(rq); > > + write_seqcount_end(>gstate_seq); > > My

Re: About the try to remove cross-release feature entirely by Ingo

2017-12-14 Thread Peter Zijlstra
On Wed, Dec 13, 2017 at 10:07:11PM -0500, Theodore Ts'o wrote: > interpreted this as the lockdep maintainers saying, "hey, not my > fault, it's the subsystem maintainer's fault for not properly > classifying the locks" --- and thus dumping the responsibility in the > subsystem maintainers' laps.

Re: possible circular locking dependency detected [was: linux-next: Tree for Aug 22]

2017-08-30 Thread Peter Zijlstra
On Wed, Aug 30, 2017 at 10:42:07AM +0200, Peter Zijlstra wrote: > > So the overhead looks to be spread out over all sorts, which makes it > harder to find and fix. > > stack unwinding is done lots and is fairly expensive, I've not yet > checked if crossrelease does too much of

Re: possible circular locking dependency detected [was: linux-next: Tree for Aug 22]

2017-08-30 Thread Peter Zijlstra
On Wed, Aug 30, 2017 at 03:15:11PM +0900, Sergey Senozhatsky wrote: > Hi, > > On (08/30/17 14:43), Byungchul Park wrote: > [..] > > > notably slower than earlier 4.13 linux-next. (e.g. scrolling in vim > > > is irritatingly slow) > > > > To Ingo, > > > > I cannot decide if we have to roll back

Re: possible circular locking dependency detected [was: linux-next: Tree for Aug 22]

2017-08-23 Thread Peter Zijlstra
On Wed, Aug 23, 2017 at 09:03:04AM +0900, Byungchul Park wrote: > On Tue, Aug 22, 2017 at 09:43:56PM +, Bart Van Assche wrote: > The report is talking about the following lockup: > > A work in a worker A task work on exit to user > --

Re: [PATCH] block: note about cloned bios and bio_for_each_segment_all

2017-07-24 Thread Peter Zijlstra
On Tue, Jul 18, 2017 at 03:19:00PM -0700, Bart Van Assche wrote: > Hello Peter, Sorry for being late, I'm trying to recover from a few weeks of leave and the inbox is in shambles. > In a test I ran myself with kernel v4.12-rc1 I also noticed that a > WARN_ON_ONCE() statement triggered an oops in

Re: [PATCH 0/5] v2: block subsystem refcounter conversions

2017-04-21 Thread Peter Zijlstra
On Fri, Apr 21, 2017 at 08:03:13AM -0600, Jens Axboe wrote: > You have it so easy - the code is completely standalone, building a > small test framework around it and measuring performance in _user space_ > is trivial. Something like this you mean:

Re: [blk_mq_register_hctx] 29dee3c03a WARNING: CPU: 0 PID: 5 at lib/refcount.c:114 refcount_inc

2017-02-28 Thread Peter Zijlstra
On Tue, Feb 28, 2017 at 09:38:04AM +0100, Peter Zijlstra wrote: > On Tue, Feb 28, 2017 at 09:17:11AM +0100, Peter Zijlstra wrote: > > On Tue, Feb 28, 2017 at 12:11:17PM +0800, Fengguang Wu wrote: > > > Hello, > > > > > > FYI, an old blk_mq bug triggers ne

Re: [PATCH 0/4] blk-mq: cleanup on all kinds of kobjects

2017-02-28 Thread Peter Zijlstra
etween hw queue and their > kobjects. > > The last patch is a followup of 3rd patch. These do indeed make the kobject warnings, and the resulting refcount warning, go away. Tested-by: Peter Zijlstra (Intel) <pet...@infradead.org>

Re: [blk_mq_register_hctx] 29dee3c03a WARNING: CPU: 0 PID: 5 at lib/refcount.c:114 refcount_inc

2017-02-28 Thread Peter Zijlstra
On Tue, Feb 28, 2017 at 09:17:11AM +0100, Peter Zijlstra wrote: > On Tue, Feb 28, 2017 at 12:11:17PM +0800, Fengguang Wu wrote: > > Hello, > > > > FYI, an old blk_mq bug triggers new warnings on this commit. It's very > > reproducible and you may try the

Re: [blk_mq_register_hctx] 29dee3c03a WARNING: CPU: 0 PID: 5 at lib/refcount.c:114 refcount_inc

2017-02-28 Thread Peter Zijlstra
On Tue, Feb 28, 2017 at 12:11:17PM +0800, Fengguang Wu wrote: > Hello, > > FYI, an old blk_mq bug triggers new warnings on this commit. It's very > reproducible and you may try the attached reproduce-* script. > [4.447772] kobject (88001c041f10): tried to init an initialized > object,

Re: [blk_mq_register_hctx] 29dee3c03a WARNING: CPU: 0 PID: 5 at lib/refcount.c:114 refcount_inc

2017-02-28 Thread Peter Zijlstra
ux-next.git master > > commit 29dee3c03abce04cd527878ef5f9e5f91b7b83f4 > Author: Peter Zijlstra <pet...@infradead.org> > AuthorDate: Fri Feb 10 16:27:52 2017 +0100 > Commit: Ingo Molnar <mi...@kernel.org> > CommitDate: Fri Feb 24 09:02:10 2017 +0100 >