Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp902728ybx; Thu, 7 Nov 2019 04:25:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwWwWYj3mAR6E94c9I16sMGikg/Z/dwx5I/sbZ/XowCUt/CcwK222FOrBvEohwFwN/fagxe X-Received: by 2002:a05:6402:13cd:: with SMTP id a13mr3220823edx.57.1573129533626; Thu, 07 Nov 2019 04:25:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573129533; cv=none; d=google.com; s=arc-20160816; b=bVE70f30HwwJlTyffuSgoOfgOrCmpSWTKL6lrm3f8foC7UNlSjGL4UpxUO4STyjsFW 3qpMY6hcO7DJCmbvuqxzxQlWxLagR8EgAG0TmgF+MRgdKLeRNYgMps6b4kdRm3JT0rJs RlZuoFdjCvXEhA8iu2tpRXk2Rvh52KA0ZF8wi2cY6DaPjW1JGgkP3M2qRa7wuRVRhbKC vPWyEWZ+mYCt2sBjwwwqcNL755RNQq+2Bh7IMJ1s/Lkd2KUct+duCetyBuLrI4Ip8CVd l2hKkJhZhRe6wrujISCLPoyji0ZYv/57yYRRh40gEu2z3qAsqbqopKKNXOglMIg60Pw9 F+7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fA6RSMMGSAlFybanaAplqGLuTbFnNnVcOMD2f8/ZImI=; b=C18JAq4R6lZXTVRM2rAlWwEjQ3kHyOBQMpGGYROqko9OvGU9yh16X2TmAZGISJZRAi YZhqVJo+BPPQezV9IMuIbc5tI2mJ8zvCWgH4w9eS0aPwebmesgcX9L5Vqq5oWFCN7pET clPbN8HavUO1PXer/9jDmE7tvrFvu8jXOcagMKMBm+EbDX4q4OjO4741UAVxbA95Ehyr wS5cxQmy0po1wTZmNyGJDCphoFFjC109Bk8UixURljQOhEXV09nqvk4EZZd/Z+GJFx2L 8LrNDURKmOHlSnaACSIYZdLJs6JLWJRS4RxDcmd4e5l39XeccqiT0dgeu7vkKUQNvErQ ZZhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w56si1294360eda.376.2019.11.07.04.25.10; Thu, 07 Nov 2019 04:25:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388612AbfKGMV3 (ORCPT + 99 others); Thu, 7 Nov 2019 07:21:29 -0500 Received: from mx2.suse.de ([195.135.220.15]:36880 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388407AbfKGMV1 (ORCPT ); Thu, 7 Nov 2019 07:21:27 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 21757B24A; Thu, 7 Nov 2019 12:21:26 +0000 (UTC) Date: Thu, 7 Nov 2019 13:21:25 +0100 From: Michal Hocko To: Roman Gushchin Cc: linux-mm@kvack.org, Andrew Morton , Johannes Weiner , linux-kernel@vger.kernel.org, kernel-team@fb.com, stable@vger.kernel.org, Tejun Heo Subject: Re: [PATCH 1/2] mm: memcg: switch to css_tryget() in get_mem_cgroup_from_mm() Message-ID: <20191107122125.GS8314@dhcp22.suse.cz> References: <20191106225131.3543616-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191106225131.3543616-1-guro@fb.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 06-11-19 14:51:30, Roman Gushchin wrote: > We've encountered a rcu stall in get_mem_cgroup_from_mm(): > > rcu: INFO: rcu_sched self-detected stall on CPU > rcu: 33-....: (21000 ticks this GP) idle=6c6/1/0x4000000000000002 softirq=35441/35441 fqs=5017 > (t=21031 jiffies g=324821 q=95837) NMI backtrace for cpu 33 > <...> > RIP: 0010:get_mem_cgroup_from_mm+0x2f/0x90 > <...> > __memcg_kmem_charge+0x55/0x140 > __alloc_pages_nodemask+0x267/0x320 > pipe_write+0x1ad/0x400 > new_sync_write+0x127/0x1c0 > __kernel_write+0x4f/0xf0 > dump_emit+0x91/0xc0 > writenote+0xa0/0xc0 > elf_core_dump+0x11af/0x1430 > do_coredump+0xc65/0xee0 > ? unix_stream_sendmsg+0x37d/0x3b0 > get_signal+0x132/0x7c0 > do_signal+0x36/0x640 > ? recalc_sigpending+0x17/0x50 > exit_to_usermode_loop+0x61/0xd0 > do_syscall_64+0xd4/0x100 > entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > The problem is caused by an exiting task which is associated with > an offline memcg. Hmm, how can we have a task in an offline memcg? I thought that any existing task will prevent cgroup removal from proceeding. Is this some sort of race where the task managed to disassociate from the cgroup while there is still a binding to a memcg existing? What am I missing? -- Michal Hocko SUSE Labs