[PATCH 2/2] mm, memcontrol: Implement memory.swap.events

2018-03-24 Thread Tejun Heo
Add swap max and fail events so that userland can monitor and respond to running out of swap. Signed-off-by: Tejun Heo Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Roman Gushchin Cc: Rik van Riel Cc: Andrew Morton Cc: linux-...@vger.kernel.org --- Documentation/cgroup-v2

[PATCH 1/2] mm, memcontrol: Move swap charge handling into get_swap_page()

2018-03-24 Thread Tejun Heo
adding swap related memcg events. Signed-off-by: Tejun Heo <t...@kernel.org> Cc: Johannes Weiner <han...@cmpxchg.org> Cc: Michal Hocko <mho...@kernel.org> Cc: Vladimir Davydov <vdavydov@gmail.com> Cc: Roman Gushchin <g...@fb.com> Cc: Rik van Riel <r...@surriel.c

[PATCH 1/2] mm, memcontrol: Move swap charge handling into get_swap_page()

2018-03-24 Thread Tejun Heo
adding swap related memcg events. Signed-off-by: Tejun Heo Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Roman Gushchin Cc: Rik van Riel Cc: Andrew Morton --- mm/memcontrol.c | 3 +++ mm/shmem.c | 4 mm/swap_slots.c | 10 +++--- mm/swap_state.c | 3 --- 4 files

[PATCHSET] mm, memcontrol: Implement memory.swap.events

2018-03-24 Thread Tejun Heo
Hello, This patchset implements memory.swap.events which contains max and fail events so that userland can monitor and respond to swap running out. It contains the following two patches. 0001-mm-memcontrol-Move-swap-charge-handling-into-get_swa.patch

[PATCHSET] mm, memcontrol: Implement memory.swap.events

2018-03-24 Thread Tejun Heo
Hello, This patchset implements memory.swap.events which contains max and fail events so that userland can monitor and respond to swap running out. It contains the following two patches. 0001-mm-memcontrol-Move-swap-charge-handling-into-get_swa.patch

[PATCH 2/3] mm: memcontrol: Use cgroup_rstat for stat accounting

2018-03-24 Thread Tejun Heo
utside memcg proper. * Accessors are updated / added. Signed-off-by: Tejun Heo <t...@kernel.org> Cc: Johannes Weiner <han...@cmpxchg.org> Cc: Michal Hocko <mho...@kernel.org> Cc: Vladimir Davydov <vdavydov@gmail.com> Cc: Roman Gushchin <g...@fb.com> Cc: Rik van Riel

[PATCH 2/3] mm: memcontrol: Use cgroup_rstat for stat accounting

2018-03-24 Thread Tejun Heo
utside memcg proper. * Accessors are updated / added. Signed-off-by: Tejun Heo Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Roman Gushchin Cc: Rik van Riel Cc: Andrew Morton --- include/linux/memcontrol.h | 74 +- mm/memcontro

[PATCHSET] mm, memcontrol: Make cgroup_rstat available to controllers

2018-03-24 Thread Tejun Heo
Hello, Since a983b5ebee57 ("mm: memcontrol: fix excessive complexity in memory.stat reporting"), memcg uses percpu batch-overflowing for all stat accounting. While the propagation delay is okay for statistics, it doesn't work for events. If a notification for an event is sent out, the relevant

[PATCHSET] mm, memcontrol: Make cgroup_rstat available to controllers

2018-03-24 Thread Tejun Heo
Hello, Since a983b5ebee57 ("mm: memcontrol: fix excessive complexity in memory.stat reporting"), memcg uses percpu batch-overflowing for all stat accounting. While the propagation delay is okay for statistics, it doesn't work for events. If a notification for an event is sent out, the relevant

[PATCH 3/3] mm: memcontrol: Remove lruvec_stat

2018-03-24 Thread Tejun Heo
lruvec_stat doesn't have any consumer. Remove it. Signed-off-by: Tejun Heo <t...@kernel.org> Cc: Johannes Weiner <han...@cmpxchg.org> Cc: Michal Hocko <mho...@kernel.org> Cc: Vladimir Davydov <vdavydov@gmail.com> Cc: Roman Gushchin <g...@fb.com> Cc: Rik van Riel

[PATCH 1/3] mm: memcontrol: Use cgroup_rstat for event accounting

2018-03-24 Thread Tejun Heo
n cgroup_rstat_flush_hold() and cgroup_rstat_flush_release(). Signed-off-by: Tejun Heo <t...@kernel.org> Cc: Johannes Weiner <han...@cmpxchg.org> Cc: Michal Hocko <mho...@kernel.org> Cc: Vladimir Davydov <vdavydov@gmail.com> Cc: Roman Gushchin <g...@fb.com> Cc: Rik va

[PATCH 3/3] mm: memcontrol: Remove lruvec_stat

2018-03-24 Thread Tejun Heo
lruvec_stat doesn't have any consumer. Remove it. Signed-off-by: Tejun Heo Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Roman Gushchin Cc: Rik van Riel Cc: Andrew Morton --- include/linux/memcontrol.h | 40 mm/memcontrol.c

[PATCH 1/3] mm: memcontrol: Use cgroup_rstat for event accounting

2018-03-24 Thread Tejun Heo
n cgroup_rstat_flush_hold() and cgroup_rstat_flush_release(). Signed-off-by: Tejun Heo Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Roman Gushchin Cc: Rik van Riel Cc: Andrew Morton --- include/linux/memcontrol.h | 19 mm/memcontrol.c| 114 +++

