Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1206199ybx; Thu, 7 Nov 2019 08:44:09 -0800 (PST) X-Google-Smtp-Source: APXvYqyQqAeKGxc0/npdxwNXAvxNyENaErAKnA0NooYc8OTEgltuyY6gIp+nSgOTXH7zRi9zPen7 X-Received: by 2002:a17:906:4a0c:: with SMTP id w12mr3979251eju.306.1573145048754; Thu, 07 Nov 2019 08:44:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1573145048; cv=pass; d=google.com; s=arc-20160816; b=gpTAJfDf7ILJKOaGNv/M+Op9+6gGNVsJL+nlwJyQjtxRPaHz7qNbIhRmfjL3ue/FmL v/q1NKRxnTZ63JpY8tv4jLtx8MXQ54GggQIa7orvUj6t56CSd7v75WZ6Fg0rxFmN3cB5 DMKo+xAhh7N0tYAvacij9NFSO1dlEjzpSa6RwsiMivW8NK52tcOb4Er8fYfp9IivBPei oedHyD34et2TgA31IuZ5hZcUAxLqe5y2ULirUvH4/+uPMO99YnYtHFTLCC1pU3r8BYPM 1T1DVPqBhKiNXkIfNoleLd72UkWDTyb6rJUqitFrtAah7mXUvAjxcWUNYxPuxqK5mMls S7Aw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature:dkim-signature; bh=MEgNoqGwl/5kCdJmC3YLZn1K5KZXcc9VcNRMI5/2KYs=; b=AxXduk3Wvxzcp58GaHJ+oKOXbkE3pdLlWx1piyj4IloTzolwexErw6Exp20tt64ctY kXCPEeNwbstoVF4mGSqIxEJ2UvYlZIjPJzvcNgOGXqwC7xnQtMxGFHSf1u7dWqN5+B8e yXF4L0NxOdLtTqEvltAETwofvZ0iJoHK7Cqj2HF3drt8jcYWKc1z6ZS53rVSRstloYnG h/Guz55Xrhejdjg8jnhtQjTFBiI9nFhBKBQOm//52EMLPK82oLUCa+xc696sKKEnnyKt CNmhAbA0JoNshF9J0U/5OVSjXj4VYBKLTqpdZsiJeFxfuQNhmbKyV2fjGoV+0FVD8BFT ZpyA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=TbWn3rPE; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector2-fb-onmicrosoft-com header.b="T01/LSst"; arc=pass (i=1 spf=pass spfdomain=fb.com dkim=pass dkdomain=fb.com dmarc=pass fromdomain=fb.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=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u9si1842844ejh.275.2019.11.07.08.43.45; Thu, 07 Nov 2019 08:44:08 -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; dkim=pass header.i=@fb.com header.s=facebook header.b=TbWn3rPE; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector2-fb-onmicrosoft-com header.b="T01/LSst"; arc=pass (i=1 spf=pass spfdomain=fb.com dkim=pass dkdomain=fb.com dmarc=pass fromdomain=fb.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=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387459AbfKGQmv (ORCPT + 99 others); Thu, 7 Nov 2019 11:42:51 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:26240 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726231AbfKGQmu (ORCPT ); Thu, 7 Nov 2019 11:42:50 -0500 Received: from pps.filterd (m0109332.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xA7GObtf013933; Thu, 7 Nov 2019 08:42:44 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=facebook; bh=MEgNoqGwl/5kCdJmC3YLZn1K5KZXcc9VcNRMI5/2KYs=; b=TbWn3rPEPi8wV+KWs8hWy7a20UUjOPLJo0tkETUN16UelpFzFXeaZSNW25ARtvLLmyLo HaTqAZZ78oDg3HsaADh2e7BlmWZ0J+R992uv0El2/rW6w1qnNAHEx0RUQJU5gxH41ZJr MpWvhA3Zvm9Fqx474Jh3ie6oWaZLr0b99tY= Received: from mail.thefacebook.com (mailout.thefacebook.com [199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2w41u0p2pr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 07 Nov 2019 08:42:44 -0800 Received: from prn-hub06.TheFacebook.com (2620:10d:c081:35::130) by prn-hub03.TheFacebook.com (2620:10d:c081:35::127) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.1713.5; Thu, 7 Nov 2019 08:42:43 -0800 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.1713.5 via Frontend Transport; Thu, 7 Nov 2019 08:42:43 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A+s6QXWkvkPSaYX2YahVbtcFJjIZ45hf1J8wKODT2iK/8vCNhoNrXVrJr7B+Uc2uu3HCqU4669kJ4jQzWh6anslxhr8E859kV+L9hRu1H6ZTclAA3b46rUTDHg8iFMXPxQ2N7CfDsXTOOB0bjfQ9IzWPgb5iWMDIfZifqOlXrWhnAgjRvgW+0qWewUDu+XONgk25zO7GjqS8TqV1DMel8M/MV33ssDqYVS0AV3ZxyJyrZoUpW7cCoV6KAftLxoU1porEAUOkcsOfeaBId2D3f92mSzD+ljYzjVOQjISAfGcbU2UoBgWOEp8nDIxYhQCfEfldjdn/ARky2Vj9QifMEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MEgNoqGwl/5kCdJmC3YLZn1K5KZXcc9VcNRMI5/2KYs=; b=bJZml34xKGwJIYNZkTwM974fc5BI7/d3vOBeEoEqNmQeIsyFbl0PVXdB+29oPKaIwAcqmEy0EBXNJYfL3JvncWY53BsSWKCWO5ya8hKrRDFpy1yVQqfRpA2hiJNzY7ZM7oIH68xGA6glwm/CR4FRSP5ae2dXLo9RJ6lkXQDqFaPB7DeTpV0b+eAmTorC4xXdR72hgiFd7HrEHGQlCmrkkOBA6HPEJst/g9YJaDrpGOzfHBCIgObMRCtoIQyNcZ0TmKc1RyCiqQuucUZn/c7wSehv/1Efn5Vi+AkVmhSTBj6niE7OAvjDrRjTTJhiWTD0oJPv1I1ySp2QFjE7+NzSfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fb.com; dmarc=pass action=none header.from=fb.com; dkim=pass header.d=fb.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector2-fb-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MEgNoqGwl/5kCdJmC3YLZn1K5KZXcc9VcNRMI5/2KYs=; b=T01/LSstuBG7YaHfEm+zCa1HOwdcgYwey12Zthg54q++kwP732rVX7BWQwPrRG+fWVpOfslPvFHq7S+pXQhyk0E+Jw7JsspzXPUta7ybyv2J2GkhUNyCXlDtncn6S9fTx8Of1anpkNZcjOxV9zI4fcM1/W/Pj+dW4Jin0ngZ+2c= Received: from BN8PR15MB2626.namprd15.prod.outlook.com (20.179.137.220) by BN8PR15MB2530.namprd15.prod.outlook.com (20.179.139.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.24; Thu, 7 Nov 2019 16:42:41 +0000 Received: from BN8PR15MB2626.namprd15.prod.outlook.com ([fe80::3056:945b:e60e:e2e0]) by BN8PR15MB2626.namprd15.prod.outlook.com ([fe80::3056:945b:e60e:e2e0%6]) with mapi id 15.20.2430.023; Thu, 7 Nov 2019 16:42:41 +0000 From: Roman Gushchin To: Michal Hocko CC: "linux-mm@kvack.org" , Andrew Morton , Johannes Weiner , "linux-kernel@vger.kernel.org" , Kernel Team , "stable@vger.kernel.org" , Tejun Heo Subject: Re: [PATCH 1/2] mm: memcg: switch to css_tryget() in get_mem_cgroup_from_mm() Thread-Topic: [PATCH 1/2] mm: memcg: switch to css_tryget() in get_mem_cgroup_from_mm() Thread-Index: AQHVlPTSqR6tDyqEq0WgIBYYtGCX/Kd/odWAgABI+QA= Date: Thu, 7 Nov 2019 16:42:41 +0000 Message-ID: <20191107164236.GB2919@castle.dhcp.thefacebook.com> References: <20191106225131.3543616-1-guro@fb.com> <20191107122125.GS8314@dhcp22.suse.cz> In-Reply-To: <20191107122125.GS8314@dhcp22.suse.cz> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MWHPR19CA0052.namprd19.prod.outlook.com (2603:10b6:300:94::14) To BN8PR15MB2626.namprd15.prod.outlook.com (2603:10b6:408:c7::28) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [2620:10d:c090:180::8c0f] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1c2c3c63-afaf-4c40-4e24-08d763a181cc x-ms-traffictypediagnostic: BN8PR15MB2530: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 0214EB3F68 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(366004)(396003)(39860400002)(136003)(346002)(199004)(189003)(7736002)(6436002)(1076003)(305945005)(102836004)(446003)(76176011)(52116002)(386003)(6506007)(11346002)(316002)(476003)(486006)(6916009)(46003)(54906003)(2906002)(5660300002)(71190400001)(33656002)(186003)(8936002)(71200400001)(6116002)(8676002)(86362001)(81166006)(81156014)(256004)(4326008)(99286004)(478600001)(229853002)(25786009)(66476007)(66446008)(64756008)(66556008)(66946007)(9686003)(6512007)(14454004)(6246003)(6486002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN8PR15MB2530;H:BN8PR15MB2626.namprd15.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: fb.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uMeCPa5DEQyGkPifPfwHTSO1RNmjn6BYhUhMaR4FZNKtAuo0BKP/ddRyOf6KGTjKccOnbl90FC9jQkYTT3hM3j5AypaypynrPjWZOOFGtVoFUES2VYbWirr1jZV69/P8sSBKkoL0sTsh5odKdwyZ/XCmqI1DQpVXMVEYJgpjE3GUzRL+gxHOaCVh9l3r8qhph1k0X+giAdd3/F4DH1HhPxdMHH0ZKN3p/RaI8puqIXp4xCV8GrHJRVZY85/23T5Q4OJwZH2IfrDB8PYSVODnALBubGXBD5V1QGUcMgmXY0Pi8fGsVsyG6A7mLY4HvMwdXD7jYEZ1FNxqB/W3NXbYvM3YdAnYApA5O7C2wys51SBwZTT0bvVfrLd7iqaXbbsKX8WYnt0GvZ4admrwceDKRA1O4qtY133ZX6egujocsAnpyszaNlyvELppWeB7/Pwo Content-Type: text/plain; charset="us-ascii" Content-ID: <409B6DC1851DFF4BACC2C54170799C66@namprd15.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 1c2c3c63-afaf-4c40-4e24-08d763a181cc X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Nov 2019 16:42:41.6258 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jpEZ9YQN9tvfkt839Cay2p49joNFIheOvthAQZGYLRucYME4FGvXFMX6bieSojn7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR15MB2530 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-07_05:2019-11-07,2019-11-07 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 malwarescore=0 suspectscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 adultscore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 impostorscore=0 mlxlogscore=655 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911070156 X-FB-Internal: deliver Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 07, 2019 at 01:21:25PM +0100, Michal Hocko wrote: > On Wed 06-11-19 14:51:30, Roman Gushchin wrote: > > We've encountered a rcu stall in get_mem_cgroup_from_mm(): > >=20 > > rcu: INFO: rcu_sched self-detected stall on CPU > > rcu: 33-....: (21000 ticks this GP) idle=3D6c6/1/0x4000000000000002 so= ftirq=3D35441/35441 fqs=3D5017 > > (t=3D21031 jiffies g=3D324821 q=3D95837) 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 > >=20 > > The problem is caused by an exiting task which is associated with > > an offline memcg. >=20 > 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? It's an exiting task with the PF_EXITING flag set and it's in their late st= ages of life.