Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp103844ybm; Tue, 26 May 2020 11:53:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/Lfb2fFEI5Wr5wRkYNP3EUfjOu7E3shrh6TzMwLhDBPNSeNMZFhUl9GUY7SnK+2GoehqM X-Received: by 2002:aa7:ca13:: with SMTP id y19mr20613480eds.30.1590519198005; Tue, 26 May 2020 11:53:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1590519197; cv=pass; d=google.com; s=arc-20160816; b=wST3pkD81f17Sym+vidY02Qwg0yFA5m9mLEj8+B6M2dJeJlcL9yHdcdot+wGz0H9S9 c90ApXmqDpJyDkbsvZGp9T6x+ttP5Jptd6XcY4pYOFW5na8rvZnjCyXHKifSH7MED+uF WjVVcwDlTZaa27v5d9IPdOc4WKiUy14jgWVaXdspwRmTOTWdsZJlDEMwDrvyuSLGBVeN 9qLE6gXFc9HLpzjhzqyJDo9EUsvYhzysGZxvDaRx119GEotwYxtgKfd15CSyVj/hfTMP SCNgKIdcaoOBX+IKS2AVpSzTrxLas+Gu3C9QfEW5YUFqNQk4g4SmwJriDSQRBozbjbKT PK5g== 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=1m7Bbv9tsZFiL51h2P8yYBH9DBbgwbQTAl3ElngHTRo=; b=P+cz/kThkb5xk8J163PfFeTVx4TPWPEbzjKCVdRr6sUqxDBonKMJ+pXd144NBfvKXL YRO8Gysr4V18ChHFOVkPgrtIokG28qVtuxABXjWO1fkmjOVRB8Pwy4JT0XnFiO08XC8l ccGsGbcoCnm4JRPFg9NSrQMtZozS6Fkroh319P/KEpFjQVCWy+aEFJeFNvWgzrs0uGQR XmO+kYvE9YoUMtUuuS/QNw1Jx0jHCFv+Tg9onUjC2rLorZisekBTJQN1zF5c/Cpne76e a0q8nJbMGZ5RWqJ+LTQGG3LKh9zJMGaththlJ/MLRHtaNkuogVKuzw0isCCRCt66aXV3 UcCw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=Wb1IEIDg; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector2-fb-onmicrosoft-com header.b=dFpyAF5z; 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=QUARANTINE sp=QUARANTINE 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 c12si377388edr.580.2020.05.26.11.52.53; Tue, 26 May 2020 11:53:17 -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=Wb1IEIDg; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector2-fb-onmicrosoft-com header.b=dFpyAF5z; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388957AbgEZSut (ORCPT + 99 others); Tue, 26 May 2020 14:50:49 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:54270 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388499AbgEZSus (ORCPT ); Tue, 26 May 2020 14:50:48 -0400 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04QIjNF8027385; Tue, 26 May 2020 11:50:41 -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=1m7Bbv9tsZFiL51h2P8yYBH9DBbgwbQTAl3ElngHTRo=; b=Wb1IEIDgtXaxZBO2wgOZtKQ8CBqAYxD75fI9cdzvkWIGwPkmgY/BQTHkbxE14gHoXgFX Dd1LFec8IEVoPIkv8WHNiYKMbMXAzqcet3LHIV1zhmnOQXeHBJnjEVwpKpEaOOMFAPpX krFjVH6YAS38D+hDEiQ+vKP9PsywJHGHcGw= Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com with ESMTP id 317kp3mugp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 26 May 2020 11:50:40 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (100.104.98.9) by o365-in.thefacebook.com (100.104.94.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 26 May 2020 11:50:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QxkuJsI9lXlL/aRE0JB4MVrqe6XC2PH2qvnW40i1jD2BU593MZrEE7vjwRGUiAA2xA01e553cju3YOvhmd0CzjDM9sNjDE/ztjNsncpDKtJ0bWK0jWh1VpjDfB2M6O7lOZbEgKkshuspON+9H45Kdt+7O+rTqXtzxfu59AgrJiefwMk9Jx1uvEI4uG73K+xTITnkh7CfDAmA9e6liEqOS44WOlAtxvbUYO3R3ONJMDPBTpxUntEgAk4D5eqSzC3v7bDrq6zypK8F2xPNm6knq+LrYLOlXvMLiIHOGqP+jxCxE2/jGe2KKdIyYHvRYSFsCqltqEo0NNqH77sxLVhZ5w== 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=1m7Bbv9tsZFiL51h2P8yYBH9DBbgwbQTAl3ElngHTRo=; b=AXnJFMTKuC3A14MD/OeIcfIqSbB8pHHy2AOIBadtRphdHZCfaGktbILk6B6aT00Smf7pG/BrZc/uz3lZJkzO2IxfGWCpWqeQgD9K3nga2qTCMhZ2bFCEnHq1wmx8fn4p+Ldzi2oTqObI40IbUYOEiqhYIs42mPzMko6An+YYuLn0mW4/f8W1pWUcXDRBeZnOAhUKlSvLavgcvu6BnLyQmw4fCpui6vSXHEWoadlorqwt3EyhbA4NZK0clpM0QA6+nmajgB3FLi5C0fDHd+TJafDNatfRcQWGQmgoCXncmMb4kBImZg3u40RqON79Eyz276PtV/35SRyoJKjwmJyIyg== 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=1m7Bbv9tsZFiL51h2P8yYBH9DBbgwbQTAl3ElngHTRo=; b=dFpyAF5zmx7hFr2/jbs5Hpd5wZpbCrie7AUb+v3QpEMLZTa4AXwCr8aENyrLAJEZNUpscR5A0ZSpZcMBN0dokqOUYimxv3/MjlKm9VrCHjaVdtgFzSbq9/CgY+INUkCV5NsiKzJnEj5NZP6H3ylmqJuCEP8NbQJKobNc7knaBMI= Authentication-Results: suse.cz; dkim=none (message not signed) header.d=none;suse.cz; dmarc=none action=none header.from=fb.com; Received: from SN6PR1501MB4141.namprd15.prod.outlook.com (2603:10b6:805:e3::14) by SN6PR1501MB2175.namprd15.prod.outlook.com (2603:10b6:805:d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17; Tue, 26 May 2020 18:50:37 +0000 Received: from SN6PR1501MB4141.namprd15.prod.outlook.com ([fe80::3046:2fa:5da3:73be]) by SN6PR1501MB4141.namprd15.prod.outlook.com ([fe80::3046:2fa:5da3:73be%7]) with mapi id 15.20.3021.029; Tue, 26 May 2020 18:50:37 +0000 Date: Tue, 26 May 2020 11:50:27 -0700 From: Roman Gushchin To: Vlastimil Babka CC: Andrew Morton , Johannes Weiner , Michal Hocko , , , Subject: Re: [PATCH v3 15/19] mm: memcg/slab: deprecate slab_root_caches Message-ID: <20200526185027.GD377498@carbon.DHCP.thefacebook.com> References: <20200422204708.2176080-1-guro@fb.com> <20200422204708.2176080-16-guro@fb.com> <613dda66-4fa6-1820-50c4-c7b28235e687@suse.cz> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <613dda66-4fa6-1820-50c4-c7b28235e687@suse.cz> X-ClientProxiedBy: BY3PR05CA0027.namprd05.prod.outlook.com (2603:10b6:a03:254::32) To SN6PR1501MB4141.namprd15.prod.outlook.com (2603:10b6:805:e3::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from carbon.DHCP.thefacebook.com (2620:10d:c090:400::5:fbe3) by BY3PR05CA0027.namprd05.prod.outlook.com (2603:10b6:a03:254::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.8 via Frontend Transport; Tue, 26 May 2020 18:50:36 +0000 X-Originating-IP: [2620:10d:c090:400::5:fbe3] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1f453e38-15cc-428a-9f47-08d801a5adcd X-MS-TrafficTypeDiagnostic: SN6PR1501MB2175: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-FB-Source: Internal X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-Forefront-PRVS: 041517DFAB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2MMWV6FU8AGSkFDXhCi0trkULPbiK4+WjFpiwGimOwabTsRbIEYHfbpigg9a5o8uL6H3Mr1HC+gqGwCzu6rqi2LKsQhstQLGa8de/uIMDIPiEdWFhNt4tWPiZgroi/9Bx7PSG2XnQ62DCjr1YG8rFaqF3WigkHFd+llMaPigZg2kjMyMhtN2TPo4G9xtYsAr1Wy5BlsaWwXKE3Lq02pUmJP98XJKd21rN4hAmKbQyS5EA8aqB+6X93l7X6TwslDLGxjEiieN2PxdRVPPBBgJTM2FrATZGPe4lUIFQcViVNlhUlf78+EmcHaUkhJrnGwk X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR1501MB4141.namprd15.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(346002)(396003)(366004)(136003)(376002)(39860400002)(6916009)(6666004)(86362001)(2906002)(316002)(53546011)(7696005)(52116002)(5660300002)(186003)(16526019)(54906003)(66476007)(66556008)(478600001)(66946007)(8936002)(9686003)(4326008)(1076003)(8676002)(33656002)(6506007)(55016002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: KEZns79DQf2qCq3d5Kdu9LcRONNKaVaRLW+uPn1uKWKHxHaH4iAsj3nnHMLDs9Zokhms6ICIBOkrFXDcqCGo4jI2b0+xfa4QRVzbVCQc5vVWk+rfvBSAgoNtxaBmaEUeYMVYMDHBKLyFxowKL5VTQC0BSGXHBW6Rokb83jlUTkddJDCFpGoGK4dOGsnm0KfzyIUxQODzKO/UPlz9hla3C38zajiD11icX0s63kxW6Ui4eKxXlNWb84SraCxcVulks8bdFYuSLYQPLiCfmseXkfJn0vTYNCmleAKJmfVL5ptlvz9CySLL/KchXQ+yndJv6uC+UNWCpFF6Enc52QakSggxZfudJaw9h9yK0Q6Nuwqd/CZZJ8zMcBgWtzKbI//04AgMSenriJ8A7xXh8sQONYmAewjB09oIOjGcYqPH5aEVC4265/pRKVW4PUEQngRXjWioxmpZTIe6tVvkuUv0C/xXFuJKiP2t0lgQrrus+xbSpw98IL3+3BcR1B43z71i+XRvTDbQ4gNVgsYH8rcMHA== X-MS-Exchange-CrossTenant-Network-Message-Id: 1f453e38-15cc-428a-9f47-08d801a5adcd X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2020 18:50:37.1789 (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: EFx/NbV0uvdypTedtVE2RjJ2CMe8A2CySFO4V3HfIrAJEc+yM+jkaNw2huiL1hhA X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR1501MB2175 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.687 definitions=2020-05-26_02:2020-05-26,2020-05-26 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 lowpriorityscore=0 mlxlogscore=759 suspectscore=2 priorityscore=1501 cotscore=-2147483648 adultscore=0 malwarescore=0 phishscore=0 bulkscore=0 impostorscore=0 mlxscore=0 clxscore=1015 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005260145 X-FB-Internal: deliver Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 26, 2020 at 12:52:24PM +0200, Vlastimil Babka wrote: > On 4/22/20 10:47 PM, Roman Gushchin wrote: > > Currently there are two lists of kmem_caches: > > 1) slab_caches, which contains all kmem_caches, > > 2) slab_root_caches, which contains only root kmem_caches. > > > > And there is some preprocessor magic to have a single list > > if CONFIG_MEMCG_KMEM isn't enabled. > > > > It was required earlier because the number of non-root kmem_caches > > was proportional to the number of memory cgroups and could reach > > really big values. Now, when it cannot exceed the number of root > > kmem_caches, there is really no reason to maintain two lists. > > > > We never iterate over the slab_root_caches list on any hot paths, > > so it's perfectly fine to iterate over slab_caches and filter out > > non-root kmem_caches. > > > > It allows to remove a lot of config-dependent code and two pointers > > from the kmem_cache structure. > > > > Signed-off-by: Roman Gushchin > > Reviewed-by: Vlastimil Babka Thanks! > > > @@ -1148,11 +1126,12 @@ static void cache_show(struct kmem_cache *s, struct seq_file *m) > > > > static int slab_show(struct seq_file *m, void *p) > > { > > - struct kmem_cache *s = list_entry(p, struct kmem_cache, root_caches_node); > > + struct kmem_cache *s = list_entry(p, struct kmem_cache, list); > > > > - if (p == slab_root_caches.next) > > + if (p == slab_caches.next) > > print_slabinfo_header(m); > > - cache_show(s, m); > > + if (is_root_cache(s)) > > + cache_show(s, m); > > If there wasn't patch 17/19 we could just remove this condition and have > /proc/slabinfo contain the -memcg variants? Sure, it's an option too. But because it's a user facing option, I'd keep it as it is now at least until everything will settle down a bit. Thanks!