[PATCH 4/8] cgroup: Reorganize kernel/cgroup/rstat.c

2018-03-23 Thread Tejun Heo
Currently, rstat.c has rstat and base stat implementations intermixed. Collect base stat implementation at the end of the file. Also, reorder the prototypes. This patch doesn't make any functional changes. Signed-off-by: Tejun Heo <t...@kernel.org> --- kernel/cgroup/cgroup-internal.h

[PATCH 4/8] cgroup: Reorganize kernel/cgroup/rstat.c

2018-03-23 Thread Tejun Heo
Currently, rstat.c has rstat and base stat implementations intermixed. Collect base stat implementation at the end of the file. Also, reorder the prototypes. This patch doesn't make any functional changes. Signed-off-by: Tejun Heo --- kernel/cgroup/cgroup-internal.h | 2 +- kernel/cgroup

[PATCH 3/8] cgroup: Distinguish base resource stat implementation from rstat

2018-03-23 Thread Tejun Heo
doesn't make any functional changes. Signed-off-by: Tejun Heo <t...@kernel.org> --- include/linux/cgroup-defs.h | 29 ++ kernel/cgroup/cgroup-internal.h | 2 +- kernel/cgroup/cgroup.c | 4 ++- kernel/cgroup/rstat.c

[PATCH 5/8] cgroup: Factor out and expose cgroup_rstat_*() interface functions

2018-03-23 Thread Tejun Heo
implementation. * cgroup_rstat_flush(): Verbatim expose. While at it, drop assert on cgroup_rstat_mutex in cgroup_base_stat_flush() as it crosses layers and make a minor comment update. Signed-off-by: Tejun Heo <t...@kernel.org> --- include/linux/cgroup.h | 11 +-- kernel/

[PATCH 3/8] cgroup: Distinguish base resource stat implementation from rstat

2018-03-23 Thread Tejun Heo
doesn't make any functional changes. Signed-off-by: Tejun Heo --- include/linux/cgroup-defs.h | 29 ++ kernel/cgroup/cgroup-internal.h | 2 +- kernel/cgroup/cgroup.c | 4 ++- kernel/cgroup/rstat.c | 67 - 4 files changed

[PATCH 5/8] cgroup: Factor out and expose cgroup_rstat_*() interface functions

2018-03-23 Thread Tejun Heo
implementation. * cgroup_rstat_flush(): Verbatim expose. While at it, drop assert on cgroup_rstat_mutex in cgroup_base_stat_flush() as it crosses layers and make a minor comment update. Signed-off-by: Tejun Heo --- include/linux/cgroup.h | 11 +-- kernel/cgroup/cgroup-internal.h

[PATCH 2/8] cgroup: Rename stat to rstat

2018-03-23 Thread Tejun Heo
changes. * cpu_stat -> rstat_cpu * stat -> rstat * ?cstat-> ?rstatc Note that the renames are selective. The unrenamed are the ones which implement basic resource statistics on top of rstat. This will be further cleaned up in the following patches. Signed-off-by:

[PATCH 2/8] cgroup: Rename stat to rstat

2018-03-23 Thread Tejun Heo
changes. * cpu_stat -> rstat_cpu * stat -> rstat * ?cstat-> ?rstatc Note that the renames are selective. The unrenamed are the ones which implement basic resource statistics on top of rstat. This will be further cleaned up in the following patches. Signed-off-by:

[PATCH 6/8] cgroup: Replace cgroup_rstat_mutex with a spinlock

2018-03-23 Thread Tejun Heo
and adds a irq-safe flush function - cgroup_rstat_flush_irqsafe(). Explicit yield handling is added to the flush path so that other flush functions can yield to other threads and flushers. Signed-off-by: Tejun Heo <t...@kernel.org> --- include/linux/cgroup.h | 1 + kernel/cgroup/rstat.c

[PATCH 6/8] cgroup: Replace cgroup_rstat_mutex with a spinlock

2018-03-23 Thread Tejun Heo
and adds a irq-safe flush function - cgroup_rstat_flush_irqsafe(). Explicit yield handling is added to the flush path so that other flush functions can yield to other threads and flushers. Signed-off-by: Tejun Heo --- include/linux/cgroup.h | 1 + kernel/cgroup/rstat.c | 57

[PATCH 7/8] cgroup: Add cgroup_subsys->css_rstat_flush()

2018-03-23 Thread Tejun Heo
t lost. Combined with the rstat API previous patches factored out, this allows controllers to plug into rstat to manage their statistics in a scalable way. Signed-off-by: Tejun Heo <t...@kernel.org> --- include/linux/cgroup-defs.h | 5 + kernel/cgroup/cgroup.c | 11 +++ k

[PATCH 8/8] cgroup: Add memory barriers to plug cgroup_rstat_updated() race window

2018-03-23 Thread Tejun Heo
by synchronizing cgroup_rstat_updated() and flush path with memory barriers around cgroup_rstat_cpu->updated_next pointer. Signed-off-by: Tejun Heo <t...@kernel.org> --- kernel/cgroup/rstat.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/kernel/cgroup/rstat.c

[PATCHSET] cgroup/for-4.17: Make cgroup_rstat available to controllers

2018-03-23 Thread Tejun Heo
Hello, cgroup has scalable recursive stat mechanism implemented in kernel/stat.c. It's currently only used to track cpu consumptions and difficult to use outside of cgroup core. This patchset generalizes the mechanism and exposes it as cgroup_rstat so that controllers can use it. This patchset

