Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1353778ybj; Tue, 5 May 2020 18:52:35 -0700 (PDT) X-Google-Smtp-Source: APiQypKrak1h/I9tBroN2U4bON7pGDAtECwlhUdfHLXl4t9xlM1WVb1cfw45qHVHW9pKjLkTtY5r X-Received: by 2002:a17:906:edb5:: with SMTP id sa21mr5438022ejb.270.1588729955564; Tue, 05 May 2020 18:52:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588729955; cv=none; d=google.com; s=arc-20160816; b=v9Y8rFvDYQZPtr87RiIxjVcjhkRpD0pNTt/yDHbhwhqfbv/eYxMKF2+OzWTZhfOlFS 5YATCpl0z3q1fAjaM8pcVhDXWdtPX/x44F5uWveHBQVrbJ9RN8wLfgM7lZbOdIfqOLpT q9b2BmBToyW4tCG46+r49ZqxcxarS8A5Nc9UJDsT/4xf/kwD9eQCS5iBawhzx4uS6k8+ pFYZV5QTkn6og2yrim7Bs9RMp3LZcOSwU6vXEUYG18IsDE3sUaPJGu0phWNaUBqWGBsQ 3ud1Kxz3Iqr/kJt2OFauwI7naTBaGOk09JIF70I4WFPRkFeiHtkaeepokdso+RgzcNgQ oG8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=8R3gKY3AYq+lNSzQssONtFTSc+IyqRTXiKgDbkurKxc=; b=AOSZOR2CVb5nRDTAUppbs18kPaxc2C8ttq6lwQFEzf+TnGYet3JX9axy4S1Nx2uwQs RTOZGGUQX8fZRfH3lFbKOWEB1TFQ1FJX3RxvPz78lYPFfUMOjV62n6vKPHvO4Oyc1ttc 376fCDHTba6FF+r8O8IdvVt9AhKudZ30fFi+N37UzStd3uuTOAAXvQduRt6cJTSTEo79 MeLMTAIKjNBBLDGJVJEL0XViNJPC1WhOWOPGyYnWY4ikNKzxJIGWbVlWwCwJUQo761nL JRYhS6AZfiGIke83W+nqrwR1OeP6/s3cheRINKmmBDsUW8VscD9NDbWiZ7PN9evpBUud jiKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p23si278954eju.299.2020.05.05.18.52.12; Tue, 05 May 2020 18:52:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729830AbgEFBuy (ORCPT + 99 others); Tue, 5 May 2020 21:50:54 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:3851 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728069AbgEFBuy (ORCPT ); Tue, 5 May 2020 21:50:54 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 7772AED51D9EDAEEF549; Wed, 6 May 2020 09:50:52 +0800 (CST) Received: from [127.0.0.1] (10.166.215.99) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Wed, 6 May 2020 09:50:44 +0800 Subject: Re: cgroup pointed by sock is leaked on mode switch To: Tejun Heo CC: , , , "Libin (Huawei)" , , , References: <03dab6ab-0ffe-3cae-193f-a7f84e9b14c5@huawei.com> <20200505160639.GG12217@mtj.thefacebook.com> From: Yang Yingliang Message-ID: Date: Wed, 6 May 2020 09:50:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200505160639.GG12217@mtj.thefacebook.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.166.215.99] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +cc lizefan@huawei.com On 2020/5/6 0:06, Tejun Heo wrote: > Hello, Yang. > > On Sat, May 02, 2020 at 06:27:21PM +0800, Yang Yingliang wrote: >> I find the number nr_dying_descendants is increasing: >> linux-dVpNUK:~ # find /sys/fs/cgroup/ -name cgroup.stat -exec grep >> '^nr_dying_descendants [^0]'  {} + >> /sys/fs/cgroup/unified/cgroup.stat:nr_dying_descendants 80 >> /sys/fs/cgroup/unified/system.slice/cgroup.stat:nr_dying_descendants 1 >> /sys/fs/cgroup/unified/system.slice/system-hostos.slice/cgroup.stat:nr_dying_descendants >> 1 >> /sys/fs/cgroup/unified/lxc/cgroup.stat:nr_dying_descendants 79 >> /sys/fs/cgroup/unified/lxc/5f1fdb8c54fa40c3e599613dab6e4815058b76ebada8a27bc1fe80c0d4801764/cgroup.stat:nr_dying_descendants >> 78 >> /sys/fs/cgroup/unified/lxc/5f1fdb8c54fa40c3e599613dab6e4815058b76ebada8a27bc1fe80c0d4801764/system.slice/cgroup.stat:nr_dying_descendants >> 78 > Those numbers are nowhere close to causing oom issues. There are some > aspects of page and other cache draining which is being improved but unless > you're seeing numbers multiple orders of magnitude higher, this isn't the > source of your problem. > >> The situation is as same as the commit bd1060a1d671 ("sock, cgroup: add >> sock->sk_cgroup") describes. >> "On mode switch, cgroup references which are already being pointed to by >> socks may be leaked." > I'm doubtful that you're hitting that issue. Mode switching means memcg > being switched between cgroup1 and cgroup2 hierarchies, which is unlikely to > be what's happening when you're launching docker containers. > > The first step would be identifying where memory is going and finding out > whether memcg is actually being switched between cgroup1 and 2 - look at the > hierarchy number in /proc/cgroups, if that's switching between 0 and > someting not zero, it is switching. > > Thanks. >