Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1530780

Re: [PATCH 3.12 118/127] cgroup: use an ordered workqueue for cgroup destruction

From Hugh Dickins <hughd@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3.12 118/127] cgroup: use an ordered workqueue for cgroup destruction
Date 2016-11-26 22:00 +0100
Message-ID <sHSeK-35L-11@gated-at.bofh.it> (permalink)
References <sHkd3-6Ft-3@gated-at.bofh.it> <sHkd6-6Ft-105@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 25 Nov 2016, Jiri Slaby wrote:

> From: Hugh Dickins <hughd@google.com>
> 
> 3.12-stable review patch.  If anyone has any objections, please let me know.
> 
> ===============
> 
> commit ab3f5faa6255a0eb4f832675507d9e295ca7e9ba upstream.
> 
> Sometimes the cleanup after memcg hierarchy testing gets stuck in
> mem_cgroup_reparent_charges(), unable to bring non-kmem usage down to 0.
> 
> There may turn out to be several causes, but a major cause is this: the
> workitem to offline parent can get run before workitem to offline child;
> parent's mem_cgroup_reparent_charges() circles around waiting for the
> child's pages to be reparented to its lrus, but it's holding cgroup_mutex
> which prevents the child from reaching its mem_cgroup_reparent_charges().
> 
> Just use an ordered workqueue for cgroup_destroy_wq.
> 
> tj: Committing as the temporary fix until the reverse dependency can
>     be removed from memcg.  Comment updated accordingly.
> 
> Fixes: e5fca243abae ("cgroup: use a dedicated workqueue for cgroup destruction")
> Suggested-by: Filipe Brandenburger <filbranden@google.com>
> Signed-off-by: Hugh Dickins <hughd@google.com>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>

No, please drop this one.  It was indeed marked for stable at the time,
but then reverted by 1a11533fbd71792e8c5d36f6763fbce8df0d231d; and you
already have in 3.12-stable the commit which in the end we used to fix
the issue, 4fb1a86fb5e4209a7d4426d4e586c58e9edc74ac
"memcg: reparent charges of children before processing parent".

My fault for inadequate testing originally, sorry for the confusion,
Hugh

> ---
>  kernel/cgroup.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index 5d9d542c0bb5..e89f6cec01c9 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -5168,12 +5168,16 @@ static int __init cgroup_wq_init(void)
>  	/*
>  	 * There isn't much point in executing destruction path in
>  	 * parallel.  Good chunk is serialized with cgroup_mutex anyway.
> -	 * Use 1 for @max_active.
> +	 *
> +	 * XXX: Must be ordered to make sure parent is offlined after
> +	 * children.  The ordering requirement is for memcg where a
> +	 * parent's offline may wait for a child's leading to deadlock.  In
> +	 * the long term, this should be fixed from memcg side.
>  	 *
>  	 * We would prefer to do this in cgroup_init() above, but that
>  	 * is called before init_workqueues(): so leave this until after.
>  	 */
> -	cgroup_destroy_wq = alloc_workqueue("cgroup_destroy", 0, 1);
> +	cgroup_destroy_wq = alloc_ordered_workqueue("cgroup_destroy", 0);
>  	BUG_ON(!cgroup_destroy_wq);
>  	return 0;
>  }
> -- 
> 2.10.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 3.12 001/127] Revert "KVM: MIPS: Drop other CPU ASIDs on guest MMU changes" Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 045/127] UBI: fastmap: scrub PEB when bitflips are detected in a free PEB EC header Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 037/127] scsi: arcmsr: Send SYNCHRONIZE_CACHE command to firmware Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 019/127] USB: serial: fix potential NULL-dereference at probe Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 043/127] drm/exynos: fix error handling in exynos_drm_subdrv_open Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 035/127] scsi: megaraid_sas: Fix data integrity failure for JBOD (passthrough) devices Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 041/127] x86/xen: fix upper bound of pmd loop in xen_cleanhighmap() Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 039/127] drm/radeon/si_dpm: workaround for SI kickers Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 022/127] vt: clear selection before resizing Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 034/127] mac80211: discard multicast and 4-addr A-MSDUs Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 015/127] ANDROID: binder: Clear binder and cookie when setting handle in flat binder struct Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 023/127] hv: do not lose pending heartbeat vmbus packets Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 021/127] Fix potential infoleak in older kernels Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 016/127] ubifs: Abort readdir upon error Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 055/127] coredump: fix unfreezable coredumping task Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 013/127] ALSA: hda - Merge RIRB_PRE_DELAY into CTX_WORKAROUND caps Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 033/127] firewire: net: fix fragmented datagram_size off-by-one Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 030/127] virtio: console: Unlock vqs while freeing buffers Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 018/127] usb: gadget: function: u_ether: don't starve tx request queue Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 029/127] parisc: Ensure consistent state when switching to kernel stack at syscall entry Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 040/127] drm/radeon: drop register readback in cayman_cp_int_cntl_setup Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 036/127] scsi: scsi_debug: Fix memory leak if LBP enabled and module is unloaded Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 020/127] USB: serial: ftdi_sio: add support for Infineon TriBoard TC2X7 Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:10 +0100
  [PATCH 3.12 012/127] ALSA: usb-audio: Add quirk for Syntek STK1160 Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:20 +0100
  [PATCH 3.12 009/127] HID: usbhid: Add HID_QUIRK_NOGET for Aten DVI KVM switch Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:20 +0100
  [PATCH 3.12 011/127] KEYS: Fix short sprintf buffer in /proc/keys show function Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:20 +0100
  [PATCH 3.12 010/127] libxfs: clean up _calc_dquots_per_chunk Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:20 +0100
  [PATCH 3.12 005/127] HID: input: add mic mute key on HP slim keyboard Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:20 +0100
  [PATCH 3.12 008/127] UBIFS: Fix possible memory leak in ubifs_readdir() Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:20 +0100
  [PATCH 3.12 007/127] tty: Prevent ldisc drivers from re-using stale tty fields Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:20 +0100
  [PATCH 3.12 014/127] ANDROID: binder: Add strong ref checks Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:20 +0100
  [PATCH 3.12 004/127] KVM: MIPS: Precalculate MMIO load resume PC Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:20 +0100
  [PATCH 3.12 006/127] HID: microsoft: Add Surface 4 type cover pro 4 (JP) Jiri Slaby <jslaby@suse.cz> - 2016-11-25 10:20 +0100
  Re: [PATCH 3.12 118/127] cgroup: use an ordered workqueue for cgroup  destruction Hugh Dickins <hughd@google.com> - 2016-11-26 22:00 +0100
    Re: [PATCH 3.12 118/127] cgroup: use an ordered workqueue for cgroup  destruction Jiri Slaby <jslaby@suse.cz> - 2016-11-28 09:30 +0100
  Re: [PATCH 3.12 122/127] drivers/net: Disable UFO through virtio Ben Hutchings <ben@decadent.org.uk> - 2016-12-01 01:00 +0100
    Re: [PATCH 3.12 122/127] drivers/net: Disable UFO through virtio Jiri Slaby <jslaby@suse.cz> - 2016-12-01 10:10 +0100

csiph-web