[PATCH 7/8] cgroup: Add cgroup_subsys->css_rstat_flush()

2018-03-23 Thread Tejun Heo
t lost. Combined with the rstat API previous patches factored out, this allows controllers to plug into rstat to manage their statistics in a scalable way. Signed-off-by: Tejun Heo --- include/linux/cgroup-defs.h | 5 + kernel/cgroup/cgroup.c | 11 +++ kernel/cgroup/rstat.c

[PATCH 8/8] cgroup: Add memory barriers to plug cgroup_rstat_updated() race window

2018-03-23 Thread Tejun Heo
by synchronizing cgroup_rstat_updated() and flush path with memory barriers around cgroup_rstat_cpu->updated_next pointer. Signed-off-by: Tejun Heo --- kernel/cgroup/rstat.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rsta

[PATCHSET] cgroup/for-4.17: Make cgroup_rstat available to controllers

2018-03-23 Thread Tejun Heo
Hello, cgroup has scalable recursive stat mechanism implemented in kernel/stat.c. It's currently only used to track cpu consumptions and difficult to use outside of cgroup core. This patchset generalizes the mechanism and exposes it as cgroup_rstat so that controllers can use it. This patchset

[PATCH 1/8] cgroup: Rename kernel/cgroup/stat.c to kernel/cgroup/rstat.c

2018-03-23 Thread Tejun Heo
/cgroup/rstat.c. No content changes. Signed-off-by: Tejun Heo <t...@kernel.org> --- kernel/cgroup/Makefile| 2 +- kernel/cgroup/{stat.c => rstat.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename kernel/cgroup/{stat.c => rstat.c} (100%) diff --git a/kernel/cgrou

[PATCH 1/8] cgroup: Rename kernel/cgroup/stat.c to kernel/cgroup/rstat.c

2018-03-23 Thread Tejun Heo
/cgroup/rstat.c. No content changes. Signed-off-by: Tejun Heo --- kernel/cgroup/Makefile| 2 +- kernel/cgroup/{stat.c => rstat.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename kernel/cgroup/{stat.c => rstat.c} (100%) diff --git a/kernel/cgroup/Makefile b/kernel/

[PATCH cgroup/for-4.17 2/2] Subject: cgroup: Limit event generation frequency

2018-03-23 Thread Tejun Heo
e avoiding notification storms. Signed-off-by: Tejun Heo <t...@kernel.org> --- include/linux/cgroup-defs.h |2 ++ kernel/cgroup/cgroup.c | 25 +++-- 2 files changed, 25 insertions(+), 2 deletions(-) --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-

[PATCH cgroup/for-4.17 2/2] Subject: cgroup: Limit event generation frequency

2018-03-23 Thread Tejun Heo
e avoiding notification storms. Signed-off-by: Tejun Heo --- include/linux/cgroup-defs.h |2 ++ kernel/cgroup/cgroup.c | 25 +++-- 2 files changed, 25 insertions(+), 2 deletions(-) --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h @@ -105,6 +105

[PATCH cgroup/for-4.17 1/2] cgroup: Explicitly remove core interface files

2018-03-23 Thread Tejun Heo
that it's consistent with controller interface files. When added, the css is marked CSS_VISIBLE and they're explicitly removed before the cgroup is destroyed. This doesn't cause user-visible behavior changes. Signed-off-by: Tejun Heo <t...@kernel.org> --- kernel/cgroup

[PATCH cgroup/for-4.17 1/2] cgroup: Explicitly remove core interface files

2018-03-23 Thread Tejun Heo
that it's consistent with controller interface files. When added, the css is marked CSS_VISIBLE and they're explicitly removed before the cgroup is destroyed. This doesn't cause user-visible behavior changes. Signed-off-by: Tejun Heo --- kernel/cgroup/cgrou

Re: [PATCH 8/8] fs/aio: Use rcu_work instead of explicit rcu and work item

2018-03-21 Thread Tejun Heo
Hello, On Wed, Mar 21, 2018 at 06:17:43PM +0100, Oleg Nesterov wrote: > Mostly I am asking because I do not really understand > "[PATCH 6/8] RCU, workqueue: Implement rcu_work". > > I mean, the code looks simple and correct but why does it play with > WORK_STRUCT_PENDING_BIT? IOW, I do not see a

Re: [PATCH 8/8] fs/aio: Use rcu_work instead of explicit rcu and work item

2018-03-21 Thread Tejun Heo
Hello, On Wed, Mar 21, 2018 at 06:17:43PM +0100, Oleg Nesterov wrote: > Mostly I am asking because I do not really understand > "[PATCH 6/8] RCU, workqueue: Implement rcu_work". > > I mean, the code looks simple and correct but why does it play with > WORK_STRUCT_PENDING_BIT? IOW, I do not see a

Re: [PATCH 8/8] fs/aio: Use rcu_work instead of explicit rcu and work item

2018-03-21 Thread Tejun Heo
Hey, Oleg. On Wed, Mar 21, 2018 at 04:58:13PM +0100, Oleg Nesterov wrote: > > - struct rcu_head free_rcu; > > - struct work_struct free_work; /* see free_ioctx() */ > > + struct rcu_work free_rwork; /* see free_ioctx() */ > > IIUC, you can't easily share

Re: [PATCH 8/8] fs/aio: Use rcu_work instead of explicit rcu and work item

2018-03-21 Thread Tejun Heo
Hey, Oleg. On Wed, Mar 21, 2018 at 04:58:13PM +0100, Oleg Nesterov wrote: > > - struct rcu_head free_rcu; > > - struct work_struct free_work; /* see free_ioctx() */ > > + struct rcu_work free_rwork; /* see free_ioctx() */ > > IIUC, you can't easily share

Re: [PATCH v5 1/2] cpuset: Enable cpuset controller in default hierarchy

2018-03-20 Thread Tejun Heo
Hello, On Tue, Mar 20, 2018 at 04:53:37PM -0400, Waiman Long wrote: > ASAIK for v2, when cpuset.cpus is empty, cpuset.effective_cpus will show > all the cpus available from the parent. It is a different behavior from > v1. So do we still need a cpuset.cpus_available? Heh, you're right. Let's

Re: [PATCH v5 1/2] cpuset: Enable cpuset controller in default hierarchy

2018-03-20 Thread Tejun Heo
Hello, On Tue, Mar 20, 2018 at 04:53:37PM -0400, Waiman Long wrote: > ASAIK for v2, when cpuset.cpus is empty, cpuset.effective_cpus will show > all the cpus available from the parent. It is a different behavior from > v1. So do we still need a cpuset.cpus_available? Heh, you're right. Let's

Re: [PATCH v5 2/2] cpuset: Add cpuset.flags control knob to v2

2018-03-20 Thread Tejun Heo
Hello, Waiman. On Tue, Mar 20, 2018 at 04:12:25PM -0400, Waiman Long wrote: > After some thought, I am planning to impose the following additional > constraints on how sched_load_balance works in v2. > > 1) sched_load_balance will be made hierarchical, the child will inherit > the flag from its

Re: [PATCH v5 2/2] cpuset: Add cpuset.flags control knob to v2

2018-03-20 Thread Tejun Heo
Hello, Waiman. On Tue, Mar 20, 2018 at 04:12:25PM -0400, Waiman Long wrote: > After some thought, I am planning to impose the following additional > constraints on how sched_load_balance works in v2. > > 1) sched_load_balance will be made hierarchical, the child will inherit > the flag from its

