Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1009410ybt; Fri, 19 Jun 2020 21:29:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrLsRO28awa7nmX1OgS36XHNfZy1EvqlsAWdZTI/jVIGHiYHfIJxGJ3eLy2GOOcX/619WH X-Received: by 2002:a17:906:1917:: with SMTP id a23mr6429100eje.181.1592627381154; Fri, 19 Jun 2020 21:29:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1592627381; cv=pass; d=google.com; s=arc-20160816; b=IExWcP8P82HPZqc+DNS0HsLTgmXAAq4kjZQfwTFJoEkqBh6FKGBb7pES+m2uxHngB0 vSx4nzRO4KyU0t2Kb6/K/KlZsXMRW2Op59E0CshYyNo6SF9iVXQZzzKp7rYvhZlRcE9W HrCctT9CG0xs5rLewukMb8QxNtQ0UjlCiK23Vye7R40mB17998EuPJUGlW8tqyb7xknz ZLCCLJSd5zUYQsdKWuCVX852/p9eCOQRn6qOKWJbMzcbB4jyGOgT/Mt9hOy6OMcnJ8kW ndMhF98hIVPOd7hB9gU72zU3776SIk7OAAVE6UAWijLGlSOt7IlVMijd8jPQiHQnuVCM O/BA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:in-reply-to :content-disposition:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=FbbnuNSVSeQv5Zog60zOpO1O537NGfRHgDR1t3p4GNo=; b=Y1oz2RQSCOTYLbMVp+WGKpdbtVxJJXPhbb3NL0/WtrXH9d6p/ONEO/3kTwMzU9SC4o v2SbNaG9gwqlJNKWDtKfQMnnmpzy1ARsptLJYdpomi1BFlpw5B8vXJL9srgQxrRy37d/ Ylw4eV+eznMtyDQWAtgSn6nKWXUtbpXTf8at21MND/mmUH8I/C+2zoruTwZ7IOzy5OXo LqBeJtY6wBh5iaBz9y4VSZ+IEvBTGYcgvLDs31avxQqgVl/ly9K2g+dzVEUDU0EUksCM zSX+9rVAf8n/c6jo0n4vu00EJ8WMNUtavcEHQHddXgL3hZYgKL7naaM+FUklQByu04Xv 158g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b="qY/+QDqI"; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector2-fb-onmicrosoft-com header.b=BbJxMEVA; arc=pass (i=1 spf=pass spfdomain=fb.com dkim=pass dkdomain=fb.com dmarc=pass fromdomain=fb.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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp9si6664378ejc.698.2020.06.19.21.29.19; Fri, 19 Jun 2020 21:29:41 -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; dkim=pass header.i=@fb.com header.s=facebook header.b="qY/+QDqI"; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector2-fb-onmicrosoft-com header.b=BbJxMEVA; arc=pass (i=1 spf=pass spfdomain=fb.com dkim=pass dkdomain=fb.com dmarc=pass fromdomain=fb.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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390523AbgFSSsA (ORCPT + 99 others); Fri, 19 Jun 2020 14:48:00 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:4048 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387933AbgFSSr7 (ORCPT ); Fri, 19 Jun 2020 14:47:59 -0400 Received: from pps.filterd (m0148461.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05JIXR2V029357; Fri, 19 Jun 2020 11:47:43 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=facebook; bh=FbbnuNSVSeQv5Zog60zOpO1O537NGfRHgDR1t3p4GNo=; b=qY/+QDqItksJYXgRMT8rt58jhkJ/PF7W7vfAr8axpxY+ilDwieAY8Ghq/tcLdebmEl7j 0L/Vud+Z/akS86zXXs8AGzmWFkNOwZs96BiCb+bEzfrFw3rwsY0E0wMf28SPRLi8+YML ATX1vNXU7ubjtSVEhxO7SpV744zJndIsVFU= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 31s2rcr2mx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 19 Jun 2020 11:47:43 -0700 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (100.104.31.183) by o365-in.thefacebook.com (100.104.35.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 19 Jun 2020 11:47:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZCUeZJ3karnFIjHNalkS7diaFlRx9+ZBrwesG83WVvBAtZF5HG5IbTbhXSFpTt0KSPOne5GqxGq5E/697DeNoqR2au2kZCFPYG1bKAJvEABfPKipI7/AOnDDWluz/HkjTFQZdYAbGYTfQXrGPlE8bUh1r0OWMi9AH0oDf815H2L5wSjUxyVQ+8/APlJgaTJDn+/EVnqFsg7igDJPNUTsHVZ3qQG8fVBtZAfNHHFxCEQS6RuRIZOk7FS/iCKwe/mywzmI5S7WtxV1BN6zr/IERFU/HBGyRaOm22uyyxXU7f3K49bdpQ0KPPL27UnsbLYZcg72uDoq0h/GyQvbbLi2wA== 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=FbbnuNSVSeQv5Zog60zOpO1O537NGfRHgDR1t3p4GNo=; b=MKocr+m9MZYB1aUXfMKFwv9r2vGQbsBuUjwPTVkHfu0cCxhlSBrSuYRkb8VFbmbweOE+n1gxSKgODdHduZXB3BmqJW4pKWwgb1Z4vduhiXzVUaK6VEW0hekIsFbMLYviL6sCYztWonsX1u5sT2dS9aiBYcCrYaH/gyYdNKv4is7dDi+ptZpBYUZ18W+T6IYXgwAj1bKliVLBUzcoAbvHCvjd6cTfffafR3+n41Y8oRZmSdRPl1l+hoheDKFhjQqXvuivlV7uKoB915IdB3+OfGz3wretL1kjKyFGfz9p5igF2zc+6G/nvjnmbdghPDOreen2xY7aEVPZqkIqdMz0QQ== 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=FbbnuNSVSeQv5Zog60zOpO1O537NGfRHgDR1t3p4GNo=; b=BbJxMEVAc5Bv2lCj1d0iRwVkbGaB3ZsMOwZf658LeP32Q7Wp35A3woCGTqJNAvjVUEnlEcf2dEGHd/FLewuuZCV/madyOb52d+24mBImMF2JZ16sEvlSd2W5X66BPhHAE0t5v/04LURGfv3eBI5AoMOa8yfKKaqscNBDL1JHu8A= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=fb.com; Received: from BYAPR15MB4136.namprd15.prod.outlook.com (2603:10b6:a03:96::24) by BYAPR15MB3285.namprd15.prod.outlook.com (2603:10b6:a03:103::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.24; Fri, 19 Jun 2020 18:47:40 +0000 Received: from BYAPR15MB4136.namprd15.prod.outlook.com ([fe80::48e3:c159:703d:a2f1]) by BYAPR15MB4136.namprd15.prod.outlook.com ([fe80::48e3:c159:703d:a2f1%5]) with mapi id 15.20.3109.021; Fri, 19 Jun 2020 18:47:40 +0000 Date: Fri, 19 Jun 2020 11:47:36 -0700 From: Roman Gushchin To: Jesper Dangaard Brouer CC: Vlastimil Babka , Shakeel Butt , Andrew Morton , Christoph Lameter , Johannes Weiner , Michal Hocko , Linux MM , Kernel Team , LKML , Mel Gorman , Larry Woodman Subject: Re: [PATCH v6 00/19] The new cgroup slab memory controller Message-ID: <20200619184736.GA217189@carbon.lan> References: <20200608230654.828134-1-guro@fb.com> <20200617024147.GA10812@carbon.lan> <20200617033217.GE10812@carbon.lan> <20200618012928.GD24694@carbon.DHCP.thefacebook.com> <20200618104344.6a96ac04@carbon> <20200619012712.GD135965@carbon.dhcp.thefacebook.com> <20200619113945.15ff3b15@carbon> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200619113945.15ff3b15@carbon> X-ClientProxiedBy: BYAPR07CA0057.namprd07.prod.outlook.com (2603:10b6:a03:60::34) To BYAPR15MB4136.namprd15.prod.outlook.com (2603:10b6:a03:96::24) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from carbon.lan (2620:10d:c090:400::5:c16d) by BYAPR07CA0057.namprd07.prod.outlook.com (2603:10b6:a03:60::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Fri, 19 Jun 2020 18:47:39 +0000 X-Originating-IP: [2620:10d:c090:400::5:c16d] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 831970cc-516f-45e0-92e7-08d814813e2a X-MS-TrafficTypeDiagnostic: BYAPR15MB3285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-FB-Source: Internal X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0439571D1D X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vcocUw2B+fiSsUYeyd3n7V4V2cEB/sf+EAPN0Hxb5rRNsA/q1kafIhl/K6nPy/8E1kkotaJXkio4Uci49Q1oQOHc3lijGFWe+cfjUV+uwUQhhVerX475FVfOqiKTnenu429ZNrUdNdTmZQqFbqcmvYJ+WJo4N9NqG+pIMPHQJkF6fq4pzuEHAxJEsFDkkBQvsYwZbG6Vi9F2qtMVD9wfp+gY6H3TMy99pAZBoouH9eu4b1IQt0xbJCYQAIOWCZ1hLmaAQbg97bQTSehdGRKxRF3hLhyxtHuoaMhQK03eoia0HMqVrjF5cLBVBM0XomKwYpLKvPngZQg8DlPlYV7BVP2QV86E1xIos/qhCFf1PQUSwn7OdcwrVeUm002jt9Do X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR15MB4136.namprd15.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(346002)(396003)(376002)(136003)(366004)(39860400002)(6916009)(316002)(36756003)(6666004)(7416002)(5660300002)(6506007)(4326008)(54906003)(186003)(7696005)(16526019)(52116002)(8886007)(2906002)(66556008)(83380400001)(66476007)(55016002)(9686003)(8936002)(86362001)(66946007)(478600001)(33656002)(1076003)(8676002)(27376004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: j1OV765HGKYRq52kQzI2VElQVMvFaYO9bhVnh8RqtmVKVBC2l2vN1f+otN5x4T27d9Vr9U9LMzK6D/BYHT0wS+57E79BX5Fk+dXB8MyOQT/FegwJyJyTF71j5ZB1w/j3ZH98BJw0op0En+p7mF8vxZz29FgXFECL+2zl0UWbaMNwMDssAa90+U2U5vTzOEH3pSyCVfu1RyqOgWeI7SDiU8yYteZuTOJYRnW1nn8ku1GXQzRPCJSSA8qcYPNQvxlgOrhVozoESzyVtgSbfussfCruESGB1HsVoSM9PLT+TqQiFFoA3CDGvSnYhThBFteME573kpu4zzKvHm/ZWwYZYDmWZXWSP7Wq713TCdyoGUAVKyW8tx9QhBySkxIR+X79EbzukIhRzIr77+mylisTzRvpyAyWDEYjtIMoSsHTnGtlk1rvah98xIpl3Cs4EwwDDG7yJq+uTap/qhCxnN2frHoV2DlZV1WXgJOMedY0H/zsPbUocXR2cfXU2bgHCyDMrZZZHWZHqYM1oeh7soy3nQ== X-MS-Exchange-CrossTenant-Network-Message-Id: 831970cc-516f-45e0-92e7-08d814813e2a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2020 18:47:40.1754 (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: GV9De2/DLNgNO92z+Bue58pPnNfz+jE8k4OWm0dpCOQMm9DFDfu39RmmbuqKO2Fy X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR15MB3285 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.687 definitions=2020-06-19_20:2020-06-19,2020-06-19 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 suspectscore=1 bulkscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 cotscore=-2147483648 priorityscore=1501 clxscore=1011 adultscore=0 spamscore=0 mlxlogscore=818 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006190135 X-FB-Internal: deliver Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 19, 2020 at 11:39:45AM +0200, Jesper Dangaard Brouer wrote: > On Thu, 18 Jun 2020 18:27:12 -0700 > Roman Gushchin wrote: > > > Theoretically speaking it should get worse (especially for non-root allocations), > > but if the difference is not big, it still should be better, because there is > > a big expected win from memory savings/smaller working set/less fragmentation etc. > > > > The only thing I'm slightly worried is what's the effect on root allocations > > if we're sharing slab caches between root- and non-root allocations. Because if > > someone depends so much on the allocation speed, memcg-based accounting can be > > ignored anyway. For most users the cost of allocation is negligible. > > That's why the patch which merges root- and memcg slab caches is put on top > > and can be reverted if somebody will complain. > > In general I like this work for saving memory, but you also have to be > aware of the negative consequences of sharing slab caches. At Red Hat > we have experienced very hard to find kernel bugs, that point to memory > corruption at a completely wrong kernel code, because other kernel code > were corrupting the shared slab cache. (Hint a workaround is to enable > SLUB debugging to disable this sharing). I agree, but it must be related to the sharing of slab pages between different types of objects. We've also disabled cache sharing many times in order to compare slab usages between different major kernel version or to debug memory corruptions. But what about sharing between multiple cgroups, it just brings CONFIG_MEMCG_KMEM memory layout back to the !CONFIG_MEMCG_KMEM. I doubt that anyone ever considered the kernel memory accounting as a debugging mechanism. Quite opposite, we've encountered a lot of tricky issues related to the dynamic creation and destruction of kmem_caches and their life-time. Removing this code should make things simpler and hopefully more reliable. Thanks!