Re: [PATCH v5 1/2] cpuset: Enable cpuset controller in default hierarchy

2018-03-20 Thread Tejun Heo
Hello, Waiman. On Tue, Mar 20, 2018 at 09:51:20AM -0400, Waiman Long wrote: > >> + It lists the onlined CPUs that are actually allowed to be > >> + used by tasks within the current cgroup. It is a subset of > >> + "cpuset.cpus". Its value will be affected by CPU hotplug > >> + events. > >

Re: [PATCH v5 1/2] cpuset: Enable cpuset controller in default hierarchy

2018-03-20 Thread Tejun Heo
Hello, Waiman. On Tue, Mar 20, 2018 at 09:51:20AM -0400, Waiman Long wrote: > >> + It lists the onlined CPUs that are actually allowed to be > >> + used by tasks within the current cgroup. It is a subset of > >> + "cpuset.cpus". Its value will be affected by CPU hotplug > >> + events. > >

Re: [PATCH] workqueue: fix the comments of nr_idle

2018-03-20 Thread Tejun Heo
On Tue, Mar 20, 2018 at 05:24:05PM +0800, Lai Jiangshan wrote: > Since the worker rebinding behavior was refactored, there is > no idle worker off the idle_list now. The comment is outdated > and can be just removed. > > It also groups nr_workers and nr_idle together. > > Signed-off-by: Lai

Re: [PATCH] workqueue: fix the comments of nr_idle

2018-03-20 Thread Tejun Heo
On Tue, Mar 20, 2018 at 05:24:05PM +0800, Lai Jiangshan wrote: > Since the worker rebinding behavior was refactored, there is > no idle worker off the idle_list now. The comment is outdated > and can be just removed. > > It also groups nr_workers and nr_idle together. > > Signed-off-by: Lai

Re: [PATCH] workqueue: remove the comment about the old manager_arb mutex

2018-03-20 Thread Tejun Heo
On Tue, Mar 20, 2018 at 05:24:32PM +0800, Lai Jiangshan wrote: > The manager_arb mutex doesn't exist any more. > > Signed-off-by: Lai Jiangshan Applied to wq/for-4.17. Thanks. -- tejun

Re: [PATCH] workqueue: remove the comment about the old manager_arb mutex

2018-03-20 Thread Tejun Heo
On Tue, Mar 20, 2018 at 05:24:32PM +0800, Lai Jiangshan wrote: > The manager_arb mutex doesn't exist any more. > > Signed-off-by: Lai Jiangshan Applied to wq/for-4.17. Thanks. -- tejun

[GIT PULL] cgroup fixes for v4.16-rc6

2018-03-19 Thread Tejun Heo
) Tejun Heo (2): sched, cgroup: Don't reject lower cpu.max on ancestors cgroup: fix rule checking for threaded mode switching kernel/cgroup/cgroup.c | 10 ++ kernel/sched/core.c| 15 ++- 2 files changed

[GIT PULL] cgroup fixes for v4.16-rc6

2018-03-19 Thread Tejun Heo
) Tejun Heo (2): sched, cgroup: Don't reject lower cpu.max on ancestors cgroup: fix rule checking for threaded mode switching kernel/cgroup/cgroup.c | 10 ++ kernel/sched/core.c| 15 ++- 2 files changed

Re: [PATCH v5 1/2] cpuset: Enable cpuset controller in default hierarchy

2018-03-19 Thread Tejun Heo
Hello, Waiman. This looks great. A couple nitpicks below. > + 5-3. Cpuset > + 5.3-1. Cpuset Interface Files Can we put cpuset below pid? It feels weird to break up cpu, memory and io as they represent the three major resources and are in a similar fashion. > +

Re: [PATCH v5 1/2] cpuset: Enable cpuset controller in default hierarchy

2018-03-19 Thread Tejun Heo
Hello, Waiman. This looks great. A couple nitpicks below. > + 5-3. Cpuset > + 5.3-1. Cpuset Interface Files Can we put cpuset below pid? It feels weird to break up cpu, memory and io as they represent the three major resources and are in a similar fashion. > +

[GIT PULL] workqueue fixes for v4.16-rc6

2018-03-19 Thread Tejun Heo
Hello, Linus. Two low-impact workqueue commits. One fixes workqueue creation error path and the other removes the unused cancel_work(). The following changes since commit fc6eabbbf8ef99efed778dd5afabc83c21dba585: Merge tag 'nfs-for-4.16-4' of

[GIT PULL] workqueue fixes for v4.16-rc6

2018-03-19 Thread Tejun Heo
Hello, Linus. Two low-impact workqueue commits. One fixes workqueue creation error path and the other removes the unused cancel_work(). The following changes since commit fc6eabbbf8ef99efed778dd5afabc83c21dba585: Merge tag 'nfs-for-4.16-4' of

[GIT PULL] percpu fixes for v4.16-rc6

2018-03-19 Thread Tejun Heo
for pcpu_balance_workfn() Tejun Heo (3): percpu: add Dennis Zhou as a percpu co-maintainer percpu: include linux/sched.h for cond_resched() percpu_ref: Update doc to dissuade users from depending on internal RCU grace periods MAINTAINERS | 1 + include

[GIT PULL] percpu fixes for v4.16-rc6

2018-03-19 Thread Tejun Heo
for pcpu_balance_workfn() Tejun Heo (3): percpu: add Dennis Zhou as a percpu co-maintainer percpu: include linux/sched.h for cond_resched() percpu_ref: Update doc to dissuade users from depending on internal RCU grace periods MAINTAINERS | 1 + include

[GIT PULL] libata fixes for v4.16-rc6

2018-03-19 Thread Tejun Heo
Hello, Linus. I sat on them too long and it's quite a few this late, but nothing has a wide blast area. The changes are... * Fix corner cases in SG command handling. * Recent introduction of default powersaving mode config option exposed several devices with broken powersaving behaviors. A

[GIT PULL] libata fixes for v4.16-rc6

2018-03-19 Thread Tejun Heo
Hello, Linus. I sat on them too long and it's quite a few this late, but nothing has a wide blast area. The changes are... * Fix corner cases in SG command handling. * Recent introduction of default powersaving mode config option exposed several devices with broken powersaving behaviors. A

Re: [PATCH 8/8] fs/aio: Use rcu_work instead of explicit rcu and work item

2018-03-19 Thread Tejun Heo
On Wed, Mar 14, 2018 at 12:45:15PM -0700, Tejun Heo wrote: > Workqueue now has rcu_work. Use it instead of open-coding rcu -> work > item bouncing. > > Signed-off-by: Tejun Heo <t...@kernel.org> Applied 6-8 to wq/for-4.17. Thanks. -- tejun

Re: [PATCH 8/8] fs/aio: Use rcu_work instead of explicit rcu and work item

2018-03-19 Thread Tejun Heo
On Wed, Mar 14, 2018 at 12:45:15PM -0700, Tejun Heo wrote: > Workqueue now has rcu_work. Use it instead of open-coding rcu -> work > item bouncing. > > Signed-off-by: Tejun Heo Applied 6-8 to wq/for-4.17. Thanks. -- tejun

Re: [PATCH 5/8] percpu_ref: Update doc to dissuade users from depending on internal RCU grace periods

2018-03-19 Thread Tejun Heo
On Wed, Mar 14, 2018 at 12:45:12PM -0700, Tejun Heo wrote: > This patch makes it clear that the grace periods are percpu_ref's > internal implementation detail and can't be depended upon by the > users. Applied to percpu/for-4.16-fixes. Thanks. -- tejun

Re: [PATCH 5/8] percpu_ref: Update doc to dissuade users from depending on internal RCU grace periods

2018-03-19 Thread Tejun Heo
On Wed, Mar 14, 2018 at 12:45:12PM -0700, Tejun Heo wrote: > This patch makes it clear that the grace periods are percpu_ref's > internal implementation detail and can't be depended upon by the > users. Applied to percpu/for-4.16-fixes. Thanks. -- tejun

Re: [PATCH 6/8] RCU, workqueue: Implement rcu_work

2018-03-19 Thread Tejun Heo
Hello, Lai. On Fri, Mar 16, 2018 at 02:01:35PM +0800, Lai Jiangshan wrote: > > +bool flush_rcu_work(struct rcu_work *rwork) > > +{ > > + if (test_bit(WORK_STRUCT_PENDING_BIT, > > work_data_bits(>work))) { > > + rcu_barrier(); > > + flush_work(>work); > > +

Re: [PATCH 6/8] RCU, workqueue: Implement rcu_work

2018-03-19 Thread Tejun Heo
Hello, Lai. On Fri, Mar 16, 2018 at 02:01:35PM +0800, Lai Jiangshan wrote: > > +bool flush_rcu_work(struct rcu_work *rwork) > > +{ > > + if (test_bit(WORK_STRUCT_PENDING_BIT, > > work_data_bits(>work))) { > > + rcu_barrier(); > > + flush_work(>work); > > +

Re: [PATCH v2] mm: Allow to kill tasks doing pcpu_alloc() and waiting for pcpu_balance_workfn()

2018-03-19 Thread Tejun Heo
On Mon, Mar 19, 2018 at 06:32:10PM +0300, Kirill Tkhai wrote: > From: Kirill Tkhai > > In case of memory deficit and low percpu memory pages, > pcpu_balance_workfn() takes pcpu_alloc_mutex for a long > time (as it makes memory allocations itself and waits > for memory

Re: [PATCH v2] mm: Allow to kill tasks doing pcpu_alloc() and waiting for pcpu_balance_workfn()

2018-03-19 Thread Tejun Heo
On Mon, Mar 19, 2018 at 06:32:10PM +0300, Kirill Tkhai wrote: > From: Kirill Tkhai > > In case of memory deficit and low percpu memory pages, > pcpu_balance_workfn() takes pcpu_alloc_mutex for a long > time (as it makes memory allocations itself and waits > for memory reclaim). If tasks doing

Re: [PATCH v5 2/2] cpuset: Add cpuset.flags control knob to v2

2018-03-19 Thread Tejun Heo
Hello, Waiman. On Thu, Mar 15, 2018 at 05:20:42PM -0400, Waiman Long wrote: > + The currently supported flag is: > + > + sched_load_balance > + When it is not set, there will be no load balancing > + among CPUs on this cpuset. Tasks will stay in the > +

Re: [PATCH v5 2/2] cpuset: Add cpuset.flags control knob to v2

2018-03-19 Thread Tejun Heo
Hello, Waiman. On Thu, Mar 15, 2018 at 05:20:42PM -0400, Waiman Long wrote: > + The currently supported flag is: > + > + sched_load_balance > + When it is not set, there will be no load balancing > + among CPUs on this cpuset. Tasks will stay in the > +

Re: [PATCH 1/3] libata: Apply NOLPM quirk to Crucial M500 480 and 960GB SSDs

2018-03-19 Thread Tejun Heo
On Mon, Mar 19, 2018 at 04:33:58PM +0100, Hans de Goede wrote: > There have been reports of the Crucial M500 480GB model not working > with LPM set to min_power / med_power_with_dipm level. > > It has not been tested with medium_power, but that typically has no > measurable power-savings. > >

Re: [PATCH 1/3] libata: Apply NOLPM quirk to Crucial M500 480 and 960GB SSDs

2018-03-19 Thread Tejun Heo
On Mon, Mar 19, 2018 at 04:33:58PM +0100, Hans de Goede wrote: > There have been reports of the Crucial M500 480GB model not working > with LPM set to min_power / med_power_with_dipm level. > > It has not been tested with medium_power, but that typically has no > measurable power-savings. > >

Re: [PATCH v4] cpuset: Enable cpuset controller in default hierarchy

2018-03-19 Thread Tejun Heo
Hello, Mike. On Thu, Mar 15, 2018 at 03:49:01AM +0100, Mike Galbraith wrote: > Under the hood v2 details are entirely up to you. My input ends at > please don't leave dynamic partitioning standing at the dock when v2 > sails. So, this isn't about implementation details but about what the

Re: [PATCH v4] cpuset: Enable cpuset controller in default hierarchy

2018-03-19 Thread Tejun Heo
Hello, Mike. On Thu, Mar 15, 2018 at 03:49:01AM +0100, Mike Galbraith wrote: > Under the hood v2 details are entirely up to you. My input ends at > please don't leave dynamic partitioning standing at the dock when v2 > sails. So, this isn't about implementation details but about what the

Re: [PATCH] workqueue: make manage_workers() and pool destruction exclusive

2018-03-19 Thread Tejun Heo
On Mon, Mar 19, 2018 at 03:35:07PM +0800, Lai Jiangshan wrote: > The original code allows destroying the pool when the pool > is still active in manage_workers(). A synchronization > mechanism between manage_workers() and pool destruction > was added for protection. > > This patch simply makes

Re: [PATCH] workqueue: make manage_workers() and pool destruction exclusive

2018-03-19 Thread Tejun Heo
On Mon, Mar 19, 2018 at 03:35:07PM +0800, Lai Jiangshan wrote: > The original code allows destroying the pool when the pool > is still active in manage_workers(). A synchronization > mechanism between manage_workers() and pool destruction > was added for protection. > > This patch simply makes

Re: [PATCH] percpu: Allow to kill tasks doing pcpu_alloc() and waiting for pcpu_balance_workfn()

2018-03-19 Thread Tejun Heo
On Wed, Mar 14, 2018 at 01:56:31PM -0700, Andrew Morton wrote: > > + if (!is_atomic) { > > + if (gfp & __GFP_NOFAIL) > > + mutex_lock(_alloc_mutex); > > + else if (mutex_lock_killable(_alloc_mutex)) > > + return NULL; > > + } > > It

Re: [PATCH] percpu: Allow to kill tasks doing pcpu_alloc() and waiting for pcpu_balance_workfn()

2018-03-19 Thread Tejun Heo
On Wed, Mar 14, 2018 at 01:56:31PM -0700, Andrew Morton wrote: > > + if (!is_atomic) { > > + if (gfp & __GFP_NOFAIL) > > + mutex_lock(_alloc_mutex); > > + else if (mutex_lock_killable(_alloc_mutex)) > > + return NULL; > > + } > > It

Re: [PATCH] percpu: Allow to kill tasks doing pcpu_alloc() and waiting for pcpu_balance_workfn()

2018-03-19 Thread Tejun Heo
Hello, Andrew. On Wed, Mar 14, 2018 at 03:22:03PM -0700, Andrew Morton wrote: > hm. spose so. Maybe. Are there other ways? I assume the time is > being spent in pcpu_create_chunk()? We could drop the mutex while > running that stuff and take the appropriate did-we-race-with-someone > testing

Re: [PATCH] percpu: Allow to kill tasks doing pcpu_alloc() and waiting for pcpu_balance_workfn()

2018-03-19 Thread Tejun Heo
Hello, Andrew. On Wed, Mar 14, 2018 at 03:22:03PM -0700, Andrew Morton wrote: > hm. spose so. Maybe. Are there other ways? I assume the time is > being spent in pcpu_create_chunk()? We could drop the mutex while > running that stuff and take the appropriate did-we-race-with-someone > testing

Re: [PATCH v3] ata: add Amiga Gayle PATA controller driver

2018-03-19 Thread Tejun Heo
On Fri, Mar 16, 2018 at 05:15:47PM +0100, Bartlomiej Zolnierkiewicz wrote: > Add Amiga Gayle PATA controller driver. It enables libata support > for the on-board IDE interfaces on some Amiga models (A600, A1200, > A4000 and A4000T) and also for IDE interfaces on the Zorro expansion > bus (M-Tech

Re: [PATCH v3] ata: add Amiga Gayle PATA controller driver

2018-03-19 Thread Tejun Heo
On Fri, Mar 16, 2018 at 05:15:47PM +0100, Bartlomiej Zolnierkiewicz wrote: > Add Amiga Gayle PATA controller driver. It enables libata support > for the on-board IDE interfaces on some Amiga models (A600, A1200, > A4000 and A4000T) and also for IDE interfaces on the Zorro expansion > bus (M-Tech

Re: [PATCH v3] ata: add Amiga Gayle PATA controller driver

2018-03-19 Thread Tejun Heo
Hello, On Sat, Mar 17, 2018 at 10:24:18PM -0700, Philippe Ombredanne wrote: > > v2: > > - clarify license version (it should be GPL 2.0) > > - use SPDX header > > For the use of SPDX ids, you have my ack: (I am not qualified for the rest) > > Acked-by: Philippe Ombredanne

Re: [PATCH v3] ata: add Amiga Gayle PATA controller driver

2018-03-19 Thread Tejun Heo
Hello, On Sat, Mar 17, 2018 at 10:24:18PM -0700, Philippe Ombredanne wrote: > > v2: > > - clarify license version (it should be GPL 2.0) > > - use SPDX header > > For the use of SPDX ids, you have my ack: (I am not qualified for the rest) > > Acked-by: Philippe Ombredanne I don't think it's a

Re: [PATCH] percpu: Allow to kill tasks doing pcpu_alloc() and waiting for pcpu_balance_workfn()

2018-03-14 Thread Tejun Heo
Hello, Andrew. On Wed, Mar 14, 2018 at 01:56:31PM -0700, Andrew Morton wrote: > It would benefit from a comment explaining why we're doing this (it's > for the oom-killer). Will add. > My memory is weak and our documentation is awful. What does > mutex_lock_killable() actually do and how does

Re: [PATCH] percpu: Allow to kill tasks doing pcpu_alloc() and waiting for pcpu_balance_workfn()

2018-03-14 Thread Tejun Heo
Hello, Andrew. On Wed, Mar 14, 2018 at 01:56:31PM -0700, Andrew Morton wrote: > It would benefit from a comment explaining why we're doing this (it's > for the oom-killer). Will add. > My memory is weak and our documentation is awful. What does > mutex_lock_killable() actually do and how does

Re: [PATCH v4] cpuset: Enable cpuset controller in default hierarchy

2018-03-14 Thread Tejun Heo
Hello, On Sat, Mar 10, 2018 at 04:47:28AM +0100, Mike Galbraith wrote: > Some form of cpu_exclusive (preferably exactly that, but something else > could replace it) is needed to define sets that must not overlap any > other set at creation time or any time thereafter.  A set with property >

Re: [PATCH v4] cpuset: Enable cpuset controller in default hierarchy

2018-03-14 Thread Tejun Heo
Hello, On Sat, Mar 10, 2018 at 04:47:28AM +0100, Mike Galbraith wrote: > Some form of cpu_exclusive (preferably exactly that, but something else > could replace it) is needed to define sets that must not overlap any > other set at creation time or any time thereafter.  A set with property >

[PATCH 4/8] HMM: Remove superflous RCU protection around radix tree lookup

2018-03-14 Thread Tejun Heo
to confusion. Remove the RCU protection and open-code the radix tree lookup. If this needs to become more sophisticated in the future, let's add them back when necessary. Signed-off-by: Tejun Heo <t...@kernel.org> Reviewed-by: Jérôme Glisse <jgli...@redhat.com> Cc: linux...@kvack.org Cc: Li

[PATCH 4/8] HMM: Remove superflous RCU protection around radix tree lookup

2018-03-14 Thread Tejun Heo
to confusion. Remove the RCU protection and open-code the radix tree lookup. If this needs to become more sophisticated in the future, let's add them back when necessary. Signed-off-by: Tejun Heo Reviewed-by: Jérôme Glisse Cc: linux...@kvack.org Cc: Linus Torvalds --- Hello, Jérôme, how do you want

[PATCH 6/8] RCU, workqueue: Implement rcu_work

2018-03-14 Thread Tejun Heo
. Signed-off-by: Tejun Heo <t...@kernel.org> Cc: "Paul E. McKenney" <paul...@linux.vnet.ibm.com> Cc: Linus Torvalds <torva...@linux-foundation.org> --- include/linux/workqueue.h | 23 kernel/workqueue.c| 54

[PATCH 6/8] RCU, workqueue: Implement rcu_work

2018-03-14 Thread Tejun Heo
. Signed-off-by: Tejun Heo Cc: "Paul E. McKenney" Cc: Linus Torvalds --- include/linux/workqueue.h | 23 kernel/workqueue.c| 54 +++ 2 files changed, 77 insertions(+) diff --git a/include/linux/workqueue.h b/inc

[PATCH 5/8] percpu_ref: Update doc to dissuade users from depending on internal RCU grace periods

2018-03-14 Thread Tejun Heo
ear that the grace periods are percpu_ref's internal implementation detail and can't be depended upon by the users. Signed-off-by: Tejun Heo <t...@kernel.org> Cc: Kent Overstreet <kent.overstr...@gmail.com> Cc: Linus Torvalds <torva...@linux-foundation.org> --- include/linux/p

[PATCH 3/8] RDMAVT: Fix synchronization around percpu_ref

2018-03-14 Thread Tejun Heo
ess the above issues, this patch removes the fast exit and adds an explicit synchronize_rcu(). Signed-off-by: Tejun Heo <t...@kernel.org> Acked-by: Dennis Dalessandro <dennis.dalessan...@intel.com> Cc: Mike Marciniszyn <mike.marcinis...@intel.com> Cc: linux-r...@vger.kernel.org Cc:

[PATCH 5/8] percpu_ref: Update doc to dissuade users from depending on internal RCU grace periods

2018-03-14 Thread Tejun Heo
ear that the grace periods are percpu_ref's internal implementation detail and can't be depended upon by the users. Signed-off-by: Tejun Heo Cc: Kent Overstreet Cc: Linus Torvalds --- include/linux/percpu-refcount.h | 18 -- lib/percpu-refcount.c | 2 ++ 2 files changed,

[PATCH 3/8] RDMAVT: Fix synchronization around percpu_ref

2018-03-14 Thread Tejun Heo
ess the above issues, this patch removes the fast exit and adds an explicit synchronize_rcu(). Signed-off-by: Tejun Heo Acked-by: Dennis Dalessandro Cc: Mike Marciniszyn Cc: linux-r...@vger.kernel.org Cc: Linus Torvalds --- drivers/infiniband/sw/rdmavt/mr.c | 10 ++ 1 file changed, 6 inserti

[PATCH 8/8] fs/aio: Use rcu_work instead of explicit rcu and work item

2018-03-14 Thread Tejun Heo
Workqueue now has rcu_work. Use it instead of open-coding rcu -> work item bouncing. Signed-off-by: Tejun Heo <t...@kernel.org> --- Hello, If there's no objection, I'll route this together with rcu_work patch through wq/for-4.17. Thanks. fs/aio.c | 21 ++--- 1 file c

[PATCH 8/8] fs/aio: Use rcu_work instead of explicit rcu and work item

2018-03-14 Thread Tejun Heo
Workqueue now has rcu_work. Use it instead of open-coding rcu -> work item bouncing. Signed-off-by: Tejun Heo --- Hello, If there's no objection, I'll route this together with rcu_work patch through wq/for-4.17. Thanks. fs/aio.c | 21 ++--- 1 file changed, 6 inserti

[PATCH 7/8] cgroup: Use rcu_work instead of explicit rcu and work item

2018-03-14 Thread Tejun Heo
Workqueue now has rcu_work. Use it instead of open-coding rcu -> work item bouncing. Signed-off-by: Tejun Heo <t...@kernel.org> --- Hello, If there's no objection, I'll route this together with rcu_work patch through wq/for-4.17. Thanks. include/linux/cgroup-defs.h | 2 +- kern

[PATCH 7/8] cgroup: Use rcu_work instead of explicit rcu and work item

2018-03-14 Thread Tejun Heo
Workqueue now has rcu_work. Use it instead of open-coding rcu -> work item bouncing. Signed-off-by: Tejun Heo --- Hello, If there's no objection, I'll route this together with rcu_work patch through wq/for-4.17. Thanks. include/linux/cgroup-defs.h | 2 +- kernel/cgroup/cgroup.c |

[PATCH 2/8] fs/aio: Use RCU accessors for kioctx_table->table[]

2018-03-14 Thread Tejun Heo
it and access may race. Mark kioctx_table->table[] with __rcu and use the approriate RCU accessors when using the field. Signed-off-by: Tejun Heo <t...@kernel.org> Reported-by: Jann Horn <ja...@google.com> Fixes: db446a08c23d ("aio: convert the ioctx list to table lookup v3"

<    5   6   7   8   9   10   11   12   13   14   >